Skip to content

fix(MobileNav): the painted drawer panel carries its own theme target - #12382

Merged
josephfarina merged 4 commits into
mainfrom
core-mobile-nav-drawer-target
Nov 18, 2026
Merged

josephfarina merged 4 commits into
mainfrom
core-mobile-nav-drawer-target

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

MobileNav's drawer panel, the surface people see, had no theme target. The only target was the full-screen dialog overlay behind it, so a theme that set a background on mobile-nav painted the overlay while the panel stayed on the default surface; a theme that colored the top bar's text saw that text land on the panel's default surface.

The panel now carries mobile-nav-drawer with the resolved side. The default look does not change.

  • MobileNav.tsx: themeProps('mobile-nav-drawer', {side}) on the panel.
  • MobileNav.doc.mjs: the target, in both languages.
  • MobileNav spec: FR1, the ownership and compatibility lines, the anatomy note and the theming anatomy record the Drawer's target (it was recorded as a reachability gap); DEC-2 records the decision and replaces OQ1.
  • Probe theme regenerated (277 targets); the RTL audit's MobileNav entry points at the panel.
  • Test: the panel carries the target and the side; the overlay keeps its own.

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

Writing rubric results

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

  • R1 narration: DEC-2 opened with what the panel used to do; rewritten as present-tense statements about the system.
  • R2 research: none in the record.
  • R3 evidence: verification and basis cells name tests and source, no pull request or commit.
  • R4 rejected alternatives: one, inside DEC-2, one line.
  • R5 change references: none (no # numbers, /pull/ or /issues/).
  • R6 open questions: OQ1 was answered by DEC-2 and is removed; none remain.
  • R7 project status: "with no focused test yet" restated without the status word.

MobileNav's drawer panel, the surface people see, had no theme target:
the only target was the full-screen dialog overlay behind it, so a theme
that set a background on mobile-nav painted the overlay, and the panel
stayed on the default surface. The panel now carries mobile-nav-drawer
with the resolved side. The default look does not change.

- MobileNav.tsx: themeProps('mobile-nav-drawer', {side}) on the panel.
- MobileNav.doc.mjs: the target, in both languages.
- MobileNav spec: FR1, the ownership lines, the anatomy note and the
  theming anatomy record the Drawer's target.
- Test: the panel carries the target and the side; the overlay keeps its own.
@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 17, 2026 8:36pm 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 17, 2026, 8:47 PM UTC

@josephfarina
josephfarina marked this pull request as ready for review November 17, 2026 18:25
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · c9dad3b

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
AppShell 98.8 kB (+8 B) · 14.4 kB CSS (0) — — · — · —
TopNav 79.3 kB (+8 B) · 11.8 kB CSS (0) — — · — · —
SideNav 122.5 kB (+6 B) · 12.2 kB CSS (0) — — · — · —
2 more components
Component Size LoC Visual · A11y · RTL
MobileNav 77.5 kB (+5 B) · 11.4 kB CSS (0) — — · — · —
MobileNavToggle 66.6 kB (0) · 10.8 kB CSS (0) — — · — · —

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

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

2 API changes (advisory)
Package Where Signature Usage
+ core Theme targets · target mobile-nav-drawer (MobileNav) target mobile-nav-drawer (MobileNav) props [side] defineTheme({components: {'mobile-nav-drawer': {…}}})
~ core Public attributes · attr data-side attr data-side (theme reflection on 3 targets) → attr data-side (theme reflection on 4 targets) [data-side] { … }

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

@josephfarina

Copy link
Copy Markdown
Contributor Author

Owner decision (engineering owner, covering this pull request): MobileNav's drawer panel gets its own theme target, mobile-nav-drawer, on the panel element MobileNav owns. It is additive: the default look is unchanged, and the MobileNav record names the target. The panel carries no other component's target, so it needs no sitsOn declaration.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec da4086c

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 890bb4b

@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 new mobile-nav-drawer target works: once the probe theme is regenerated, a theme's background and text colour reach the open panel, the overlay keeps its own, and the default look is unchanged. Five small fixes remain before this can land:

  • Run pnpm visual:probe-theme and commit the updated packages/themes/probe/src/probeTheme.ts, because without a mobile-nav-drawer entry the Lint job's probe-theme check and .github/scripts/ci-probe-theme-check.test.mjs fail and the visual gate cannot verify the new target.
  • Update the MobileNav record's compatibility lines (MobileNav.spec.md:58 and :74-75), which still say there is no public change and that the DOM, targets and public API are unchanged.
  • Remove OQ1 (MobileNav.spec.md:322-324), which still asks whether the Drawer should gain a target and says the current target reaches only the overlay, and record the decision in the decision log if it needs one.
  • Retag the changeset [feat], since spec:AST-017 FR7 tags a new compatible capability such as an optional theme target [feat], not [fix].
  • Add a ## Writing rubric results section (R1–R7) to the description, which architecture:knowledge-contracts requires for a pull request that changes a record.

Two optional cleanups: cite the new test on the record's FR1 verification row, and point the RTL audit's MobileNav entry at .astryx-mobile-nav-drawer directly.

Claims and files checked

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

  • Claim, the panel had no theme target before: verified; on the base only the overlay calls the theme helper.
  • Claim, a background on the overlay target painted the overlay, not the panel: verified; under the probe theme on the base the overlay is magenta and the panel white.
  • Claim, themed top-bar text landed on the panel's default white: not verified; no theme or story is named.
  • Claim, the panel now carries the new target with the resolved side: verified by the new unit test and by a browser query on the head.
  • Claim, the default look does not change: verified; default-theme captures of the open drawer are pixel-identical on base and head.
  • Claim, a theme can give the panel a surface and text colours without painting the overlay: verified with the probe theme regenerated.
  • Claim, the change is a fix: false; a new optional target is a feature under the release-tag rules.
  • Claim, source, both doc languages, the record and a test were updated: verified, apart from the record's compatibility lines and open question.
  • Claim, the two named test files pass with 482 tests: verified; the knowledge check passes in CI; formatting was not rerun.
  • File .changeset/core-mobile-nav-drawer-target.md: finding (release tag).
  • File docs/specs/components/MobileNav/MobileNav.spec.md: findings (compatibility lines, open question, missing rubric results).
  • File packages/core/src/MobileNav/MobileNav.doc.mjs: finding (the probe theme must be regenerated with this target).
  • File packages/core/src/MobileNav/MobileNav.test.tsx: clear.
  • File packages/core/src/MobileNav/MobileNav.tsx: clear.

Automated review (maintainer link)

…2 in place of OQ1, [feat] changeset, verification and RTL audit point at the panel
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 0d6dc3a

@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 mobile-nav-drawer target is ready: every fix from the last review is in, the panel takes a theme's colours while the overlay keeps its own, and the default look is unchanged. One item remains:

  • The ## Writing rubric results section grades the description against items that are not the record rubric in docs/contributing/spec-writing.md, so rerun its R1–R7 over MobileNav.spec.md and report one line per item (R1 will catch DEC-2's past-tense opening at MobileNav.spec.md:327-331).

Optional: DEC-2 cites spec:AST-017 FR7 for additivity, where FR5 is the clause that makes a new optional capability nonbreaking.

Claims and files checked

Review mode: full; reason: spec-record

  • Claim, the panel had no theme target before: verified; on the base only the overlay calls the theme helper.
  • Claim, a background on the overlay target painted the overlay while the panel kept the default surface: verified; under the probe theme on the base the overlay is magenta and the panel white.
  • Claim, a theme's top-bar text colour landed on the panel's default surface: verified in code; TopNav's drawer passes its heading into the panel, and the heading's target has no mode state.
  • Claim, the panel now carries the new target with the resolved side: verified by the new unit test and a browser query.
  • Claim, the default look does not change: verified; default-theme captures of the open drawer are pixel-identical.
  • Claim (changeset), a theme can colour the panel without painting the overlay: verified under the probe theme.
  • Claim, source, both doc languages, the record, DEC-2 in place of the open question, the probe theme (277 targets), the RTL audit entry and a test were updated: verified.
  • Claim, the two named test files pass with 482 tests, and the probe-theme, knowledge and formatting checks pass: verified.
  • Claim, the writing rubric results: false as record rubric results; they grade the description against a different list.
  • File .changeset/core-mobile-nav-drawer-target.md: clear.
  • File apps/storybook/rtl-audit/targets.json: clear.
  • File docs/specs/components/MobileNav/MobileNav.spec.md: finding (DEC-2 narration the rubric surfaces; FR7 citation note).
  • File packages/core/src/MobileNav/MobileNav.doc.mjs: clear.
  • File packages/core/src/MobileNav/MobileNav.test.tsx: clear.
  • File packages/core/src/MobileNav/MobileNav.tsx: clear.
  • File packages/themes/probe/src/probeTheme.ts: clear.

Automated review (maintainer link)

…s the nonbreaking clause; no status word in the verification list
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec c9dad3b

@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's admission refused this head's run because CI was full, so its build and test jobs need a re-run; Lint and the CLI smoke test passed. The mobile-nav-drawer target paints the open panel while mobile-nav keeps the overlay, the default look is pixel-identical, and the rubric results now match MobileNav.spec.md. Every point from the earlier reviews is addressed.

Claims and files checked

Review mode: full; reason: spec-record

  • Claim, the panel had no theme target and a background on the overlay target left the panel on the default surface: verified; on the base only the dialog calls the theme helper, and under the probe theme the overlay paints magenta while the panel stays white.
  • Claim, a theme's top-bar text colour landed on the panel's default surface: verified in code; TopNav's drawer mode renders its heading in the panel header, and the heading's target reflects no mode.
  • Claim, the panel now carries the new target with the resolved side: verified by the new unit test and a browser query of the open drawer (one element, side end).
  • Claim, the default look does not change: verified; default-theme captures of the open drawer are pixel-identical in light and dark.
  • Claim (changeset), a patch [feat] that lets a theme colour the panel's surface and text without painting the overlay: verified under the probe theme; the changeset check passes.
  • Claim, source, both doc languages, the record (FR1, ownership, compatibility, anatomy, a decision in place of the open question), the probe theme (277 targets), the RTL audit entry and a test were updated: verified.
  • Claim, the two named test files pass with 482 tests, and the probe-theme, knowledge and formatting checks pass: verified.
  • Claim, rubric R1: the new decision is rewritten in the present tense: verified.
  • Claim, rubric R2, R3 and R5: no research, evidence cells name facts, and no pull request or issue numbers remain: verified.
  • Claim, rubric R4: no rejected alternative runs past one line or sits outside its decision: verified; the record has two such lines (one per decision), not one.
  • Claim, rubric R6: the open question is answered by the new decision and removed: verified.
  • Claim, rubric R7: the status word is gone from the verification list: verified.
  • File .changeset/core-mobile-nav-drawer-target.md: clear.
  • File apps/storybook/rtl-audit/targets.json: clear.
  • File docs/specs/components/MobileNav/MobileNav.spec.md: clear.
  • File packages/core/src/MobileNav/MobileNav.doc.mjs: clear.
  • File packages/core/src/MobileNav/MobileNav.test.tsx: clear.
  • File packages/core/src/MobileNav/MobileNav.tsx: clear.
  • File packages/themes/probe/src/probeTheme.ts: clear.

Automated review (maintainer link)

@josephfarina
josephfarina merged commit 782b392 into main Nov 18, 2026
143 of 149 checks passed
@github-actions
github-actions Bot deleted the core-mobile-nav-drawer-target branch November 18, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — c9dad3bf Deployed Nov 17, 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. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant