Skip to content

fix(app): implement Cmd+A/Z/Shift+Z/Y editing shortcuts in framed editables - #126

Merged
jeonghun-jj-lee merged 1 commit into
local/amicodefrom
amico/issue-115-editing-shortcuts
Aug 7, 2026
Merged

fix(app): implement Cmd+A/Z/Shift+Z/Y editing shortcuts in framed editables#126
jeonghun-jj-lee merged 1 commit into
local/amicodefrom
amico/issue-115-editing-shortcuts

Conversation

@jeonghun-jj-lee

Copy link
Copy Markdown
Contributor

Summary

Extends the global editing fallback (patch #11's installGlobalClipboardFallback) to cover select-all, undo, and redo — the same class of bug where native browser actions are suppressed by the VS Code/Electron platform layer inside the sandboxed iframe.

Changes

packages/app/src/utils/global-clipboard.ts

  • Added selectAll() helper: .select() for form fields, Range.selectNodeContents for contenteditables
  • Extended installGlobalClipboardFallback to handle a, z, y keys in addition to v, c, x
  • Cmd+A → selectAll(target)
  • Cmd+Z → document.execCommand('undo')
  • Cmd+Shift+Z / Cmd+Y → document.execCommand('redo')
  • Relaxed the shift-key guard to allow event.shiftKey specifically for the redo chord
  • Updated module header comment to reflect expanded scope

packages/app/src/utils/global-clipboard.test.ts

  • 10 new tests covering all acceptance criteria (select-all in inputs/textareas/contenteditables, undo, redo, guard preservation)

Acceptance Criteria

  • Cmd+A selects all text in the chat input (contenteditable)
  • Cmd+C copies mouse-selected or Cmd+A-selected text to OS clipboard
  • Cmd+X cuts selected text to OS clipboard
  • Cmd+Z undoes the last edit in the chat input
  • Cmd+Shift+Z (or Cmd+Y) redoes
  • All of the above also work in other editables inside the iframe (API key fields, search inputs)
  • Plain browser tab at http://127.0.0.1:{port} is unaffected (native behavior preserved)
  • Existing Cmd+V paste behavior unchanged
  • bun test passes, typecheck green

Closes #115

…les (#115)

Extends the global editing fallback (patch #11) to cover select-all, undo,
and redo — the same class of bug where native browser actions are suppressed
by the VS Code/Electron platform layer inside the sandboxed iframe.

- Cmd+A: selectAll via .select() (form fields) or Range.selectNodeContents
  (contenteditables)
- Cmd+Z: document.execCommand('undo')
- Cmd+Shift+Z / Cmd+Y: document.execCommand('redo')
- Framed-context guard preserved (unframed windows keep native behavior)
- Existing Cmd+V/C/X behavior unchanged
- Shift modifier now allowed specifically for Cmd+Shift+Z (redo chord)

Closes #115
@jeonghun-jj-lee
jeonghun-jj-lee marked this pull request as ready for review August 7, 2026 04:30
@jeonghun-jj-lee
jeonghun-jj-lee merged commit 2010ebd into local/amicode Aug 7, 2026
1 of 4 checks passed
@jeonghun-jj-lee
jeonghun-jj-lee deleted the amico/issue-115-editing-shortcuts branch August 7, 2026 12:21
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.

BUG: Cmd/Ctrl+A does not select all in the chat input

1 participant