fix(app): reuse open project root for nested folders#16686
Open
tsubasakong wants to merge 28 commits intoanomalyco:devfrom
Open
fix(app): reuse open project root for nested folders#16686tsubasakong wants to merge 28 commits intoanomalyco:devfrom
tsubasakong wants to merge 28 commits intoanomalyco:devfrom
Conversation
Contributor
…ested-folder-16645
…ested-folder-16645
…ested-folder-16645
…ested-folder-16645
…ested-folder-16645
This was referenced Mar 12, 2026
This was referenced Mar 12, 2026
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 #16645
Type of change
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 --checkto confirm the patch is clean.I also attempted to run
bun test --preload ./happydom.ts ./src/pages/layout/helpers.test.tsfrompackages/app, but this checkout does not currently have the app dev dependency@happy-dom/global-registratorinstalled, so the unit test could not run in this environment.Screenshots / recordings
Not included for this focused path-resolution fix.
Checklist