Skip to content

feat(theme): add a toggle-theme keyboard shortcut - #718

Open
Marvelg256 wants to merge 1 commit into
StableRoute-Org:mainfrom
Marvelg256:feature/theme-01-toggle-shortcut
Open

feat(theme): add a toggle-theme keyboard shortcut#718
Marvelg256 wants to merge 1 commit into
StableRoute-Org:mainfrom
Marvelg256:feature/theme-01-toggle-shortcut

Conversation

@Marvelg256

Copy link
Copy Markdown

Add a global keyboard shortcut (Ctrl+Shift+L / Cmd+Shift+L) to toggle between light and dark themes from any page. The shortcut is ignored while focus is inside editable elements (inputs, textareas, selects, contentEditable).

Changes:

  • New ThemeShortcut component with global keydown listener
  • Added ThemeShortcut to AppShellExtras for global mounting
  • Documented shortcut in ShortcutsHelp and KeyboardShortcutsHelp
  • 20 unit tests covering toggling, editable-target exclusion, modifier variations, cleanup, and corrupted storage

Closes #495

Summary

Related Issue

Type Of Change

  • Bug fix
  • Feature
  • Documentation
  • Refactor or maintenance

Testing

  • npm run lint
  • npm test
  • npm run build

Contributor Checklist

  • Branch name follows type/area-slug where possible.
  • Tests were added or updated for new UI or behaviour.
  • Documentation was updated for visible or API-facing changes.
  • Accessibility was considered according to the Accessibility Conformance Statement (keyboard, screen-reader, color contrast, and reduced motion).
  • No unrelated CI workflow changes are included.

Notes For Reviewers


💬 Join the StableRoute Discord for questions, reviews, and faster merges.

Add a global keyboard shortcut (Ctrl+Shift+L / Cmd+Shift+L) to toggle
between light and dark themes from any page. The shortcut is ignored
while focus is inside editable elements (inputs, textareas, selects,
contentEditable).

Changes:
- New ThemeShortcut component with global keydown listener
- Added ThemeShortcut to AppShellExtras for global mounting
- Documented shortcut in ShortcutsHelp and KeyboardShortcutsHelp
- 20 unit tests covering toggling, editable-target exclusion,
  modifier variations, cleanup, and corrupted storage

Closes StableRoute-Org#495
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a global keyboard shortcut to toggle the theme

1 participant