Skip to content

feat(TopNav): TopNavHeading carries mode=drawer as the phone menu's title - #12590

Closed
josephfarina wants to merge 2 commits into
mainfrom
core-top-nav-heading-drawer-mode
Closed

josephfarina wants to merge 2 commits into
mainfrom
core-top-nav-heading-drawer-mode

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Record: TopNavHeading FR12 (new): the heading carries data-mode="drawer" as the phone menu's title, so a theme keys it with mode:drawer; additive, default unchanged.

Summary

At phone width AppShell draws TopNav inside the phone menu: the links already carry data-mode="drawer" there (TopNavItem FR5), so a theme keys the menu's links with mode:drawer. The heading, drawn as the menu's title, carried no state, so a heading colored for a dark top bar turned near-white on the menu's white surface with no way to key the menu's title.

TopNavHeading now carries data-mode="drawer" when TopNav renders in its drawer mode, and no mode in the bar. It is additive: nothing styles the attribute by default, so every theme renders as before.

Scope

  • Components: TopNav (TopNavHeading; the top-nav-heading theming target gains the mode state).

Changes

  • TopNavHeading.tsx: reads the TopNav render mode and passes mode: 'drawer' to themeProps('top-nav-heading', …) in the drawer.
  • TopNav.doc.mjs: astryx-top-nav-heading declares states: ['mode'].
  • Probe theme regenerated (pnpm visual:probe-theme): one more selector.
  • Spec: TopNavHeading FR12 and its verification row; ownership line names it.
  • Test: the heading carries data-mode="drawer" in the drawer render context and no data-mode in the bar.
  • Changeset.

Test plan

  • vitest --project ui packages/core/src/TopNav/TopNav.test.tsx packages/core/src/AppShell: 178 passed.
  • tsc --noEmit -p packages/core/tsconfig.json: clean.
  • pnpm visual:probe-theme:check: clean after regeneration.
  • node scripts/check-knowledge.mjs: aligned.
  • 390px pictures with the phone menu open: below.

390px pictures (phone menu open)

A theme with a dark top bar sets the heading's text to white and keys the menu's title with 'mode:drawer': {'--color-text-primary': '#111111'}.

Before (main) After (this PR)
before: the menu's title is white on the white menu after: the menu's title takes the mode:drawer color and reads

Before, the title is white on the white menu (invisible); after, it reads. With no theme keying mode:drawer the two render the same (the attribute alone changes nothing).

Writing rubric results

Record rubric over the FR12 row added to the TopNavHeading spec:

  • R1 narration: present tense, states what the component does.
  • R2 research: none.
  • R3 evidence: no pull request or commit cited.
  • R4 rejected alternatives: none recorded.
  • R5 change references: none.
  • R6 open questions: none.
  • R7 project status: none.

preflight: pass 810171f

@vercel

vercel Bot commented Nov 18, 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 6:22am UTC

Request Review

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

astracat-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

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

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 18, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 18, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

Owner decision (engineering owner, covering this pull request): when TopNavHeading is the title of the phone menu, it carries the existing drawer mode as data-mode="drawer", so a theme can style that title. The change is additive, and the default output is byte-identical. The TopNav record's FR12 states this, with its verification row, a test and a changeset.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 42665b3

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

@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 finished on this head yet.

TopNavHeading now carries the drawer mode where TopNav draws it as the phone menu's title, so a theme can key it with mode:drawer; the change is additive and the published themes build exactly as before. There are no blocking findings.

Optional:

  • The comment at TopNavHeading.tsx:379-380 reads more easily as two sentences: "TopNav draws the heading as the phone menu's title. A theme keys that placement with mode:drawer."
  • In TopNavHeading.spec.md, the FR12 verification row could follow FR11's row, and the at-a-glance public-contract row could name the new mode state.
Claims and files checked

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

  • Claim: in the phone menu the links already carry the drawer mode. Verified: TopNavItem reflects mode: 'drawer' in the drawer.
  • Claim: the heading drawn as the menu's title carried no state. Verified: on the base the menu's heading renders without data-mode.
  • Claim: TopNavHeading carries data-mode="drawer" in the drawer and no mode in the bar. Verified: TopNavHeading.tsx:381-383, the new test, and a check through AppShell at phone width that fails on the base and passes here.
  • Claim: the change is additive and every theme renders as before. Verified: no Core style reads the attribute, and the seven published themes' built CSS is byte-identical.
  • Claim: the top-nav-heading target declares the mode state. Verified: TopNav.doc.mjs:25.
  • Claim: the probe theme was regenerated with 903 selectors. Verified: the probe-theme check passes.
  • Claim: the record gains FR12, its verification row and the ownership line. Verified: TopNavHeading.spec.md:107, :142, :206.
  • Claim: the TopNav and AppShell tests pass (178). Verified.
  • Claim: the core type check is clean. Verified: the typecheck job passed on this head.
  • Claim: the knowledge check is aligned. Verified.
  • Changeset: the heading carries the drawer mode as TopNavItem does, a theme keys the menu's title with mode:drawer, the bar carries no mode, and nothing else changes. Verified: the theme build accepts the mode key here and warns about it on the base.
  • File .changeset/core-top-nav-heading-drawer-mode.md: clear.
  • File docs/specs/components/TopNav/TopNavHeading.spec.md: clear (optional tidy-up above).
  • File packages/core/src/TopNav/TopNav.doc.mjs: clear.
  • File packages/core/src/TopNav/TopNav.test.tsx: clear.
  • File packages/core/src/TopNav/TopNavHeading.tsx: clear (optional comment rewrite above).
  • File packages/themes/probe/src/probeTheme.ts: clear (regenerates identically).

Automated review (maintainer link)

Comment on lines +379 to +380
// In the phone menu TopNav draws the heading as the menu's title: a theme
// keys that placement with `mode:drawer`, as it keys the menu's links.

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.

Optional (non-blocking): this sentence carries two topics. Two short sentences read more easily:

// TopNav draws the heading as the phone menu's title. A theme keys that
// placement with `mode:drawer`.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 810171f

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
TopNavHeading 83.5 kB (+76 B) · 12.0 kB CSS (0) — — · — · —
TopNav 79.4 kB (0) · 11.8 kB CSS (0) — — · — · —
TopNavItem 14.6 kB (0) · 4.0 kB CSS (0) — — · — · —
4 more components
Component Size LoC Visual · A11y · RTL
TopNavMegaMenu 77.6 kB (0) · 12.7 kB CSS (0) — — · — · —
TopNavMegaMenuFeaturedCard 8.4 kB (0) · 3.6 kB CSS (0) — — · — · —
TopNavMegaMenuItem 15.3 kB (0) · 4.2 kB CSS (0) — — · — · —
TopNavMenu 83.0 kB (0) · 12.0 kB CSS (0) — — · — · —

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

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

2 API changes (advisory)
Package Where Signature Usage
~ core Theme targets · target top-nav-heading (TopNav) target top-nav-heading (TopNav) → target top-nav-heading (TopNav) states [mode] defineTheme({components: {'top-nav-heading': {…}}})
~ core Public attributes · attr data-mode attr data-mode (theme reflection on 8 targets) → attr data-mode (theme reflection on 9 targets) [data-mode] { … }

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.

Current run: CI concluded cancelled; parts of this report may be missing.


Generated by PR Enrichment workflow | View full report

@josephfarina
josephfarina force-pushed the core-top-nav-heading-drawer-mode branch from 42665b3 to 810171f Compare November 19, 2026 00:04
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 810171f

@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: one line of the description is out of date after the rebase. The code, the record and the tests have no blocking findings.

  • Regression: the description says the regenerated probe theme has "one more selector, 903", but the probe-theme check reports 931 selectors on this head (930 on main), so update that line to "one more selector, 931" or drop the total.

Optional: the comment at TopNavHeading.tsx:379-380 reads more easily as two sentences (see the existing inline suggestion), and in TopNavHeading.spec.md the FR12 verification row could follow FR11's row and the at-a-glance row could name the new mode state.

Claims and files checked

Review mode: full; reason: rebase

  • Claim: the heading carries the drawer mode as the phone menu's title, additively, with the default unchanged. Verified: TopNavHeading.tsx:381-383 and the record's new FR12.
  • Claim: in the phone menu the links already carry the drawer mode. Verified: TopNavItem reflects mode: 'drawer' in the drawer.
  • Claim: the heading drawn as the menu's title carried no state. Verified: on the base the menu's heading renders without data-mode.
  • Claim: nothing styles the attribute by default, so every theme renders as before. Verified: Core's CSS and the seven published themes' built CSS are byte-identical, and the default theme's menu renders pixel-identical.
  • Claim: the top-nav-heading target declares the mode state. Verified: TopNav.doc.mjs:25.
  • Claim: the probe theme was regenerated with one more selector, 903. False: one more selector holds (930 to 931), the total of 903 does not.
  • Claim: the record gains FR12, its verification row and the ownership line. Verified: TopNavHeading.spec.md:107, :142, :206.
  • Claim: the new test checks the drawer and bar renders. Verified: TopNav.test.tsx:254-276 passes.
  • Claim: the TopNav and AppShell tests pass (178). Verified: 178 passed.
  • Claim: the core type check is clean. Verified.
  • Claim: the probe-theme check is clean. Verified.
  • Claim: the knowledge check is aligned. Verified.
  • Changeset: the heading carries the drawer mode as TopNavItem does, a theme keys the menu's title with mode:drawer, the bar carries no mode, and nothing else changes. Verified: a theme build accepts the mode key here and warns about it on the base.
  • File .changeset/core-top-nav-heading-drawer-mode.md: clear.
  • File docs/specs/components/TopNav/TopNavHeading.spec.md: clear (optional tidy-up above).
  • File packages/core/src/TopNav/TopNav.doc.mjs: clear.
  • File packages/core/src/TopNav/TopNav.test.tsx: clear.
  • File packages/core/src/TopNav/TopNavHeading.tsx: clear (optional comment rewrite above).
  • File packages/themes/probe/src/probeTheme.ts: clear (the generator check passes).

Automated review (maintainer link)

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec af83d8e

@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, because its commit message carries [skip ci], so it still needs to run and pass here before merge.

TopNavHeading now carries data-mode="drawer" where TopNav draws it as the phone menu's title, as the TopNavHeading record's new FR12 says, and the earlier description issue is fixed: the probe theme gains exactly one selector. No blocking findings remain. Two optional tidy-ups: the comment at TopNavHeading.tsx:379-380 reads better as two sentences (see the inline suggestion), and in the TopNavHeading record the FR12 verification row could follow FR11's, with the at-a-glance contract row naming the new mode state.

Claims and files checked

Review mode: incremental; reason: none

Claims:

  • Changeset: the heading carries the drawer mode when it is the phone menu's title, as the nav items already do. Verified: TopNavHeading.tsx:381-383, TopNavItem.tsx:303-305, test TopNav.test.tsx:254-276.
  • Changeset: a theme can key the menu's title with mode:drawer. Verified: TopNav.doc.mjs:25 declares the mode state.
  • Changeset: the bar heading carries no mode and nothing else changes. Verified: the test's bar case; the generated API delta lists only the two theming rows; Core's CSS and the published themes' CSS are unchanged.
  • Description: AppShell draws TopNav inside the phone menu, where the links already carry the drawer mode. Verified: AppShell.tsx:1392, TopNav.tsx:302, TopNavItem.tsx:303-305.
  • Description: before this change the menu's title carried no state a theme could key. Verified: the base heading passes no state and its theming target declares none.
  • Description: the change is additive and every theme renders as before. Verified: Core's built CSS and all seven published themes' built CSS are byte-identical to the base.
  • Description: the listed changes (render mode read, theming target state, record row with its verification row and ownership line, test, changeset). Verified in the changed files.
  • Description: the regenerated probe theme gains one selector. Verified: 930 on the base, 931 on the head, and the probe check passes.
  • Description: the TopNav and AppShell tests pass (178). Verified: 178 passed.
  • Description: the core typecheck, the probe-theme check and the knowledge check are clean. Verified: all three pass.
  • Description: with no theme keying mode:drawer, before and after render the same. Verified: identical built CSS for Core and every published theme.
  • Description: writing rubric results for FR12. Verified: the row is present tense and cites no pull request, research or status.

Files:

  • .changeset/core-top-nav-heading-drawer-mode.md: clear
  • docs/specs/components/TopNav/TopNavHeading.spec.md: optional tidy-up (verification row order, at-a-glance row)
  • packages/core/src/TopNav/TopNav.doc.mjs: clear
  • packages/core/src/TopNav/TopNav.test.tsx: clear
  • packages/core/src/TopNav/TopNavHeading.tsx: optional comment rewrite
  • packages/themes/probe/src/probeTheme.ts: clear (regenerated; its check passes)

Automated review (maintainer link)

josephfarina added a commit that referenced this pull request Nov 19, 2026
- #12590 feat(TopNav): TopNavHeading carries mode=drawer as the phone menu's title
  Author: @josephfarina
- #12800 fix(cli): the corners dial gives the chat radius back to the container radius
  Author: @josephfarina
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed in #12866.

@github-actions
github-actions Bot deleted the core-top-nav-heading-drawer-mode branch November 20, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — af83d8e2 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. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant