Skip to content

fix(app): per-workspace naming for git sub-folder workspaces#18277

Open
Skeptomenos wants to merge 3 commits intoanomalyco:devfrom
Skeptomenos:fix/per-workspace-project-naming
Open

fix(app): per-workspace naming for git sub-folder workspaces#18277
Skeptomenos wants to merge 3 commits intoanomalyco:devfrom
Skeptomenos:fix/per-workspace-project-naming

Conversation

@Skeptomenos
Copy link

@Skeptomenos Skeptomenos commented Mar 19, 2026

Issue for this PR

Closes #18276

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

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.name in 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:project in .dat files, added in bcf7a65e) — this PR extends it to git projects.

Three changes:

  1. enrich() in layout.tsx — When a workspace-level name exists in the .dat file, use it instead of the shared project name. Without this, if (!isGlobal) return base exits early and ignores the local override entirely.

  2. handleSubmit() in dialog-edit-project.tsx — Before calling project.update() (which writes to the shared DB), check if worktree !== gitRoot.worktree. If it's a sub-folder, route to globalSync.project.meta() instead.

  3. renameProject() in pages/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

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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
@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Mar 19, 2026
@Skeptomenos
Copy link
Author

Note on CI: The 2 e2e failures (projects-switch.spec.ts:78 and workspace-new-session.spec.ts:89) are pre-existing — the dev branch itself has the same failures on all recent runs of the test workflow. These are timeout failures in workspace navigation tests, unrelated to the naming changes in this PR.

111/113 tests passed. The 2 failing tests fail identically on dev, kit/effectify-tool-registry, kit/effectify-plugin, and every other open PR branch.

@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Mar 19, 2026
@github-actions
Copy link
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Project rename affects all sub-folder workspaces of the same git repo (should be per-workspace)

1 participant