Skip to content

fix(TopNav): add selected state to TopNavItem xdsClassName - #1997

Merged
cixzhang merged 1 commit into
mainfrom
navi/component-audit/2026-05-03
May 3, 2026
Merged

fix(TopNav): add selected state to TopNavItem xdsClassName#1997
cixzhang merged 1 commit into
mainfrom
navi/component-audit/2026-05-03

Conversation

@cixzhang

@cixzhang cixzhang commented May 3, 2026

Copy link
Copy Markdown
Contributor

Summary

TopNavItem's xdsClassName call didn't include the isSelected state, even though it drives visual styles (background color, font weight). Themes couldn't distinguish selected vs unselected nav items via the xds-top-nav-item-selected class.

Changes

Add selected state to both xdsClassName calls (drawer mode and default mode), following the same pattern used by TreeListItem.

Audit Notes

Found during Night Watch Component Auditor pass over queue components (Timestamp, TopNav).

Timestamp — audited, no issues found. Uses xdsClassName with format variant, proper token usage, extends XDSBaseProps.

TopNav — this fix. All sub-components checked:

  • TopNavHeading: no visual variant props to propagate
  • TopNavMenu: no selected state
  • TopNavMegaMenu: no visual variant props
  • TopNavMegaMenuItem: no selected state

Queue status: All 63 core components have now been audited. Queue will rebuild on next run.

Night Watch — Component Auditor

TopNavItem's xdsClassName call didn't include the isSelected state,
even though it drives visual styles (background color, font weight).
This meant themes couldn't distinguish selected vs unselected nav
items via the xds-top-nav-item-selected class.

Add selected state to both xdsClassName calls (drawer mode and
default mode), following the same pattern used by TreeListItem.
@cixzhang cixzhang added the hardening Component hardening and quality sweep label May 3, 2026
@vercel

vercel Bot commented May 3, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
xds-sandbox Ready Ready Preview, Comment May 3, 2026 10:55am

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label May 3, 2026
@github-actions

github-actions Bot commented May 3, 2026

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

No new or modified components detected.

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@xds/core 17.7KB 27.5KB 4.1KB

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@cixzhang
cixzhang merged commit 8d8bd8a into main May 3, 2026
20 checks passed
@github-actions
github-actions Bot deleted the navi/component-audit/2026-05-03 branch May 4, 2026 07:11
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. hardening Component hardening and quality sweep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant