Repository navigation
fix(console): an app-root deep link keeps its query when it redirects to the landing page - #27641
Merged
Merged
Conversation
…t and console-root landing redirects The app root (`/apps/:appName`) redirected to the app's landing with a target built from the landing alone, so `?palette=1` and every other URL overlay param was dropped before anything read it. `AppRootLanding` now carries search and hash onto the landing, merging with a landing that has a query of its own (a key the link names replaces the landing's value). `RootLandingRedirect` at the console root carries them as well. Claude-Session: https://claude.ai/code/session_01Utp6CbjUouY1fgaJXGSQMk Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#4 · os-bill · session_01Utp6CbDAucNyQ4UtzCJKyh 席位核对ACCEPT · head
Generated by Claude Code |
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.
Requested by Bill · project thread
Fixes #27450
Clause-②: no
Metadata-protocol: none
维护者速读
/apps/APP?palette=1这类应用根深链时,应用根重定向到默认页会保留查询串和 hash,命令面板照常打开;?recordId=、?form=等其它 URL 浮层参数同样保留。控制台根/?palette=1也一样。params、对象filters/runAction)时两者合并,同名键以链接为准、不重复。回滚即 revert 本 PR。ui/packages/app-shell/src/console/AppContent.tsx的carryQueryOntoLanding与AppRootLanding里那行Navigate;然后ui/apps/console/src/components/RootLandingRedirect.tsx末尾的重定向;最后新测试AppContent.rootLandingCarriesQuery-27450.test.tsx。pnpm --dir ui exec vitest run packages/app-shell/src/console/__tests__/AppContent.rootLandingCarriesQuery-27450.test.tsx apps/console/src/components/RootLandingRedirect.route.test.tsx,预期 2 个文件 22 个用例全绿。What changes
Two redirects that land a user on a page rebuilt their target without the URL's query, so the URL overlays (
?palette=1,?recordId=,?form=, the constants inurlParams.ts) were dropped beforeuseUrlOverlayread them./apps/APP,AppRootLandinginAppContent.tsx): theNavigateto the app's landing now goes through a new local helper,carryQueryOntoLanding(landing, location.search, location.hash). With nothing arriving the target is unchanged. With no query on the landing the arriving search is appended as written. A landing can carry a query of its own (apageentry'sparams, anobjectentry'sfiltersorrunAction, built byresolveHref): then the two merge throughURLSearchParams, and a key the arriving URL names replaces the landing's values for that key instead of doubling it (the link is the more specific ask). The arriving hash wins over a landing hash;resolveHrefemits none today./,RootLandingRedirectinui/apps/console): theRedirectWithSplashtarget now appendslocation.searchandlocation.hash. Its landing is a bare/apps/SEGMENTor/home, so there is nothing to merge; the app root it lands on carries the query on in turn.The fix is generic query carriage, not a palette special case. The other redirects on these paths were measured and left as they are:
AppContent),LegacyMetadataRedirectdirectory mode,ShorthandRecordRedirect,SystemRedirectandSetupRedirectinConsoleShell.tsx.homePathinAppContent(RedirectWithSplash to={homePath}). It is a refusal, not a landing on the requested page, and a record-overlay param there would address an app the caller cannot open.LegacyMetadataRedirectresource mode deliberately consumes its?type=into the path; unchanged.metadata/package/*forwards to a fixed packages page; unchanged.Changeset:
@object-ui/app-shellpatch,@object-ui/consolepatch.Tests
ui/packages/app-shell/src/console/__tests__/AppContent.rootLandingCarriesQuery-27450.test.tsx, on theAppContent.nameAliasRedirect-26183harness (a realAppContentmount; the router's location is the observation point). ItsConsoleLayoutstand-in keeps the realCommandPaletteProviderthe shipped layout mounts, so "the palette is open" is that provider's own answer from the landed URL. Cases: the card's URL (/apps/showcase_app?palette=1, through the name-alias move too) lands on the default page with?palette=1kept,REPLACE, palette open; a record-drawer param and a hash are carried; a landing with its own?runAction=merges with?palette=1; a key both name is the link's value once; CONTROL: a bare app root lands bare with the palette closed.ui/apps/console/src/components/RootLandingRedirect.route.test.tsx: three cases added (default app with query and hash, the launcher with query, CONTROL bare/), and its location probe now also renders the hash.Ablation, each via
scripts/ablation-replace.mjs(anchor hit 1 to 0, restored to the HEAD blob withgit diff HEADempty):AppContent.tsxtarget reverted toto={landing}: 4 of 5 new cases red, the CONTROL green.RootLandingRedirect.tsxtarget reverted toto={landing}: the 2 new carrying cases red, the other 15 in the file green.Acceptance notes
/home?palette=1from the console root keeps the query, but the home frame mounts noCommandPaletteProvider(useCommandPalettedocuments the home and orgs frames as palette-less), so the palette does not open there. The card names the app root; this is noted, not changed./?palette=1goes to login first; whetherLoginRedirectcaptures a bare/with a query is outside this card and unchanged.AppContenttest above.Verification
Targeted tests, ablation and typecheck (head 27534cf)
pnpm --dir ui exec vitest run --maxWorkers=2 --reporter=verbose packages/app-shell/src/console/__tests__/AppContent.rootLandingCarriesQuery-27450.test.tsx apps/console/src/components/RootLandingRedirect.route.test.tsx: Test Files 2 passed (2), Tests 22 passed (22).AppContent.*file on landing, alias, boot redirects, pseudo-routes, the Setup and System redirect targets, and the console'sRootLandingRedirect,landingHomeParity-7256andSetupRoutetests): Test Files 20 passed (20), Tests 193 passed (193).AppContent.tsxanchorto={carryQueryOntoLanding(landing, location.search, location.hash)}toto={landing}: Tests 4 failed, 1 passed (5); restored, blob == HEAD.RootLandingRedirect.tsxanchor on the template-literal target toto={landing}: Tests 2 failed, 15 passed (17); restored, blob == HEAD.pnpm --filter @object-ui/app-shell run type-check: exit 0; the new test file is intsconfig.test.json's program (--listFilesOnlycount 1).pnpm --filter @object-ui/console run type-check: exit 0 (after building the five plugin dists the console imports); the route test is in its program (--listFilesOnlycount 1).eslinton the four touched files: 0 errors; no warning on a touched line.check:new-line-citations(ui): 0 new citations.Derived gates
At head
27534cfd,node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 34 derived; each run and recorded asCOMMAND :: exit CODE, all 34 exit 0, reconciled with--ran: "34 derived famil(ies) accounted for — 34 run, 0 NOT-MEASURED".node scripts/check-sdui-manifest.mjsandpnpm check:nul-bytesare among them.mainmoved 4 commits since the base77e993ea, none touching these files; no merge taken. Every other family is CI's, on this PR's check-runs.Generated by Claude Code