fix(app): open project when navigating directly to a project URL#16838
Open
minhhieugma wants to merge 1 commit intoanomalyco:devfrom
Open
fix(app): open project when navigating directly to a project URL#16838minhhieugma wants to merge 1 commit intoanomalyco:devfrom
minhhieugma wants to merge 1 commit intoanomalyco:devfrom
Conversation
abb2c9e to
3ffdab3
Compare
3ffdab3 to
b623105
Compare
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 #16837
Type of change
What does this PR do?
When the app is opened at a project URL directly (e.g. reloading the page, opening a session link in a new tab, or deep-linking), the sidebar panel renders blank. The existing auto-select
createEffectbails out early whenstate.autoselectisfalse— which is always the case when adirparam is already in the URL. This meanslayout.projects.open()is never called,layout.projects.list()stays empty,currentProject()returnsundefined, and the sidebar shows nothing.The fix adds a second
createEffectthat reacts to changes inpageReady,layoutReady,currentDir(), andlayout.projects.list(). If the current directory is not already in the open projects list (checking bothworktreeandsandboxes), it callsopenProject(dir, false)to register it without navigating.How did you verify your code works?
opencode weband navigate to a project to get a project URL (e.g.http://localhost:4096/<base64-dir>/session)./) still works correctly.Screenshots / recordings
If this is a UI change, please include a screenshot or recording.
Checklist