Repository navigation
refactor(ui): extract parseRoute and add ViewScope with useView (RIG-4439) - #1652
Merged
Merged
Conversation
|
😎 This pull request was merged. |
|
Compass engineering docs preview: https://compass-ui-rig-4439-view-sco.compass-eng-docs.pages.dev Deployed from |
rigel-mintaka
marked this pull request as ready for review
October 4, 2026 19:43
…4439) Co-authored-by: Matt Wilkinson <matt@rigel.build>
rigel-mintaka
force-pushed
the
compass-ui/rig-4439-view-scope
branch
from
October 5, 2026 00:02
ac27f73 to
0cb4119
Compare
This was referenced Oct 5, 2026
Merged
mattwilkinsonn
added this pull request to stack #1838
October 7, 2026 00:43
mattwilkinsonn
approved these changes
Oct 7, 2026
|
This pull request was merged into |
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.
This PR is part of a stack containing 7 PRs:
mainT1 of the in-window tabs and split views record (
docs/designs/ui/compass-in-window-tabs/design.md§T1). No user-visible change; no surface readsuseView()yet (T2).view-route.ts:RouteMatch, pureparseRoute(the parseapplyRoutedid inline; unknown path → Bridge) and its inverseroutePath.store.ts:applyRouteis now a switch overparseRoute.firstChannelIdmoves to module scope and takeschannels, so the scope reuses it.view-scope.ts:ViewScope,createViewScope,ViewContext,useView(). The pending-aware hold-then-fallback runs inside the scope and navigates only that view.One behavior difference: on main, an unknown path left the routed state untouched until the router's
*redirect to/landed.parseRoutemaps it to the Bridge directly, which is where that redirect goes.The store's
applyChannelRoute/applyTopicRoutetests inrouting.test.tsxstay. Production still runs that path until T2 moves surfaces onto the scope.Tests
moon run compass-ui:test: 1212 pass, 0 fail.compass-ui:typecheckandstylelintpass; biome clean on the new files.parseRoute/routePathround-trips plus unknown→Bridge; 4ViewScopecases for channel and topic hold-then-resolve and hold-then-fallback, each also asserting a second scope stays put;useViewthrows outside a provider.Spec-impact: none.
Ledger-impact: none
Co-authored-by: Matt Wilkinson matt@rigel.build