Repository navigation
feat: added toggle for separating public and home - #2986
RohitKushvaha01 wants to merge 4 commits into
Conversation
[Medium impact] The PR changes terminal home-folder behavior and Android HTTP plugin configuration. Fix the postponed-restart file paths and failing translation check before merging. Findings
SummaryAdds a setting to keep
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User changes layout] --> B[Save preference]
B --> C{Shell running?}
C -->|No| D[Write layout marker]
C -->|Yes| E{Restart now?}
E -->|Yes| F[Close sessions and stop shell]
F --> D
D --> G[Next startup reads marker]
G --> H[Choose home and directory mounts]
E -->|No| I[Old shell keeps old layout]
B --> J[File conversion reads new preference]
I --> K[File paths can disagree]
J --> K
Reviews (1) · Last reviewed commit: "Merge branch 'Acode-Foundation:main' int..." · Reviewed by Greptile |
| const mergedHomeDirectories = | ||
| appSettings.value.terminalSettings?.mergedHomeDirectories !== false; | ||
| const homePathMatch = mergedHomeDirectories | ||
| ? prootPath.match(/^\/(home|root)(\/.*)?$/) | ||
| : null; |
There was a problem hiding this comment.
Postponed restarts break file paths
convertProotPath() uses the saved layout even when the user declines the restart. Start in separate mode, enable merging, and cancel the restart: the shell still uses the independent /home, but acode requests for /home/project now point to public/project. This opens the wrong location or fails to find the file.
Keep the running layout separate from the pending preference, and use the running layout when converting paths.
Knowledge Base Used: Settings domains and persistence
| "terminal:merged home directories": "Merged home directories", | ||
| "info-mergedHomeDirectories": "Mount /public as /home and /root inside the terminal. Disable to keep /public, /home and /root as separate directories; existing files stay where they are. Restarting the terminal is required for changes to take effect.", | ||
| "terminal:restart home layout": "Restart terminal", | ||
| "info-terminal-restart-home-layout": "Open terminal sessions will be closed so the new home directory layout can take effect.", | ||
| "terminal:restart required": "Restart the terminal to apply this change.", |
There was a problem hiding this comment.
New keys fail translation checks
The five new English keys are missing from every other language catalog. Changing en-us.json triggers the translation check, and lang check exits with an error for missing English keys. Add these keys to the other catalogs, using English text where translations are unavailable.
Knowledge Base Used: Appearance and language resources
| # Mark as migrated so this only runs once, even when there | ||
| # was nothing to copy. Later independent /home or /root | ||
| # contents must not be treated as legacy data. | ||
| touch "$MIGRATE/.migrated" |
There was a problem hiding this comment.
The new unconditional touch fails when neither old home directory contains files and public/MIGRATE does not exist. Both mkdir calls are inside the copy branches, so an empty installation never writes the marker or sets _legacyHomeMigrated. Create MIGRATE before touching the marker so this normal case succeeds instead of logging and retrying.
| it("only binds /home and /root while merged", () => { | ||
| const mergedGuard = sandboxScript.indexOf( | ||
| 'if [ "$MERGED_HOME_DIRS" = "true" ]; then', | ||
| ); | ||
| expect(mergedGuard).toBeGreaterThan(-1); | ||
| expect(sandboxScript.indexOf("public:/home")).toBeGreaterThan(mergedGuard); | ||
| expect(sandboxScript.indexOf("public:/root")).toBeGreaterThan(mergedGuard); |
There was a problem hiding this comment.
Tests miss broken layout choices
The new layout tests check that text exists, not what either layout does. For example, the bind test passes if both bind lines are moved after the closing fi, which would merge the directories in separate mode too. Exercise missing, merged, and separate markers with a stubbed launcher, then assert the resulting arguments and HOME.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
No description provided.