Skip to content

feat(www): add R hotkey for reset + fix export highlight flash - #244

Merged
patrick-xin merged 1 commit into
masterfrom
feat/www-sweep
Jun 26, 2026
Merged

feat(www): add R hotkey for reset + fix export highlight flash#244
patrick-xin merged 1 commit into
masterfrom
feat/www-sweep

Conversation

@patrick-xin

Copy link
Copy Markdown
Owner

Summary

  • R hotkey for reset — adds a ResetHotkey component mounted inside Settings (same lifetime as the S binding) that registers R and opens a handle-driven AlertDialog. Extracted ResetDialogContent from ResetButton so the confirm dialog body is shared by both the settings-hosted button and the new hotkey entry point — no drift risk.
  • Command palette wired — added a "Reset to defaults" entry (shortcut R) to the site command menu via alertDialogHandle, using a new AlertDialogTrigger branch in the menu renderer.
  • Export highlight flash fix — warms Shiki's grammar registry on idle before the export dialog opens; matches fallback <pre> padding to Shiki's .shiki box (1.2rem) so the async swap is invisible.
  • Docsshortcuts.mdx documents the R shortcut and rewrites the navigation blurb.

Test plan

  • Press R from anywhere (no modals open) — reset confirm dialog appears
  • Press R while an input is focused — hotkey ignored (ignoreInputs)
  • Open command menu (⌘K), select "Reset to defaults" — same confirm dialog
  • Open Settings popover → use the Reset button — still works (ResetButton path unchanged)
  • Open export dialog — no unstyled flash / padding jump on first open
  • Check shortcuts doc page — R row present in the table

🤖 Generated with Claude Code

- Extract ResetDialogContent from ResetButton so the confirm window can
  be shared between the Settings-hosted button and the new hotkey
- Add ResetHotkey component that registers `R` and mounts an always-on
  handle-driven AlertDialog (hotkey survives NavTabs remounts)
- Mount ResetHotkey inside Settings alongside the existing S binding
- Wire resetDialogHandle into site-command-menu so the command palette
  also opens the reset confirm window
- Warm Shiki's grammar registry on idle before the export dialog opens,
  cutting the unstyled flash on first open
- Match fallback <pre> padding to Shiki's .shiki box (1.2rem) so the
  async highlight swap doesn't cause a visible reflow jump
- Document R shortcut in shortcuts.mdx

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
tonex Ready Ready Preview, Comment Jun 26, 2026 2:43pm

@patrick-xin
patrick-xin merged commit fc71f03 into master Jun 26, 2026
6 checks passed
@patrick-xin
patrick-xin deleted the feat/www-sweep branch June 26, 2026 19:27
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.

1 participant