feat: add keyboard shortcut for theme toggle#405
Conversation
|
@seffhunnn is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel. A member of the Team first needs to authorize it. |
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
1. D shortcut still active but undocumented — the handler fires on both t and d, but ShortcutsModal only shows T. Either remove d from the handler, or show both keys in the modal.
2. aria-live announcement fires on click-toggle too — the useEffect watches theme and announces on every change, including button clicks. Screen reader users clicking the toggle button hear a redundant second announcement. Scope the announcement to keyboard events only (set a ref flag in the keydown handler, read + clear it in the effect).
|
Hii @Priyanshu-byte-coder i have addressed the review feedback by removing the undocumented |
Summary
Added a global keyboard shortcut for instantly toggling between light and dark themes directly from the dashboard. Also updated the shortcuts modal and added aria-live announcements for improved accessibility.
Closes #230
Type of Change
Changes Made
Tkeyboard shortcut for theme togglingT — Toggle themeentry to the shortcuts modalHow to Test
Steps for the reviewer to verify this works:
npm run devTand verify the theme toggles instantlyTmultiple times and verify the theme switches correctlyT?to open the shortcuts modalT — Toggle themeappears in the shortcuts listnpm run lintnpm run type-checkScreenshots (if UI change)
N/A
Checklist
npm run lintpasses locallynpm run type-check)