Skip to content

feat: Add paste with preview dialog#120

Open
MichaelRyom wants to merge 2 commits intosipeed:mainfrom
MichaelRyom:upstream/feat-paste-dialog
Open

feat: Add paste with preview dialog#120
MichaelRyom wants to merge 2 commits intosipeed:mainfrom
MichaelRyom:upstream/feat-paste-dialog

Conversation

@MichaelRyom
Copy link
Copy Markdown

Adds a modal dialog that shows clipboard content before sending it to the
remote machine, with a progress indicator and cancel button.

  • New PasteWithDialog component renders a modal previewing clipboard text
    before typing it, with real-time progress and ability to cancel mid-paste
  • Global Ctrl+Shift+Insert keyboard shortcut triggers the dialog from anywhere
  • Keyboard capture is paused while the dialog is open to avoid interference

Files:

  • browser/src/components/paste-dialog.tsx (new)
  • browser/src/components/menu/keyboard/paste-dialog.tsx (new)
  • browser/src/App.tsx (modified)
  • browser/src/components/keyboard/index.tsx (modified)
  • browser/src/components/menu/keyboard/index.tsx (modified)

Depends on # (keyboard layouts).
https://github.com/MichaelRyom/NanoKVM-USB/tree/upstream/feat-keyboard-layouts

Replace ASCII-only CharCodes paste with layout-aware system supporting
76 keyboard layouts (US, UK, German, French, Nordic, Cyrillic, Arabic,
Greek, Hebrew, Georgian, Armenian, Thai, Vietnamese, and more).

Changes:
- Add layouts.generated.ts with 76 XKB-derived layout maps
- Add layouts.ts with browser Keyboard API auto-detection and
  event-based learning of character mappings
- Replace CharCodes-based paste with layout-aware pasteText()
  using modifier-first key sequence for Windows compatibility
- Add targetKeyboardLayout and pasteSpeed storage/atoms for
  future settings UI
- Add learnFromKeyEvent() to keyboard handler to improve
  auto-detection accuracy over time
Add a modal dialog that shows clipboard text before pasting, with
progress bar and cancel support during paste. Accessible via:
- Keyboard submenu: 'Paste with Preview' entry
- Global shortcut: Ctrl+Shift+Insert

The dialog uses the layout-aware paste system from the keyboard
layouts PR, with configurable paste speed and proper modifier-first
key sequencing.

Keyboard capture is paused while the dialog is open so users can
interact with the modal naturally, then cleanly resumes when closed.

Depends on: feat-keyboard-layouts branch
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