Uh oh!
There was an error while loading. Please reload this page.
fix(studio): refresh sidebar metadata when switching packages - #1183
Merged
Conversation
Make the sidebar package dropdown drive the URL instead of local state. The $package layout already syncs selectedPackage from the URL param, so the previous setSelectedPackage-only handler was being immediately reverted by that effect, which kept AppSidebar.loadMetadata from re-running. Now selecting a package navigates to /$newPackage; the URL->state effect updates selectedPackage, which invalidates loadMetadata's dependency and refreshes the left metadata list for the newly selected package. Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/3dce7059-3349-474c-b9c3-aa576806fc14 Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
The latest updates on your projects. Learn more about Vercel for GitHub.
|
xuyushun441-sys
marked this pull request as ready for review
April 19, 2026 06:37
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Switching the active package via the Studio sidebar's dropdown did not refresh the left metadata list — it stayed pinned to the previously selected package.
Root cause
apps/studio/src/routes/$package.tsxwired the dropdown'sonSelectPackagedirectly tosetSelectedPackage. The same layout also runs a URL→stateuseEffectthat forcesselectedPackageto match the$packageroute param. Because the dropdown never changed the URL, that effect revertedselectedPackageto the old package on the next render, andAppSidebar.loadMetadata(keyed onselectedPackage) never re-ran.Changes
/$newPackageinstead of mutating local state; the existing URL→state sync then updatesselectedPackage, invalidatingloadMetadata's dependency and refetching metadata for the new package.$packageparam, to avoid a redundant navigation.CHANGELOG.md— entry under Unreleased → Fixed.