Skip to content

fix(app): reuse open project root for nested folders#16686

Open
tsubasakong wants to merge 28 commits intoanomalyco:devfrom
tsubasakong:fix/project-picker-nested-folder-16645
Open

fix(app): reuse open project root for nested folders#16686
tsubasakong wants to merge 28 commits intoanomalyco:devfrom
tsubasakong:fix/project-picker-nested-folder-16645

Conversation

@tsubasakong
Copy link

Issue for this PR

Closes #16645

Type of change

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

What does this PR do?

Issue #16645 reports that opening a nested child folder from an already-open repo adds a duplicate project entry and can strand navigation on the nested path instead of the original repo.

This PR adds a small workspace-root helper that prefers the deepest already-open project root containing the selected directory. The project-open and project-navigation paths now reuse that canonical root, so selecting a nested folder inside an already-open repo reopens the existing project instead of creating a second project entry.

How did you verify your code works?

I verified the touched path-resolution logic locally by reviewing the new helper coverage and running git diff --check to confirm the patch is clean.

I also attempted to run bun test --preload ./happydom.ts ./src/pages/layout/helpers.test.ts from packages/app, but this checkout does not currently have the app dev dependency @happy-dom/global-registrator installed, so the unit test could not run in this environment.

Screenshots / recordings

Not included for this focused path-resolution fix.

Checklist

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

@natewill
Copy link
Contributor

natewill commented Mar 9, 2026

This is similar to #16684, but only fixes #16645 and not #16713

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.

[BUG] Project picker breaks when adding nested child folder from existing project repo

2 participants