Skip to content

feat(MobileNav): the Close button and the toggle carry their own theme targets - #12466

Closed
josephfarina wants to merge 5 commits into
mainfrom
core-mobile-nav-button-targets
Closed

josephfarina wants to merge 5 commits into
mainfrom
core-mobile-nav-button-targets

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

MobileNav's Close button and the phone menu button (MobileNavToggle) are Buttons with no theme target of their own. A theme can reach them only through button, which styles every Button on the page, so a theme that draws its secondary or ghost buttons as raised, light boxes also puts those boxes on a dark top bar and a dark drawer, where the two buttons should read as items of the bar and the drawer.

The Close button now carries mobile-nav-close and the toggle's Button carries mobile-nav-toggle, each beside Button's own target. Button rules still reach them. An entry on either is one class, so until a part's own entry wins over the component it sits on (#12378), Button's variant, size and elevation entries win where they set the same property. The default look does not change.

  • MobileNav.tsx: themeProps('mobile-nav-close') on the drawer header's Close button.
  • MobileNavToggle.tsx: mobile-nav-toggle on the Button, a caller className kept beside it.
  • MobileNav.doc.mjs: both targets.
  • MobileNav record: public contract, builder impact, compatibility lines, ownership (Owns names both targets; Button keeps how they draw), FR1, FR11, the design note and the theming anatomy (Close button and Toggle button now name their targets); DEC-3 records the decision.
  • Probe theme regenerated.
  • Tests: the Close button carries mobile-nav-close and astryx-button; the toggle carries mobile-nav-toggle, astryx-button and a caller class.

Before: the only selector reaching either button was .astryx-button. After: .astryx-mobile-nav-close and .astryx-mobile-nav-toggle reach exactly those two elements (tests above); every other Button is unchanged.

Test plan: vitest --project ui MobileNav.test.tsx MobileNavToggle.test.tsx (42 pass), theme/themingTargets.test.ts (459 pass), pnpm visual:probe-theme:check, knowledge check, prettier.

Scope

  • Components: MobileNav (mobile-nav-close on the Close button, mobile-nav-toggle on MobileNavToggle's Button).

Writing rubric results

Record rubric (docs/contributing/spec-writing.md) over MobileNav.spec.md:

  • R1 narration: DEC-3 states the system in the present tense.
  • R2 research: none in the record.
  • R3 evidence: cells name tests and source, no pull request or commit.
  • R4 rejected alternatives: one, inside DEC-3, one line.
  • R5 change references: none.
  • R6 open questions: none.
  • R7 project status: none.

@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 19, 2026 2:15am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 17, 2026
@astracat-bot

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 19, 2026, 2:26 AM UTC

@josephfarina
josephfarina marked this pull request as ready for review November 17, 2026 22:37
@josephfarina

Copy link
Copy Markdown
Contributor Author

Owner decision (engineering owner, covering this pull request): MobileNav's close button and its menu toggle get their own theme targets, mobile-nav-close and mobile-nav-toggle, beside Button's own target, so a dark bar's or drawer's look reaches its buttons. They are additive, and the default look is unchanged. The MobileNav record (DEC-3) states this, and a scoping test covers it. Once the part-wins-over-component rule is on main, both declare sitsOn: 'button' and join the shared-element list.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec afa3753

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the two new theme targets render where the description says and their direction is owner-approved, but the release note and the record overstate what a theme entry on them does, and the record contradicts itself on ownership.

  • A mobile-nav-close or mobile-nav-toggle entry is one class and loses to Button's variant, size and elevation entries (a class plus an attribute) on these two ghost Buttons until the part-wins rule in #12378 lands, so narrow the changeset's "apart from other Buttons", DEC-3's "adds to them" and the description's "applies on top", or stack this change on #12378 with a test that the part entry wins.
  • docs/specs/components/MobileNav/MobileNav.spec.md still lists "The Close and Toggle button surfaces — delegated to component:Button" under Does not own and leaves both targets out of Owns, which contradicts its own FR1, anatomy and DEC-3, and no requirement states mobile-nav-toggle.
  • The test plan's "41 pass" for MobileNav.test.tsx and MobileNavToggle.test.tsx is 42 at this head.

Under the repository's probe theme both buttons keep Button's elevation colour at this head, so the regenerated probe entries for the two targets never paint. Non-blocking: the new comment in MobileNavToggle.tsx restates the code in its second clause, and that file's header does not list themeProps.

Claims and files checked

Review mode: full; reason: no-earlier-review

Claims:

  • The Close button carries its own theme target beside Button's: verified (MobileNav.tsx:799, new test).
  • The toggle's Button carries its own target and keeps a caller class: verified (MobileNavToggle.tsx:117-119, new test).
  • Button rules still reach both buttons: verified (probe theme, Button entries apply).
  • A theme entry on either applies on top: false (Button's variant, size and elevation entries win).
  • Changeset, a theme can draw them apart from other Buttons: false for any property Button's prop entries set.
  • The default look does not change: verified (base and head render identically with no theme).
  • The component doc lists both targets: verified (MobileNav.doc.mjs:164-165, :245-246).
  • The record's contract, compatibility lines, FR1, design note, anatomy and new decision are updated: verified; the ownership section is not (finding).
  • The probe theme is regenerated with 279 targets: verified (probe check passes).
  • The new selectors reach exactly those two elements: verified (new MobileNav.test.tsx test).
  • Stacked on the drawer-target pull request, retargeting later: verified (this base is that pull request's head).
  • Test plan, the two MobileNav test files give 41 passes: false (42).
  • Test plan, theming-target tests (459), probe check, knowledge check and Prettier: verified.
  • Writing rubric results for the record: verified (DEC-3 in the present tense, one rejected alternative, no change references).

Files:

  • .changeset/core-mobile-nav-button-targets.md: finding 1.
  • docs/specs/components/MobileNav/MobileNav.spec.md: findings 1 and 2.
  • packages/core/src/MobileNav/MobileNav.doc.mjs: clear.
  • packages/core/src/MobileNav/MobileNav.test.tsx: clear.
  • packages/core/src/MobileNav/MobileNav.tsx: clear.
  • packages/core/src/MobileNav/MobileNavToggle.test.tsx: clear.
  • packages/core/src/MobileNav/MobileNavToggle.tsx: clear (non-blocking comment and header notes).
  • packages/themes/probe/src/probeTheme.ts: clear (generated, current).

Automated review (maintainer link)

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec a98462b

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet, and it runs once this pull request targets main.

An engineering owner approved the MobileNav record changes at this exact head, so the Close button's mobile-nav-close and the toggle's mobile-nav-toggle targets are decided direction. The three changes requested last round are fixed: the changeset and DEC-3 now say Button's variant, size and elevation entries win where they set the same property, the record's ownership matches FR1, FR11 and DEC-3, and the test count is 42.

  • Non-blocking: DEC-3's "until a part's own entry wins over the component it sits on" (MobileNav.spec.md:345) is work-order status under the record rubric's R7; state the present rule ("where Button's variant, size or elevation entries set the same property, Button's win") and let the change that alters the cascade update it.
  • Non-blocking: the earlier note on the toggle's source comment (MobileNavToggle.tsx:115-116) still applies.
Claims and files checked

Review mode: full; reason: spec-record

Claims:

  • The Close button carries its own target beside Button's: verified (MobileNav.tsx:799; MobileNav.test.tsx).
  • The toggle's Button carries its own target and keeps a caller class: verified (MobileNavToggle.tsx:115-119; MobileNavToggle.test.tsx).
  • Button rules still reach both buttons: verified (a themed capture keeps Button's ghost background).
  • Button's variant, size and elevation entries win where they set the same property: verified (themed capture: background from Button, icon colour and border from the new targets).
  • The default look does not change: verified (unthemed and probe-theme captures are pixel-identical to the base).
  • Only these two elements carry the new classes: verified (MobileNav.test.tsx).
  • The component doc, the record and the regenerated probe theme (279 targets) list both targets: verified (MobileNav.doc.mjs:164-165, :245-246; probe check).
  • The change is stacked on the drawer-target pull request: verified (the base branch tip is that pull request's head).
  • 42 component tests, 459 theming-target tests, the probe check, the knowledge check and Prettier pass: verified (run at this head).
  • Writing rubric R1 to R6: verified; R7 "no project status": not met by DEC-3's "until" clause (non-blocking, above).
  • Changeset: verified; it makes the same claims as above.

Files:

  • .changeset/core-mobile-nav-button-targets.md: clear
  • docs/specs/components/MobileNav/MobileNav.spec.md: owner-approved; non-blocking note on DEC-3's wording
  • packages/core/src/MobileNav/MobileNav.doc.mjs: clear
  • packages/core/src/MobileNav/MobileNav.test.tsx: clear
  • packages/core/src/MobileNav/MobileNav.tsx: clear
  • packages/core/src/MobileNav/MobileNavToggle.test.tsx: clear
  • packages/core/src/MobileNav/MobileNavToggle.tsx: earlier non-blocking comment note stands
  • packages/themes/probe/src/probeTheme.ts: clear (generated and current)

Automated review (maintainer link)

carries `mobile-nav-close` and the Toggle's Button carries `mobile-nav-toggle`,
each beside Button's own target, so Button rules still reach them. An entry on
either is one class, so where Button's `variant`, `size` or `elevation` entries
set the same property, Button's win until a part's own entry wins over the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking (record rubric R7): "until a part's own entry wins over the component it sits on" is true until the cascade change lands and false after. Suggest stating the present rule:

An entry on either is one class, so where Button's `variant`, `size` or
`elevation` entries set the same property, Button's win.

The change that lets a part's entry win can then update DEC-3.

@josephfarina
josephfarina changed the base branch from core-mobile-nav-drawer-target to main November 18, 2026 00:52
@josephfarina
josephfarina force-pushed the core-mobile-nav-button-targets branch from a98462b to 8852977 Compare November 18, 2026 00:54
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 4258598

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
AppShell 99.0 kB (+28 B) · 14.4 kB CSS (0) — — · — · —
TopNav 79.4 kB (+28 B) · 11.8 kB CSS (0) — — · — · —
MobileNavToggle 66.7 kB (+17 B) · 10.8 kB CSS (0) — — · — · —
2 more components
Component Size LoC Visual · A11y · RTL
SideNav 122.6 kB (+11 B) · 12.2 kB CSS (0) — — · — · —
MobileNav 77.7 kB (+8 B) · 11.4 kB CSS (0) — — · — · —

Package size: @astryxdesign/core 7.68 MB packed (+203 B); no new dependencies.

API changes: core +2 · ~0 · −0

2 API changes (advisory)
Package Where Signature Usage
+ core Theme targets · target mobile-nav-close (MobileNav) target mobile-nav-close (MobileNav) defineTheme({components: {'mobile-nav-close': {…}}})
+ core Theme targets · target mobile-nav-toggle (MobileNav) target mobile-nav-toggle (MobileNav) defineTheme({components: {'mobile-nav-toggle': {…}}})

Wide change (shared styles: packages/themes/probe/src/probeTheme.ts): add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the MobileNav record changes are owner-approved for this head and both new targets behave as the description says, but the pull request does not name the component its new public API belongs to.

  • Miss: the new mobile-nav-close and mobile-nav-toggle theme targets sit outside this pull request's named scope, because the title MobileNav: … has no conventional-commit scope and the body has no ## Scope section; retitle to feat(MobileNav): the Close button and toggle carry their own theme targets, or add a ## Scope section with Components: MobileNav.

CI did not run its jobs on this head because CI was full when the run started, so it needs a re-run or a new push. The earlier non-blocking notes on DEC-3's "until…" clause and the toggle's source comment still apply.

Claims and files checked

Review mode: full; reason: rebase

Claims:

  • The Close button carries its own target beside Button's: verified (MobileNav.tsx:799; MobileNav.test.tsx:49).
  • The toggle's Button carries its own target and keeps a caller class: verified (MobileNavToggle.tsx:117-119; MobileNavToggle.test.tsx:279).
  • Button rules still reach both buttons: verified (a themed capture keeps Button's ghost background on both).
  • Until a part's entry wins over its host, Button's variant, size and elevation entries win where they set the same property: verified (the built theme's rules; themed capture: background from Button, icon colour and border from the new targets).
  • The default look does not change: verified (unthemed captures are pixel-identical to the base).
  • Only these two elements carry the new classes: verified (MobileNav.test.tsx:60; captures of another ghost Button).
  • The component doc and the record list both targets, and the probe theme is regenerated at 279 targets: verified (MobileNav.doc.mjs:164-165, :245-246; probe check).
  • The change was stacked on the drawer-target change and targets main once that merged: verified (that change is on main; this pull request targets main with its own patch unchanged).
  • 42 component tests, 459 theming-target tests, the probe check, the knowledge check and Prettier pass: verified (run at this head).
  • Writing rubric R1 to R6: verified; R7 (no project status): DEC-3's "until" clause reads as project status, a non-blocking note.
  • Changeset: verified; it makes the claims above and is a valid patch entry.

Files:

  • .changeset/core-mobile-nav-button-targets.md: clear
  • docs/specs/components/MobileNav/MobileNav.spec.md: owner-approved; non-blocking note on DEC-3's wording
  • packages/core/src/MobileNav/MobileNav.doc.mjs: clear
  • packages/core/src/MobileNav/MobileNav.test.tsx: clear
  • packages/core/src/MobileNav/MobileNav.tsx: clear
  • packages/core/src/MobileNav/MobileNavToggle.test.tsx: clear
  • packages/core/src/MobileNav/MobileNavToggle.tsx: non-blocking note on its source comment
  • packages/themes/probe/src/probeTheme.ts: clear (generated and current)
  • Title and description: the scope finding above

Automated review (maintainer link)

@josephfarina josephfarina changed the title MobileNav: Close button and toggle carry their own theme targets feat(MobileNav): the Close button and the toggle carry their own theme targets Nov 18, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 066d3b2

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: the MobileNav record changes are owner-approved for this head, the title now names MobileNav as the scope of the two new theme targets, and both targets behave as the description says. CI did not run its jobs on this head because CI was full when the run started, so it needs a re-run before merge.

Two earlier non-blocking notes still apply: DEC-3's "until a part's own entry wins…" clause states a future change rather than the present rule, and the toggle's source comment restates the class join below it.

Claims and files checked

Review mode: incremental; reason: none

Claims:

  • Before this change, only Button's target reached the Close button and the toggle: verified (the base renders only astryx-button on both; the current record delegates both to button).
  • The Close button carries its own target beside Button's: verified (MobileNav.tsx:799; MobileNav.test.tsx:49).
  • The toggle's Button carries its own target and keeps a caller class: verified (MobileNavToggle.tsx:117-119; MobileNavToggle.test.tsx:279).
  • Button rules still reach both buttons: verified (both keep astryx-button; a themed capture keeps Button's ghost background on both).
  • Until a part's entry wins over its host, Button's variant, size and elevation entries win where they set the same property: verified (the built theme writes the new targets as one class and Button's prop entries as a class plus an attribute; themed capture: background from Button, text colour and border from the new targets).
  • The default look does not change: verified (unthemed captures of the drawer and the toggle are pixel-identical to the base).
  • Only these two elements carry the new classes: verified (MobileNav.test.tsx:60; another ghost Button in the captures keeps only Button's class).
  • The component doc lists both targets, and the record's contract, builder impact, compatibility, ownership, FR1, FR11, design note, anatomy and DEC-3 name them: verified (MobileNav.doc.mjs:164-165, :245-246; the record at this head).
  • The probe theme is regenerated at 279 targets: verified (probe check current, 279 targets, 904 selectors).
  • 42 component tests, 459 theming-target tests, the probe check, the knowledge check and Prettier pass: verified (run at this head).
  • The scope names MobileNav: verified (the title's feat(MobileNav) scope and the ## Scope section).
  • Writing rubric R1 to R6: verified; R7 (no project status): DEC-3's "until" clause reads as a future change, a non-blocking note.
  • Changeset: verified; it makes the claims above and is a valid patch entry for @astryxdesign/core.

Files:

  • .changeset/core-mobile-nav-button-targets.md: clear
  • docs/specs/components/MobileNav/MobileNav.spec.md: owner-approved; non-blocking note on DEC-3's wording
  • packages/core/src/MobileNav/MobileNav.doc.mjs: clear
  • packages/core/src/MobileNav/MobileNav.test.tsx: clear
  • packages/core/src/MobileNav/MobileNav.tsx: clear
  • packages/core/src/MobileNav/MobileNavToggle.test.tsx: clear
  • packages/core/src/MobileNav/MobileNavToggle.tsx: non-blocking note on its source comment
  • packages/themes/probe/src/probeTheme.ts: clear (generated and current)
  • Title and description: clear; the earlier scope finding is fixed

Automated review (maintainer link)

@josephfarina
josephfarina force-pushed the core-mobile-nav-button-targets branch from 066d3b2 to 4258598 Compare November 19, 2026 01:15
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 4258598

@rubyycheung rubyycheung left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Design approved. Separate styling for the menu toggle and Close button lets a theme adjust those controls without changing other buttons. The default appearance stays unchanged.

This branch was successfully deployed

1 active deployment
Preview — cd3137b2 Deployed Nov 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants