Skip to content

feat(terminal): configurable shortcut buttons#6

Open
dguerizec wants to merge 4 commits intotwidi:mainfrom
dguerizec:feature/terminal-shortcuts
Open

feat(terminal): configurable shortcut buttons#6
dguerizec wants to merge 4 commits intotwidi:mainfrom
dguerizec:feature/terminal-shortcuts

Conversation

@dguerizec
Copy link
Contributor

Summary

  • Configurable terminal shortcut buttons (up to 3 slots) with live key capture dialog
  • Supports Ctrl+A-Z, Alt+key, arrows, Esc, Tab, Enter, Backspace, Delete, Home, End, PgUp, PgDn
  • Config panel accessed by re-clicking the Terminal tab (gear icon hints at this)
  • Each shortcut has a "Show on desktop" toggle (always visible on mobile)
  • Settings synced globally across devices via backend settings.json
  • Default shortcuts: Ctrl+C, Ctrl+Z, and one empty slot

Fixes included

  • Use hidden <input> for key capture to trigger mobile virtual keyboard
  • Fix synced settings ping-pong loop for array/object values (nextTick guard)
  • Fix dialog showing wrong shortcut data (pass data directly to open())
  • Hide shortcut toolbar when config panel is visible

Test plan

  • Configure a shortcut (e.g. arrow keys, Ctrl+C) via the config panel
  • Verify shortcut sends correct escape sequence to terminal
  • Test on mobile: virtual keyboard appears for key capture
  • Test "Show on desktop" toggle: button visible/hidden on desktop
  • Clear a shortcut, verify no blinking/loop
  • Open config dialog for different slots, verify correct data shown
  • Check settings sync: configure on one device, verify on another

🤖 Generated with Claude Code

Add a configurable toolbar of shortcut buttons for the terminal:
- 3 slots stored in localStorage (per-device, not synced)
- Default: Ctrl+C, Ctrl+Z, one empty slot
- Config panel toggled by re-clicking the Terminal tab
- Each slot opens a dialog with live key capture (press any combo)
- Supports Ctrl+A-Z, Alt+key, arrows, Esc, Tab, Enter, etc.
- Per-button "Show on desktop" toggle
- Buttons appear in the terminal toolbar alongside Copy mode toggle
- On mobile: all non-empty buttons visible
- On desktop: only buttons with showOnDesktop enabled
…s globally

- Fix compact header not collapsing when re-clicking Terminal tab on mobile
- Move terminalShortcuts to SYNCED_SETTINGS_KEYS so shortcuts configured
  on desktop are available on mobile (and vice versa)
…slot mismatch

- Use hidden <input> instead of div[tabindex=0] for key capture so mobile
  browsers show the virtual keyboard
- Reset _isApplyingRemoteSettings guard on nextTick to prevent ping-pong
  loop when backend broadcasts array/object synced settings back to sender
- Pass shortcut data directly to dialog open() to avoid stale prop from
  same-tick reactivity delay
- Dialog now closes itself after save/clear instead of relying on parent
  accessing unexposed template ref
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