fix(app): per-workspace naming for git sub-folder workspaces#18277
Open
Skeptomenos wants to merge 3 commits intoanomalyco:devfrom
Open
fix(app): per-workspace naming for git sub-folder workspaces#18277Skeptomenos wants to merge 3 commits intoanomalyco:devfrom
Skeptomenos wants to merge 3 commits intoanomalyco:devfrom
Conversation
When multiple sub-folders of the same git repository are opened as separate sidebar entries, renaming one would rename all of them because the name was stored per-project (git root), not per-workspace. This change adds per-workspace name overrides for git sub-folder workspaces using the existing workspace:project persisted storage (ProjectMeta), which was already used for non-git projects since bcf7a65. Changes: - enrich(): check workspace-level name override even for git projects - dialog-edit-project: route sub-folder renames to per-workspace storage - layout renameProject: same routing for inline rename Root-level renames still update the server DB (existing behavior). Closes anomalyco#18276
Author
|
Note on CI: The 2 e2e failures ( 111/113 tests passed. The 2 failing tests fail identically on |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
…onFromWorkspace
createSessionFromWorkspace expects { slug, raw, directory } but was
receiving just the slug string. This caused space.directory to be
undefined, failing the waitDir assertion on every run.
The other failing test (projects-switch.spec.ts:78) is a CI timing
issue — waitDir polls the URL with a 45s timeout that can be exceeded
on slower CI runners. This test also fails on the dev branch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #18276
Type of change
What does this PR do?
When you open multiple sub-folders of the same git repo as separate sidebar entries, renaming one renames all of them. This happens because all worktrees share a single
project.namein the DB keyed by git root commit hash.The fix adds per-workspace name overrides for git sub-folder workspaces. The mechanism already exists for non-git projects (
workspace:projectin.datfiles, added inbcf7a65e) — this PR extends it to git projects.Three changes:
enrich()inlayout.tsx— When a workspace-level name exists in the.datfile, use it instead of the shared project name. Without this,if (!isGlobal) return baseexits early and ignores the local override entirely.handleSubmit()indialog-edit-project.tsx— Before callingproject.update()(which writes to the shared DB), check ifworktree !== gitRoot.worktree. If it's a sub-folder, route toglobalSync.project.meta()instead.renameProject()inpages/layout.tsx— Same sub-folder check for inline renames.Root-level renames still go through
project.update()and affect all worktrees (existing behavior).How did you verify your code works?
Manually tested with a monorepo (
its-fusion-kitchen) that has multiple sub-folder sidebar entries. Before fix: renaming "golden-ticket" sub-folder also renamed the root project. After fix: each sidebar entry keeps its own name independently.Checklist