Summary
Cmd+A (select all) does not highlight/select text in the Preview tab's raw editor textarea. The textarea is a native <textarea> element, and the app's command system in command.tsx has a guard that should bail early for clipboard chords (Cmd+A/Z/C/V/X) when the target is an editable element (isEditableTarget checks target.closest("input, textarea, select")). Despite this, Cmd+A appears to be intercepted.
Context
- App version: 1.18.12
- OS: Darwin 25.5.0 arm64
- Component:
packages/app/src/components/session/session-preview-tab.tsx (RawEditor)
- The raw editor uses a native
<textarea> with el.addEventListener("keydown", ...) and stopPropagation() for Cmd/Ctrl chords — but the command system's handler uses capture: true on document, so it fires first in the capture phase before the element's bubble-phase listener.
Expected vs actual
- Expected: Cmd+A selects all text in the textarea (native browser behavior)
- Actual: Nothing happens — text is not selected
Diagnostics
- The command system handler (
packages/app/src/context/command.tsx:432) is registered with { capture: true } on document
- Its guard at line 413:
if (isEditableTarget(event.target) && isClipboardChord && !isPalette) return — should bail for Cmd+A in a textarea
isEditableTarget (line 256) checks target.closest("input, textarea, select") — should match
isClipboardChord includes "a" in its key list
- A native
el.addEventListener("keydown", ...) was added to the textarea with stopPropagation() but this fires in bubble phase — after the capture-phase command handler
selection:bg-blue-500/30 was added to verify selection isn't just invisible — it genuinely isn't selecting
intake: not-ready — mature per the maturity contract before picking up
suggested_path: A
diagnostics: inline
Summary
Cmd+A (select all) does not highlight/select text in the Preview tab's raw editor textarea. The textarea is a native
<textarea>element, and the app's command system incommand.tsxhas a guard that should bail early for clipboard chords (Cmd+A/Z/C/V/X) when the target is an editable element (isEditableTargetcheckstarget.closest("input, textarea, select")). Despite this, Cmd+A appears to be intercepted.Context
packages/app/src/components/session/session-preview-tab.tsx(RawEditor)<textarea>withel.addEventListener("keydown", ...)andstopPropagation()for Cmd/Ctrl chords — but the command system's handler usescapture: trueondocument, so it fires first in the capture phase before the element's bubble-phase listener.Expected vs actual
Diagnostics
packages/app/src/context/command.tsx:432) is registered with{ capture: true }ondocumentif (isEditableTarget(event.target) && isClipboardChord && !isPalette) return— should bail for Cmd+A in a textareaisEditableTarget(line 256) checkstarget.closest("input, textarea, select")— should matchisClipboardChordincludes"a"in its key listel.addEventListener("keydown", ...)was added to the textarea withstopPropagation()but this fires in bubble phase — after the capture-phase command handlerselection:bg-blue-500/30was added to verify selection isn't just invisible — it genuinely isn't selectingintake: not-ready — mature per the maturity contract before picking up
suggested_path: A
diagnostics: inline