Skip to content

feat: added toggle for separating public and home - #2986

Draft
RohitKushvaha01 wants to merge 4 commits into
Acode-Foundation:mainfrom
RohitKushvaha01:main
Draft

RohitKushvaha01 wants to merge 4 commits into
Acode-Foundation:mainfrom
RohitKushvaha01:main

Conversation

@RohitKushvaha01

Copy link
Copy Markdown
Member

No description provided.

@github-actions github-actions Bot added the translations Anything related to Translations Whether a Issue or PR label Oct 23, 2026
@RohitKushvaha01 RohitKushvaha01 changed the title feat: added toggle for saperating public and home feat: added toggle for separating public and home Oct 23, 2026
@greptile-apps

greptile-apps Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 3/5

[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

  1. P1 Postponed restarts break file paths ▶
  2. P1 New keys fail translation checks ▶
  3. P2 Empty migrations never finish ▶
  4. P2 Tests miss broken layout choices ▶

Summary

Adds a setting to keep /public, /home, and /root separate.

  • Terminal users can keep /home and /root separate from /public.
  • Terminal files follow the selected home layout when migrated or opened.
  • The Android HTTP plugin entry no longer sets a protocol blacklist.

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
Loading

Reviews (1) · Last reviewed commit: "Merge branch 'Acode-Foundation:main' int..." · Reviewed by Greptile

Comment on lines +1236 to +1240
const mergedHomeDirectories =
appSettings.value.terminalSettings?.mergedHomeDirectories !== false;
const homePathMatch = mergedHomeDirectories
? prootPath.match(/^\/(home|root)(\/.*)?$/)
: null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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

Comment thread src/lang/en-us.json
Comment on lines +481 to +485
"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.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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

Comment on lines +648 to +651
# 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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Empty migrations never finish

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.

Comment on lines +29 to +35
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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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!

@RohitKushvaha01
RohitKushvaha01 marked this pull request as draft October 23, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

translations Anything related to Translations Whether a Issue or PR

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant