feat(app-shell): useUrlOverlay primitive + URL-addressable shortcuts dialog (ADR-0054 Phase 2)#1882
Merged
Merged
Conversation
…dialog (ADR-0054 Phase 2) Generalizes the Phase 1 command-palette fix into a reusable overlay primitive and brings a second navigable overlay to the contract. - **useUrlOverlay(key)** — router-aware hook storing a navigable overlay's open state in a `?<key>=1` URL param: idempotent open (C1), deep-linkable / restore-on-reload / back-forward (C3). `alias`/`value`/`replace` configurable. 8 unit tests (MemoryRouter). - **CommandPaletteProvider** refactored onto useUrlOverlay (`?palette=1`, `?cmdk=1` alias) — behavior unchanged, ~50 lines of bespoke URL logic removed. - **KeyboardShortcutsDialog** is now URL-addressable (`?shortcuts=1`) and gains a click entry in the header Help menu (C2) — it was previously reachable ONLY via the `?` key (now an accelerator) with toggle-as-open `useState`. Adds `data-testid="overlay:keyboard-shortcuts"`. - The shared overlay primitives already forward `data-testid` + emit Radix `data-state`; documented in the README (no code change needed). Verified in-browser (agent-browser / CDP): palette click-open + `?palette=1` deep-link still work post-refactor; the shortcuts dialog opens via the Help-menu click, via `?shortcuts=1` deep-link, and via the `?` accelerator; no a11y errors. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
This was referenced Jun 22, 2026
xuyushun441-sys
added a commit
that referenced
this pull request
Jun 22, 2026
…ADR-0054 Phase 5) (#1890) Locks in the testability contract so it can't regress ("counts can only go down"). - **Conformance test** (`adr0054-ratchet.test.ts`, runs in the gating `pnpm test` job): fails the build if a new synthetic-event trigger (`dispatchEvent(new KeyboardEvent/MouseEvent/PointerEvent)`) appears anywhere in `packages/*/src` or `apps/*/src`. Legitimate `CustomEvent`/`PopStateEvent` dispatch (event bus / history nudge) stays allowed. - **Local ESLint rule** `object-ui/no-synthetic-event-trigger` flags the same pattern in-editor (the repo `Lint` workflow is manual `workflow_dispatch`, so the test — not lint — is the CI gate). Plain-JS RuleTester unit test. - **Last two offenders fixed**: the sidebar swipe-to-open gestures (`UnifiedSidebar`, `AppSidebar`) dispatched a synthetic click on the trigger; now call the idempotent `setOpenMobile(true)` directly (C1). Tree is clean at zero. - Docs: README "Testability ratchet" section; ADR-0054 marked all five phases shipped. Completes the ADR-0054 rollout (Phases 1 #1879, 2 #1882, 3 #1883, 4 #1887, 5). Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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.
What & why
ADR-0054 "UI testability contract" — Phase 2 (overlay primitives). Generalizes the Phase 1 command-palette reference fix into a reusable primitive, and brings a second navigable overlay (the keyboard-shortcuts dialog) to the contract.
Changes
useUrlOverlay(key, { alias?, value?, replace? })— a router-aware hook that stores a navigable overlay's open state in a?<key>=1URL search param. Idempotent open (C1:openOverlay()/setOpen(true)are no-ops when already open, never toggle), deep-linkable / restore-on-reload / back-forward aware (C3). Exported from@object-ui/app-shell. 8 unit tests (MemoryRouter).CommandPaletteProviderrefactored ontouseUrlOverlay('palette', { alias: 'cmdk' })— behavior unchanged; ~50 lines of bespoke URL logic removed.KeyboardShortcutsDialog— was reachable only via the?key (sole keyboard trigger) with toggle-as-openuseState. Now:?shortcuts=1(C3),?remains an accelerator,data-testid="overlay:keyboard-shortcuts"(C4).Dialog/Sheet/Drawer/Popover/DropdownMenu/AlertDialog) already forwarddata-testidonto their content and emit Radixdata-state="open|closed"— verified and documented in the README; no code change needed.Verification (browser, agent-browser / CDP-real keystrokes)
Worktree console (
:5182, mypackages/*/srcvia HMR) →app-showcasebackend (:3000):?palette=1); Escape closes + clears the param. ✅overlay:keyboard-shortcuts, URL gains?shortcuts=1,role="dialog". ✅?shortcuts=1opens it on fresh page load. ✅?accelerator: still toggles the dialog. ✅Unit/type:
useUrlOverlay(8) + app-shell suite (650) + i18n (156) green;tscbuild green.ADR rollout
Phase 1 (#1879) merged. This is Phase 2. Next: Phase 3 (settle signal), Phase 4 (locator coverage), Phase 5 (ratchet).
🤖 Generated with Claude Code