Repository navigation
Conversation
…y stay mounted A hidden region takes no space, goes inert and keeps its state. Focus inside it moves to main. The region's edge and the content's change in space play as one motion through the shared edge reveal, which measures both before the commit and plays both on one clock after it. On a phone the drawer and its toggle follow 'sideNav', and a drawer with nothing to show reads as closed without writing the app's open state. The section variant's side nav divider goes with the hidden side nav. MobileNav moves focus to main when the button that opened it is hidden. Records: AppShell FR19-FR21, a Public concepts row and verification rows, and the MobileNav FR6 amendment. Stories: Focus Mode and the section variant. Co-authored-by: AK <[email protected]> Co-authored-by: Humberto Virtudes <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
|
/approve-spec 2733c69 |
There was a problem hiding this comment.
Changes requested. hiddenRegions works as described on desktop, where both regions slide out with the content on one clock and go inert, but four phone paths don't yet match the AppShell records.
- On a phone, hiding the nav that fills an open drawer removes the menu button instead of hiding it (
MobileNavTogglerenders nothing once mobile navigation is disabled), so MobileNav's new hidden-opener branch never runs and focus ends in the closed drawer or on the page body instead of main (FR20). - On a phone with a top nav, hiding the side nav unmounts its drawer copy and hiding the top nav swaps the whole drawer subtree, so the side nav's state resets after a hide and show (FR19).
- With a top nav that has no drawer items of its own, hiding the side nav removes the drawer while
useAppShellMobile()still reports it open and enabled, so an app's ownMobileNavTogglestays expanded for a drawer that is gone (FR19). - Hiding only the top nav on a phone leaves the visible side-nav top bar without a banner landmark, because the bar checks
headerContent == nullwhile the hidden header still exists (FR3). - The changeset's "keep their state" and "MobileNav moves focus to main when the button that opened it is hidden" don't hold inside AppShell on a phone until the points above are fixed.
A phone-width AppShell test for each path (drawer open, then hide) would pin the fixes. The inline comments point at the lines involved.
[Automated review]
…focus to main - A hidden side nav stays mounted, hidden and inert, inside the top nav's drawer, and the drawer no longer swaps its subtree when the top nav hides, so the side nav keeps its state on a phone. - TopNav reports whether it has drawer items of its own, so a drawer with only a hidden side nav reads as closed and disabled. - When the drawer closes because it has nothing left to show, its menu button is gone, and MobileNav moves focus to this shell's main. - With only the top nav hidden, the side nav's bar keeps the banner landmark. Co-authored-by: AK <[email protected]> Co-authored-by: Humberto Virtudes <[email protected]>
|
/approve-spec ab61fbc |
There was a problem hiding this comment.
Changes requested. The phone gaps from the last round are fixed: a hidden side nav keeps its drawer state, an empty drawer reads closed, focus reaches this shell's main, and the banner landmark stays. Four things still need work:
- With a TopNav that has only a heading and no side nav, a shell that passes no
hiddenRegionsnow treats its drawer as empty, so amobileNav.contentdrawer and the app's ownMobileNavTogglestop rendering anduseAppShellMobile()reports navigation disabled, against AppShell FR11 and FR12 (countcontentas drawer content and apply the empty-drawer test only while a region is hidden). - TopNav reports its items to AppShell from a layout effect into state that starts at
true, so the first render, and the server HTML, show a menu toggle for an empty drawer that goes only after hydration; derive whether the top nav has drawer items during render instead. - With only the top nav hidden on a phone, the drawer is still headed by the hidden top nav's heading because
TopNavpassesheader={heading}whatever its hidden state, while FR19 keeps a hidden top nav out of the drawer. - Miss: hiding both navs also drops a
mobileNav.contentdrawer that still has content to show (FR12), which the first fix covers.
CI has not run on this head yet. The inline comments point at the lines involved.
[Automated review]
…idden A shell that hid nothing, with a heading-only TopNav and the app's own drawer content, lost its drawer and toggle. The empty-drawer rule now applies only while a listed region is hidden, and counts the app's own drawer content. Whether the top nav has drawer items of its own is read from its props during render, with no Effect or state, so the server HTML matches. A hidden top nav gives the drawer no heading. A test matrix pins the drawer of a shell that hides nothing; it passes on main too. Co-authored-by: AK <[email protected]> Co-authored-by: Humberto Virtudes <[email protected]>
|
/approve-spec b8ddd89 |
There was a problem hiding this comment.
Changes requested. hiddenRegions works as described on desktop and leaves shells that hide nothing unchanged, but four things still need work:
- When an app wraps a heading-only TopNav in its own component and hides only the side nav,
topNavHasDrawerItemscounts the wrapper as having items, so on a phone the menu button stays and opens an empty drawer whileuseAppShellMobile()reports it open and enabled, against AppShell FR19. - Miss: when a region hides while the phone drawer is open, the drawer closes as FR20 says, but revealing the region reopens it and moves focus into it because AppShell keeps its stored open state, against FR20's "Revealing a region does not move focus"; clear AppShell's own open state when the drawer empties and say in the record what a controlled drawer does on reveal.
- Miss: TopNav FR5 and FR6 still say the drawer is headed by
heading, shows a divider whenever items and side nav content are both present, and keeps the toggle while AppShell passes side nav content, which no longer holds for hidden regions, so add a clause deferring to AppShell FR19 and give the MobileNav FR6 amendment the removed-opener case the code handles. - Miss: the changeset, the prop's JSDoc and both doc descriptions say the phone drawer and its toggle follow
'sideNav', but with a top nav that has items hiding the side nav keeps the toggle and with only a top nav hiding'topNav'removes it, so describe it as the drawer leaving out each hidden region and its toggle going when nothing is left.
CI has not run on this head yet. The inline comments point at the lines involved.
[Automated review]
A TopNav wrapped in the app's own component is not one AppShell can read, so with only the side nav hidden its menu button stayed and opened an empty drawer. TopNav now shows its menu button and opens its drawer, during render, only for its own items unless hidden and the side nav unless hidden. A drawer with nothing visible closes, and focus goes to main. FR19 states what AppShell reports for a slot that is not a TopNav element. Co-authored-by: AK <[email protected]> Co-authored-by: Humberto Virtudes <[email protected]>
|
/approve-spec b5f3bab |
There was a problem hiding this comment.
Changes requested. The wrapped TopNav menu button from the last round is fixed, and shells that hide nothing still render exactly as on main, but three things still need work:
- When a region hides while the phone drawer is open, revealing it reopens the drawer and moves focus into it because AppShell keeps its stored open state (
AppShell.tsx:727-728), against FR20's "Revealing a region does not move focus", and with a heading-only TopNav wrapped in the app's own component the same state leavesuseAppShellMobile()reporting the drawer open (an app's ownMobileNavTogglereads expanded) while TopNav holds it closed, against FR19; clear the stored state when the drawer empties and say in FR19 and FR20 what a controlled drawer and a top nav slot AppShell cannot read report. - TopNav FR5 and FR6 still say the drawer is headed by
heading, shows a divider whenever items and side nav content are both present, and keeps the toggle while AppShell passes side nav content, which no longer holds for hidden regions, so add a clause deferring to AppShell FR19 and give the MobileNav FR6 amendment the removed-opener case the code handles. - The changeset, the prop's JSDoc and both doc descriptions say the phone drawer and its toggle follow
'sideNav', but with a top nav that has items hiding the side nav keeps the toggle and with only a top nav hiding'topNav'removes it, so describe it as the drawer leaving out each hidden region and its toggle going when nothing is left.
CI has not run on this head yet. The inline comments point at the lines involved.
[Automated review]
Outside AppShell, when the button that opened the drawer is hidden, MobileNav focused the page's first main with a plain focus(). A <main> without tabindex cannot take it, so focus fell to the page, against FR6. It now focuses main through focusForLastInputTemporarily, which gives a plain <main> a tab stop until focus leaves it. Test: a standalone MobileNav with a plain <main> and a hidden opener; focus lands on main. It fails before this change.
|
/approve-spec 264f871 |
|
Decision: D-20261113-306 Records the owner's direction to keep the list ("We just keep the list") at 264f871, where AppShell's hidden mobile regions pause and keep their scroll (AppShell FR19), and MobileNav returns focus to main when its opener is hidden, now also outside AppShell (MobileNav FR6). It waives nothing. |
There was a problem hiding this comment.
Changes requested: one fix remains, in the pull request description.
- The Test plan still describes the revision before last: it reports 484 passing tests where the AppShell, TopNav and MobileNav suites run 485, names the browser scroll spec as the check that fails on the previous revision where the new plain-
<main>MobileNav case is the one that fails there, and says the previous revision brought the side nav back at 26 px where it brings it back at 74 px.
The AppShell, TopNav and MobileNav record changes are approved for this head, and the code checks out: shells that omit hiddenRegions render as before, and a hidden side nav comes back at its scroll position. Non-blocking: two comment-style suggestions in AppShell.tsx remain open, spec:AST-105 FR9's adopter list does not name AppShell's hidden regions, and the description's Records list leaves out the architecture:react-component-runtime paragraph.
Claims and files checked
Claims:
- Changeset: AppShell takes a list that hides its top nav or side nav while they stay mounted: verified (the prop in
AppShell.tsx; the API generator's one row). - Changeset: a hidden region takes no space, is inert, keeps its state, and focus inside it moves to main: verified (the
hiddenRegionstests; two zero-size inert regions in Chromium). - Changeset: the region slides out by its edge as the content takes its space, in one motion: verified (mid-motion, all four running animations share one progress and main has the same share of travel left on both axes).
- Changeset: on a phone the drawer leaves out hidden regions and its menu button goes when nothing is left: verified (phone tests; no menu button in Chromium).
- Changeset: a region that hides while the drawer is open closes it, and revealing it does not reopen it: verified (phone tests, uncontrolled and controlled).
- Changeset: MobileNav moves focus to main when its opener is hidden: verified (both hidden-opener tests, the plain-main one failing on the previous revision).
- Changeset: patch release with the co-authors credited: verified (frontmatter, the AppShell compatibility line).
- Description, user impact: content takes the freed space on one clock, a hidden nav keeps its state and scroll and pauses after it slides out, it is inert, the phone drawer rules, the section divider goes, and shells without the prop are unchanged: verified (tests; Chromium scroll 74 to 74; divider frame; identical default frames).
- Description, public delta: one new prop, and an unknown entry is ignored with a warning: verified.
- Description, change list for AppShell, TopNav, MobileNav and the phone paths: verified against the code.
- Description, records list: verified; it leaves out the runtime-architecture paragraph (narrower, non-blocking).
- Description, stories, docs and changeset: verified.
- Description, red-first: 20 of 32 new AppShell cases and the MobileNav hidden-opener case fail on main: verified.
- Description, the previous revision passes every jsdom case and fails only the browser scroll spec: false (the new plain-main case fails there; the scroll check holds there).
- Description, hides-nothing matrix and the per-path phone cases pass: verified.
- Description, the browser scroll spec keeps 74 px: verified; that the previous revision returned 26 px: false (it returns 74 px).
- Description, 484 tests pass in the three suites: false (485).
- Description, typecheck, lint, the knowledge check and the changeset check pass: verified.
- Description, a preview check follows: a future step, not checked.
- Description, size figures (20 files, +1575/−157, 911 product lines over 14 files, 821 other): verified.
- Description, review-round list: verified against the code and records.
Files:
.changeset/appshell-hidden-regions.md: clear.apps/storybook/stories/AppShell.stories.tsx: clear.docs/architecture/react-component-runtime.md: clear.docs/specs/components/AppShell/AppShell.spec.md: clear.docs/specs/components/MobileNav/MobileNav.spec.md: clear.docs/specs/components/TopNav/TopNav.spec.md: clear.internal/eslint-plugin-astryx/no-comment-provenance.baseline.json: clear (baseline check passes).packages/core/src/AppShell/AppShell.doc.mjs: clear.packages/core/src/AppShell/AppShell.test.tsx: clear.packages/core/src/AppShell/AppShell.tsx: two non-blocking comment-style suggestions (lines 752-754 and 1392-1393).packages/core/src/AppShell/__tests__/AppShellHiddenRegionScroll.a11y.chromium.spec.ts: clear.packages/core/src/AppShell/appShellActivity.tsx: clear.packages/core/src/AppShell/appShellDrawerFocus.ts: clear.packages/core/src/MobileNav/MobileNav.tsx: clear.packages/core/src/MobileNav/MobileNavFocus.test.tsx: clear.packages/core/src/TopNav/TopNav.slotPresence.test.tsx: clear.packages/core/src/TopNav/TopNav.tsx: clear.packages/core/src/TopNav/TopNavMobileContentContext.ts: clear.packages/core/src/motion/scrollOffsets.ts: clear.packages/core/src/motion/transientCopy.ts: clear.
There was a problem hiding this comment.
Approved pending CI: CI's jobs were skipped on this draft head, so CI has not run on it yet.
An engineering owner approved the AppShell, TopNav, MobileNav and runtime record changes for this exact head, and the code matches them: the corrected Test plan reproduces here, a scrolled side nav comes back at 74 px after focus mode in Chromium, and shells that omit hiddenRegions render the same frames as main. Optional touch-ups, none required:
- Two new comments in
AppShell.tsx(lines 752-754 and 1392-1393) could become short active sentences, as the open inline suggestions show. spec:AST-105FR9 lists every edge-reveal adopter in Core, and AppShell's hidden regions now use that reveal without a line there.- The description's Records list could name the paragraph added to
architecture:react-component-runtime.
Claims and files checked
Claims (changeset and description), each verified at this head:
- New optional prop hides the top nav or side nav while they stay mounted: verified (
AppShell.tsx:371,:1126-1142,:1428-1438; state-kept test). - A hidden region takes no space, is inert, keeps its state, and focus inside it moves to main: verified (
AppShell.tsx:381-399; inert, state and focus tests; Chromium: regions 1280×0 and 0×560). - The region slides out by its edge with the content, in one motion: verified (
AppShell.tsx:1316-1336; Chromium: four animations at one progress, main at the same fraction of travel on both axes, reversal mid-motion runs back together). - On a phone the drawer leaves out hidden regions and its menu button goes when nothing is left: verified (
AppShell.tsx:772-776,TopNav.tsx:265-267; phone tests; Chromium phone: menu button 1 to 0). - Hiding while the drawer is open closes it, and revealing does not reopen it: verified (uncontrolled and controlled tests, no open-change call).
- MobileNav moves focus to main when its opener is hidden, a plain main included: verified (
MobileNav.tsx:403-418; both hidden-opener tests, red on the base branch). - A hidden nav keeps open groups, scroll and rail state, and pauses once slid out on React 19.2 and later: verified (state and effect-log tests; Chromium: 74 px, 0 while paused, 74 px after the reveal).
- With the section variant the divider goes with the side nav: verified (
AppShell.tsx:385; Chromium frame). - Apps that omit the prop are unchanged: verified (six default-shell frames pixel-identical to the base branch; hides-nothing matrix passes on both).
- Public delta is one prop with exactly two values, an unknown entry warned in development, no other API change: verified (API generator: one row;
AppShell.tsx:733-741; warning test). - Change list (zero-size inert panel and row, banner rule, edge reveal measured before and played after the commit, focus handoff, shared Activity module, phone drawer paths, TopNav gating including a wrapped TopNav, MobileNav hidden and removed opener): verified against the source and its tests.
- Records list: verified; it leaves out the runtime-record paragraph the diff also adds.
- Red-first results (20 of 32 new cases and both hidden-opener cases fail on the base branch; only the plain-main case fails on the previous revision): verified by re-running both.
- Browser scroll check at 1280×200 brings the side nav back at 74 px: verified with the same steps in Chromium.
- 485 tests pass; typecheck, lint, knowledge and changeset checks pass: verified.
- Size figures (20 files, +1575/−157, 911 product lines over 14 files): verified.
- Review-round list and co-author credit: verified (diff, commit trailers, changeset).
- Writing rubric results (present tense, no research, evidence cited, no change references, no open questions added): verified against the record diffs.
- The real-browser preview check that "follows": a forward statement, not checkable; the Chromium checks above cover its scenarios.
Files:
.changeset/appshell-hidden-regions.md: clearapps/storybook/stories/AppShell.stories.tsx: cleardocs/architecture/react-component-runtime.md: cleardocs/specs/components/AppShell/AppShell.spec.md: cleardocs/specs/components/MobileNav/MobileNav.spec.md: cleardocs/specs/components/TopNav/TopNav.spec.md: clearinternal/eslint-plugin-astryx/no-comment-provenance.baseline.json: clearpackages/core/src/AppShell/AppShell.doc.mjs: clearpackages/core/src/AppShell/AppShell.test.tsx: clearpackages/core/src/AppShell/AppShell.tsx: two optional comment rewritespackages/core/src/AppShell/__tests__/AppShellHiddenRegionScroll.a11y.chromium.spec.ts: clearpackages/core/src/AppShell/appShellActivity.tsx: clearpackages/core/src/AppShell/appShellDrawerFocus.ts: clearpackages/core/src/MobileNav/MobileNav.tsx: clearpackages/core/src/MobileNav/MobileNavFocus.test.tsx: clearpackages/core/src/TopNav/TopNav.slotPresence.test.tsx: clearpackages/core/src/TopNav/TopNav.tsx: clearpackages/core/src/TopNav/TopNavMobileContentContext.ts: clearpackages/core/src/motion/scrollOffsets.ts: clearpackages/core/src/motion/transientCopy.ts: clear
|
/approve-spec 4b46c2e |
There was a problem hiding this comment.
Changes requested. An engineering owner approved the AppShell, TopNav, MobileNav and runtime record changes for this exact head, and the hidden-region behavior holds in tests and in Chromium; two things need fixing:
- Newly live check:
hiddenRegionsadds about 1.2 KB gzip of first-load JavaScript to a page that renders AppShell with TopNav and SideNav without using it (2.5 KB with SideNav only, 4.3 KB for AppShell alone, becauseAppShell.tsxnow importsTopNav.tsx), over the 0.3 KB thatarchitecture:component-import-boundariesINV10 allows, so move the hidden-region code behind its own import or a deferred load and report the per-page deltas, or have an engineering owner amend INV10. - Regression: after the merge of
main, the Test plan's "485 passed at this head" is 515 in 24 files, and its "previous head" result now points at a revision where that case passes, so update both.
Optional touch-ups: the two comment rewrites in AppShell.tsx from the open inline suggestions, a line for AppShell in spec:AST-105 FR9's adopter list, and the runtime-record paragraph in the description's Records list. CI has not run on this draft head.
Claims and files checked
Claims (changeset and description), at this head:
- A new optional prop hides the top nav, the side nav or both while they stay mounted: verified (state test; Chromium).
- A hidden region takes no space, is inert and keeps its state, and focus inside it moves to main: verified (inert, state and focus tests; Chromium regions 1280×0 and 0×560).
- The region slides out by its edge with the content, in one motion: verified (Chromium: four animations at one progress, main partway through its travel).
- On a phone the drawer leaves out hidden regions and its menu button goes when nothing is left: verified (phone tests; Chromium menu buttons 1 to 0).
- Hiding while the drawer is open closes it, and revealing does not reopen it: verified (uncontrolled and controlled tests).
- MobileNav moves focus to main when its opener is hidden, a plain main included: verified (both hidden-opener tests, red on the base branch).
- A hidden nav keeps open groups, scroll and rail state, and pauses once slid out on React 19.2 and later: verified (state and effect tests; Chromium 74 px, 0 while paused, 74 px after the reveal).
- With the section variant the divider goes with the side nav: verified (Chromium frame).
- Apps that omit the prop are unchanged: verified for behavior and rendering (default frames identical to the base branch; hides-nothing matrix); they do load the feature's code (first finding).
- The public delta is one prop with exactly two values, an unknown entry warned in development: verified (API generator: one row).
- Change list (zero-size inert panel and row, banner rule, edge reveal, focus handoff, shared Activity module, phone drawer paths, TopNav gating, MobileNav hidden and removed opener): verified against the source and its tests.
- Records list: verified; it leaves out the runtime-record paragraph.
- Red first on the base branch (20 of 32 new cases and both hidden-opener cases fail): verified.
- Previous-head result (only the plain-main case fails): false at this head; the revision before this merge carries the same patch and passes that case.
- Hides-nothing matrix passes on the base branch and here: verified.
- Browser scroll check brings the side nav back at 74 px: verified with the same steps in Chromium.
- 485 tests pass: false (515 in 24 files at this head); typecheck, lint, knowledge and changeset checks pass: verified.
- Size figures (20 files, +1575/−157, 911 product lines over 14 files): verified.
- Review-round list, co-author credit and writing rubric results: verified.
- Land path waits for the shared-file pull request: it has merged, and this head is the one merge of the base branch after it.
- The real-browser preview check that "follows": a forward statement, not checkable.
Files:
.changeset/appshell-hidden-regions.md: clearapps/storybook/stories/AppShell.stories.tsx: cleardocs/architecture/react-component-runtime.md: cleardocs/specs/components/AppShell/AppShell.spec.md: cleardocs/specs/components/MobileNav/MobileNav.spec.md: cleardocs/specs/components/TopNav/TopNav.spec.md: clearinternal/eslint-plugin-astryx/no-comment-provenance.baseline.json: clearpackages/core/src/AppShell/AppShell.doc.mjs: clearpackages/core/src/AppShell/AppShell.test.tsx: clearpackages/core/src/AppShell/AppShell.tsx: first-load cost (first finding); two optional comment rewritespackages/core/src/AppShell/__tests__/AppShellHiddenRegionScroll.a11y.chromium.spec.ts: clearpackages/core/src/AppShell/appShellActivity.tsx: clearpackages/core/src/AppShell/appShellDrawerFocus.ts: clearpackages/core/src/MobileNav/MobileNav.tsx: clearpackages/core/src/MobileNav/MobileNavFocus.test.tsx: clearpackages/core/src/TopNav/TopNav.slotPresence.test.tsx: clearpackages/core/src/TopNav/TopNav.tsx: first-load cost (first finding)packages/core/src/TopNav/TopNavMobileContentContext.ts: clearpackages/core/src/motion/scrollOffsets.ts: clearpackages/core/src/motion/transientCopy.ts: clear
… TopNav AppShell imported TopNav only to tell whether a top nav has items of its own for the phone drawer. That check moves to a small module that TopNav registers itself in, so a page with AppShell and no TopNav loads no TopNav code (about 1.3 KB gzip less first-load JavaScript). No behavior change.
|
/approve-spec 8e71aef |
There was a problem hiding this comment.
Changes requested: an engineering owner approved the AppShell, TopNav, MobileNav and runtime-record changes for this head, and the hidden-region behavior holds in tests and in Chromium, but these blocking findings need fixing:
TopNav/topNavDrawerItems.tskeeps TopNav's type in a module-localWeakSet, soscripts/shared-identity.test.mjsfails and a swizzled TopNav is not recognised by AppShell; keep the set under a versioned shared key fromutils/sharedRealm, one slot per React, asspec:AST-110FR3 asks.TopNav/topNavDrawerItems.tsis a new internal module thatAppShell.tsximports and no record names, so add it to a record with its usage, why it is needed and whyTopNavMobileContentContextis not enough, for an owner decision.- Newly live check:
hiddenRegionsadds about 1.3 KB gzip of first-load JavaScript to a page that renders AppShell with TopNav and SideNav without using it (3.0 KB for AppShell alone), over the 0.3 KB thatarchitecture:component-import-boundariesINV10 allows, so move the hidden-region code behind its own import or a deferred load, or have an engineering owner amend INV10. - The description's Size section says 20 files, +1575/−157 and 911 product lines over 14 files, while this head changes 21 files, +1609/−157, with 945 product lines over 15 files, so update the counts and the comparison with the earlier approved head.
The branch now conflicts with main in AppShell.tsx, TopNav.tsx, AppShell.spec.md, TopNav.spec.md and MobileNav.spec.md, and the head that resolves it needs an engineering owner's /approve-spec <full head SHA> again, which the author may give as an engineering owner. Optional touch-ups: drop the unused isValidElement import in TopNav.tsx, take the open comment suggestions, and add AppShell to the edge-reveal adopters in spec:AST-105 FR9. CI has not run on this draft head.
Claims and files checked
Review mode: same-head; reason: none
Changed rules (0): none
Claims (changeset and description), at this head:
- A new optional prop hides the top nav, the side nav or both while they stay mounted: verified (state test; Chromium).
- A hidden region takes no space, is inert and keeps its state, and focus inside it moves to main: verified (inert, state and focus tests; Chromium regions 1280×0 and 0×560, focus on the content button).
- The region slides out by its edge with the content, in one motion: verified (Chromium halfway through the 300 ms slide: region and content edges both at 12.02 px on the side and 2.22 px on top).
- On a phone the drawer leaves out hidden regions and its menu button goes when nothing is left: verified (phone tests; Chromium menu buttons 1 to 0).
- Hiding while the drawer is open closes it, and revealing does not reopen it: verified (uncontrolled and controlled tests).
- MobileNav moves focus to main when its opener is hidden, a plain main included: verified (both hidden-opener tests, red on the base branch).
- A hidden nav keeps open groups, scroll and rail state, and pauses once slid out: verified (state and effect tests; Chromium 74 px, 0 while paused, 74 px after the reveal).
- With the section variant the divider goes with the side nav: verified (Chromium frame of the section story).
- Apps that omit the prop are unchanged: verified for behavior and rendering (default frames identical to the base branch at 1280 and 390 px; hides-nothing cases); they do load the feature's code (INV10 finding).
- The public delta is one prop with exactly two values, an unknown entry warned in development: verified (API generator: one row; development-only warning).
- AppShell no longer imports TopNav and reads its drawer items through the new module, about 1.3 KB less without TopNav: verified (imports; 1.31 KB less than the previous revision for AppShell alone).
- Change list (zero-size inert panel and row, banner rule, edge reveal, focus handoff, shared Activity module, phone drawer paths, TopNav gating, MobileNav hidden and removed opener): verified against the source and its tests.
- Records list: verified; it leaves out the runtime-record paragraph.
- Red first on the base branch, the hides-nothing cases, and the browser scroll check at 74 px: verified.
- 517 tests pass in 24 files; typecheck, lint, knowledge, changeset and import-boundary checks pass: verified.
- First-load figures (+3.04, +1.21, +1.37 KB; reference pages unchanged): verified within 0.05 KB (3.04, 1.23, 1.32 KB; reference pages 0).
- File and line counts in the Size section: false at this head (21 files, +1609/−157; 945 product lines over 15 files).
- Product size about what was approved at the earlier approved head: not supported by line counts (666 product lines over 10 files there, 945 here).
- Review-round list, co-author credit and writing rubric results: verified.
- The real-browser preview check that "follows": a forward statement, not checkable.
- Land path waits on another pull request, then one merge of the base branch: that pull request has merged; the branch now needs that merge, as it conflicts in five files.
Files:
.changeset/appshell-hidden-regions.md: clearapps/storybook/stories/AppShell.stories.tsx: cleardocs/architecture/react-component-runtime.md: owner-approved at this headdocs/specs/components/AppShell/AppShell.spec.md: owner-approved at this head; conflicts withmaindocs/specs/components/MobileNav/MobileNav.spec.md: owner-approved at this head; conflicts withmaindocs/specs/components/TopNav/TopNav.spec.md: owner-approved at this head; conflicts withmaininternal/eslint-plugin-astryx/no-comment-provenance.baseline.json: clearpackages/core/src/AppShell/AppShell.doc.mjs: clearpackages/core/src/AppShell/AppShell.test.tsx: clearpackages/core/src/AppShell/AppShell.tsx: first-load cost; two optional comment rewrites; conflicts withmainpackages/core/src/AppShell/__tests__/AppShellHiddenRegionScroll.a11y.chromium.spec.ts: clearpackages/core/src/AppShell/appShellActivity.tsx: clear (named by an approved record)packages/core/src/AppShell/appShellDrawerFocus.ts: clear (named by an approved record)packages/core/src/MobileNav/MobileNav.tsx: clearpackages/core/src/MobileNav/MobileNavFocus.test.tsx: clearpackages/core/src/TopNav/TopNav.slotPresence.test.tsx: clearpackages/core/src/TopNav/TopNav.tsx: first-load cost; unused import; conflicts withmainpackages/core/src/TopNav/TopNavMobileContentContext.ts: clearpackages/core/src/TopNav/topNavDrawerItems.ts: module-local registry; no naming recordpackages/core/src/motion/scrollOffsets.ts: clear (named by an approved record)packages/core/src/motion/transientCopy.ts: clear
|
|
||
| // TopNav adds itself when its module loads, so a TopNav element can only | ||
| // exist once its type is here. | ||
| const topNavTypes = new WeakSet<object>(); |
There was a problem hiding this comment.
topNavTypes is module-local, so a swizzled TopNav registers in its own copy's set and the package AppShell counts it as an unknown slot (with only the side nav hidden, useAppShellMobile() keeps reporting an empty drawer as enabled). scripts/shared-identity.test.mjs fails on it at this head (spec:AST-110 FR3). Keeping the set under a versioned key from utils/sharedRealm, one slot per React as utils/sharedContext.ts does with realmValue(sharedKey(...)), fixes both.
AppShell.tsx imports this module from outside TopNav/, so a record also needs to name it, with its usage and why TopNavMobileContentContext is not enough (architecture:knowledge-contracts DEC-22).
Supersedes #10276 (SideNav
collapsedWidth/collapsedVariant), and builds the hide-and-keep part of #3890 by AKnassa and of the Focus Mode spec in #8410 by humbertovirtudes on AppShell. Both are credited as co-authors and in the changeset. Owner decision, Nov 6 2026: hidden regions live on the shell, as one controlled list, so the shell can play the nav's slide and the content's reflow as one motion.User impact
An app can now hide its top nav, its side nav, or both, for example for a focus mode, and bring them back exactly as they were:
hiddenRegionsare unchanged.Public delta
AppShellProps.hiddenRegions?: ReadonlyArray<'topNav' | 'sideNav'>. Exactly those two values; the banner and content can't be hidden. At runtime an unknown entry is ignored with a development warning. No other API change.Change
AppShell.tsx:appShellActivity.tsx, which AppShell and TopNav share.mobileNav.isOpenor callsonOpenChange.mobileNav.content. A shell that hides nothing keeps its drawer exactly as before.useAppShellMobile()keeps reporting the drawer as enabled there.MobileNav.tsx: an opener that is still connected but hidden (inert) counts as gone, and focus moves to main; a plain<main>with no tab stop gets one until focus leaves it. Inside AppShell, a menu button removed because the drawer has nothing left to show counts as gone too, and focus moves to this shell's main (an internal context, not the document's first main).spec:AST-002FR4 admission note and the Implementation note), and the Compatibility line.Core/AppShell"Focus Mode" and "Hidden Side Nav Section"; docs;[feat]changeset.Test plan
main, 20 of the 32 newhiddenRegionsjsdom cases fail and all pass here; the cases that pass onmainhold trivially there, becausemainhas nohiddenRegions. The MobileNav hidden-opener cases also fail onmain.hiddenRegionsomitted or empty × a heading-only top nav, a top nav with items, app drawer content, and no navigation. It checks the drawer's enabled state and toggle count, and passes onmainand here, so the hidden-state logic can't change the default shell.onOpenChangenever called); a wrapped heading-only top nav with only the side nav hidden shows no menu button; the drawer keeps the hidden side nav's state; a drawer with nothing left reads as closed and its toggle goes; focus reaches main when the drawer closes because its side nav hid; and the banner landmark stays when only the top nav hides.AppShellHiddenRegionScroll.a11y.chromium.spec.ts(pr-a11y): on the Focus Mode story at 1280×200, where the side nav scrolls and hiding the top nav grows the side column, a side nav scrolled to 74 px, hidden until it pauses and shown again comes back at 74 px. The offsets are read before the commit that hides the region changes the DOM, so the column's growth cannot clamp them.tscis clean, and lint,pnpm check:knowledge,pnpm check:changesetsandpnpm check:component-import-boundariespass.Writing rubric results
R1 narration: none; FR19–FR21, DEC-2 and the MobileNav FR6 amendment state the behavior in the present tense.
R2 research: none in the records.
R3 evidence: FR19–FR21 cite the owner decision and
spec:AST-002,spec:AST-105and MobileNav; verification rows name tests and stories, with no pull request.R4 rejected alternatives: the Does-not-own list states scope, not history.
R5 change references: none.
R6 open questions: none added.
Size
First-load JavaScript (
architecture:component-import-boundariesINV10), measured with the size report's esbuild build (.github/scripts/lib/component-size.jsoptions), gzip, base = merge base. For a page that renders AppShell withouthiddenRegions: AppShell alone +3.04 KB, AppShell + SideNav +1.21 KB, AppShell + TopNav + SideNav +1.37 KB. The docs, form, menu and table reference pages are unchanged (+0.01, 0, 0, 0 KB). AppShell no longer imports TopNav: it reads the top nav's drawer items throughTopNav/topNavDrawerItems.ts, which TopNav registers in (about 1.3 KB less on pages without TopNav). The rest is the hidden-region code itself, which is over INV10's 0.3 KB; how it loads is being decided before the next revision.vs main: 20 files, +1575/−157. Product lines 911 across 14 files (
AppShell.tsx450,TopNav.tsx95,MobileNav.tsx50,motion/scrollOffsets.ts41,motion/transientCopy.ts40,appShellDrawerFocus.ts33,appShellActivity.tsx33, theTopNavMobileContentContext.tschange 30, the doc 14, records 123, the comment-provenance baseline 2); the rest is tests, the stories and the changeset (821).Review rounds since CodeBunny approved the shape: TopNav's hidden-region flags ride the existing internal
TopNavMobileContentContext(the separate TopNav shell context is gone); the drawer-focus context is a shared context;component:AppShellnamesappShellDrawerFocus.tsin its ownership; AppShell's and MobileNav's latest-value refs use Core's internaluseCommittedRef; the AppShell FR20 verification row namesMobileNavFocus.test.tsx; a hidden region now pauses in Activity once its exit motion ends, as DEC-2's implementation note states, with the Activity wrapper moved toappShellActivity.tsx(named incomponent:AppShell's ownership).The product size is about what CodeBunny approved at cc51d1c with no size finding, and the owner's API approval covers the shape. Two changes in these rounds touch
hiddenRegions: theTopNavMobileContentContext.tsdoc comment that names it, and the Activity pause of a hidden region, which brings the code to DEC-2's recorded note. Splitting would reopen a reviewed, approved shape without benefit to anyone using AppShell.Owner and land path