Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9323 +/- ##
==========================================
- Coverage 87.06% 86.96% -0.11%
==========================================
Files 90 90
Lines 6426 6436 +10
Branches 389 393 +4
==========================================
+ Hits 5595 5597 +2
- Misses 827 835 +8
Partials 4 4 ☔ View full report in Codecov by Harness. |
There was a problem hiding this comment.
🟡 Changes recommended
The menu’s shortcut instructions are not associated with its content, so screen-reader users navigating with arrow keys will not hear them.
1 open issue
What changed in this PR
Adds an optional footer slot to the shared ThemeToggle dropdown, enabling shortcut hints related to nodejs/doc-kit#1167. This PR provides the display slot, not keyboard-shortcut behavior.
Changes:
- Adds a
ReactNodefooter prop with conditional rendering. - Styles the footer with a divider and light/dark theme colors.
- Adds a Storybook example and tests for footer presence and absence.
| File | Description |
|---|---|
packages/ui-components/src/Common/ThemeToggle/index.tsx |
Adds the optional footer slot. |
packages/ui-components/src/Common/ThemeToggle/index.stories.tsx |
Demonstrates shortcut hints in the footer. |
packages/ui-components/src/Common/ThemeToggle/index.module.css |
Adds footer spacing, divider, and colors. |
packages/ui-components/src/Common/ThemeToggle/__tests__/index.test.jsx |
Tests rendering with and without a footer. |
Review effort: Balanced
📦 Build Size ComparisonSummary
|
|
Although the relevant functionality is implemented in the doc-kit repository (nodejs/doc-kit#1250), I think it's also worthwhile to retain the extended configuration in the component library to facilitate customizing other explanatory information. |

Description
Related to nodejs/doc-kit#1167
This adds shortcut-key instructions for theme switching to the dropdown menu.
Validation
Related Issues
Check List
pnpm formatto ensure the code follows the style guide.pnpm testto check if all tests are passing.pnpm buildto check if the website builds without errors.