Skip to content

The theme toggle has no keyboard shortcut #130

Closed

Description

@imshashank

Every other command in the palette that has a keyboard equivalent declares a binding. The theme toggle does not, so switching theme means opening the palette and finding it.

The fix

In apps/web/src/lib/navigation.ts, the view:theme entry has no binding property:

{
  id: 'view:theme',
  label: context.dark ? 'Switch to light theme' : 'Switch to dark theme',
  section: 'View',
  icon: context.dark ? Sun : Moon,
  run: context.toggleTheme,
},

Compare it with the entry directly below, view:sidebar, which has binding: '['.

Adding a binding is enough. The shortcut then appears automatically in the ? dialog, because that dialog is generated from the registry rather than from a separate list.

Picking the key

It has to not collide with anything already registered. The existing single-key global bindings are ? and [, and ] is registered in apps/web/src/components/layout/app-shell.tsx. Surface bindings such as j, k, c, s, p, a, l, i, x, f, t, u, h are taken on their own surfaces.

shift+d is probably free and reads as "dark". Suggest what you like on this thread before writing the code if you would rather check first.

Also

  • Add a row to the View table in docs/keyboard-shortcuts.md, which currently says the theme toggle has no key of its own
  • A test in apps/web/tests/ asserting the binding is registered

Read CONTRIBUTING.md first. The short version: bun run verify must be green, and there are no comments in code.

Activity

  1. added
    enhancement
    good first issue
    help wanted
    area: web
    on Aug 7, 2026
  2. Masad791 commented on Aug 7, 2026

    @Masad791

    Hi, I'd like to work on this — can I get it assigned to me? I'll go with shift+d as suggested.

  3. added this to the Reach and access milestone on Aug 8, 2026
  4. added
    ready
    size: small
    points: 1
    on Aug 8, 2026
  5. added a commit that references this issue on Aug 18, 2026
    4ef6d85
  6. added a commit that references this issue on Aug 19, 2026
    6c6f3d9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: webenhancementgood first issuehelp wantedp3 lowpoints: 1readysize: small

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions