Repository navigation
feat(ui): window layout model, hash sync and session persistence (RIG-4443) - #1743
Merged
trunk-io[bot] merged 3 commits intoOct 7, 2026
Conversation
…-4443) Adds the pure layout reducer (window-layout.ts) and wires it into the store: the router mirrors the focused view, history entries carry their view id, and the layout persists to sessionStorage. Co-authored-by: Matt Wilkinson <matt@rigel.build>
This was referenced Oct 5, 2026
Merged
|
Compass engineering docs preview: https://compass-ui-rig-4443-window-l.compass-eng-docs.pages.dev Deployed from |
…443) Co-authored-by: Matt Wilkinson <matt@rigel.build>
…IG-4443) Co-authored-by: Matt Wilkinson <matt@rigel.build>
rigel-mintaka
marked this pull request as ready for review
October 5, 2026 21:20
This was referenced Oct 5, 2026
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:
mainTabs T3 of
docs/designs/ui/compass-in-window-tabs/design.md§T3 (RIG-4443), stacked on T2 #1675. No tab strip yet; that is T4.window-layout.ts: pure reducer per the §T3 interface. It hasMAX_TABS = 10,reduceLayout(returns{refused: "tab-cap"}),loadLayout(storage, hashPath),saveLayout, andsessionLayoutStorage(), which returnsundefinedwhen sessionStorage throws.store.ts:layoutsignal anddispatchLayout; a refused action leaves the layout as is. There is oneViewScopeper view instance, keyed by view id, andfocusedViewis the layout's focused view.bindRouter). It loads the layout from sessionStorage plus the current hash and saves on each change. A hash change applies to the view its historystate.viewIdnames, or to the focused view when that id is missing or closed. A navigation inside one view pushes{viewId}. A focus change replaces, so tab switches never stack. The sync to the hash runs in a microtask, sonavigateis never called from inside an effect callback.mount.tsx:stateHashHistory()addswindow.history.stateto router reads and listens topopstate. Two entries with the same hash but different views fire nohashchange.view-scope.ts:createViewScopetakes an optionalViewPathSource, so the layout owns the path.App.tsx: passesnavigateoptions and the location state to the store.ViewHostis keyed on the focused view.Record readings (§A2/§A8):
layout/dispatchLayoutuse the names from §T4.Tests
window-layout.test.ts(13): dedupe, close focus order, the last-tab rule, the cap, move bounds, a split that closes back to a single view, resize clamp, restore, corrupt storage falling back to Bridge, and a deep link opening as the focused tab.window-history.test.tsx: the §T3 memory-history scenario as written. It was red first (0/3) before the wiring.moon run compass-ui:test: 1229 pass, 0 fail. Typecheck passes.visual-smoke+dev-boot: 13 passed, no baseline change. The Solid dev warnings match T2's (53STRICT_READ_UNTRACKED, 0FLUSH_IN_EFFECT_CALLBACK).Review fixes (9d75eb4, bad886a): a restored split keeps its saved focused pane when both panes show the hash. Restored id seeds must be integers in [0, 1e9], so untrusted storage cannot stall the id counter. Both have regression tests that fail on the earlier code. Review is now clean. Full suite: 1231 pass.
CI state
moon (nix)ande2eon the previous run were cancelled with "The job was not acquired by Runner of type hosted even after multiple attempts". That is the fleet-wide hosted-runner shortage since ~19:40Z, which has been routed to the CI owner. Every job that ran passed. The cancelled jobs have been re-run once.Spec-impact: none.
Ledger-impact: none
Co-authored-by: Matt Wilkinson matt@rigel.build