Repository navigation
feat(MobileNav): the Close button and the toggle carry their own theme targets - #12466
josephfarina wants to merge 5 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
Owner decision (engineering owner, covering this pull request): MobileNav's close button and its menu toggle get their own theme targets, |
|
/approve-spec afa3753 |
There was a problem hiding this comment.
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-closeormobile-nav-toggleentry is one class and loses to Button'svariant,sizeandelevationentries (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.mdstill lists "The Close and Toggle button surfaces — delegated tocomponent:Button" under Does not own and leaves both targets out of Owns, which contradicts its own FR1, anatomy and DEC-3, and no requirement statesmobile-nav-toggle.- The test plan's "41 pass" for
MobileNav.test.tsxandMobileNavToggle.test.tsxis 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.tsxtest). - 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).
|
/approve-spec a98462b |
There was a problem hiding this comment.
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'svariant,sizeorelevationentries 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: cleardocs/specs/components/MobileNav/MobileNav.spec.md: owner-approved; non-blocking note on DEC-3's wordingpackages/core/src/MobileNav/MobileNav.doc.mjs: clearpackages/core/src/MobileNav/MobileNav.test.tsx: clearpackages/core/src/MobileNav/MobileNav.tsx: clearpackages/core/src/MobileNav/MobileNavToggle.test.tsx: clearpackages/core/src/MobileNav/MobileNavToggle.tsx: earlier non-blocking comment note standspackages/themes/probe/src/probeTheme.ts: clear (generated and current)
| 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 |
There was a problem hiding this comment.
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.
a98462b to
8852977
Compare
PR Analysis Report🔎 Preview ·
|
| 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
There was a problem hiding this comment.
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-closeandmobile-nav-toggletheme targets sit outside this pull request's named scope, because the titleMobileNav: …has no conventional-commit scope and the body has no## Scopesection; retitle tofeat(MobileNav): the Close button and toggle carry their own theme targets, or add a## Scopesection withComponents: 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: cleardocs/specs/components/MobileNav/MobileNav.spec.md: owner-approved; non-blocking note on DEC-3's wordingpackages/core/src/MobileNav/MobileNav.doc.mjs: clearpackages/core/src/MobileNav/MobileNav.test.tsx: clearpackages/core/src/MobileNav/MobileNav.tsx: clearpackages/core/src/MobileNav/MobileNavToggle.test.tsx: clearpackages/core/src/MobileNav/MobileNavToggle.tsx: non-blocking note on its source commentpackages/themes/probe/src/probeTheme.ts: clear (generated and current)- Title and description: the scope finding above
|
/approve-spec 066d3b2 |
There was a problem hiding this comment.
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-buttonon both; the current record delegates both tobutton). - 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## Scopesection). - 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: cleardocs/specs/components/MobileNav/MobileNav.spec.md: owner-approved; non-blocking note on DEC-3's wordingpackages/core/src/MobileNav/MobileNav.doc.mjs: clearpackages/core/src/MobileNav/MobileNav.test.tsx: clearpackages/core/src/MobileNav/MobileNav.tsx: clearpackages/core/src/MobileNav/MobileNavToggle.test.tsx: clearpackages/core/src/MobileNav/MobileNavToggle.tsx: non-blocking note on its source commentpackages/themes/probe/src/probeTheme.ts: clear (generated and current)- Title and description: clear; the earlier scope finding is fixed
066d3b2 to
4258598
Compare
|
/approve-spec 4258598 |
rubyycheung
left a comment
There was a problem hiding this comment.
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.
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-closeand the toggle's Button carriesmobile-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'svariant,sizeandelevationentries 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-toggleon the Button, a callerclassNamekept beside it.MobileNav.doc.mjs: both targets.Close buttonandToggle buttonnow name their targets); DEC-3 records the decision.mobile-nav-closeandastryx-button; the toggle carriesmobile-nav-toggle,astryx-buttonand a caller class.Before: the only selector reaching either button was
.astryx-button. After:.astryx-mobile-nav-closeand.astryx-mobile-nav-togglereach 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
mobile-nav-closeon the Close button,mobile-nav-toggleon MobileNavToggle's Button).Writing rubric results
Record rubric (
docs/contributing/spec-writing.md) overMobileNav.spec.md: