Skip to content

fix(vscode): keep prompt undo and redo inside the webview - #13794

Merged
marius-kilocode merged 1 commit into
mainfrom
fix-issue-13724
Sep 7, 2026
Merged

marius-kilocode merged 1 commit into
mainfrom
fix-issue-13724

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Undo and redo in the focused chat input can change the underlying Markdown file when a Markdown custom editor is active instead of changing the draft.

Closes #13724.

Why This Change Was Made

VS Code forwards webview undo/redo shortcuts to the host, where custom-editor command handling can take priority over the focused webview. Stop those keyboard events at the prompt textarea without preventing native text undo/redo. Keep the existing enhanced-prompt undo and speech shortcut handling.

User Impact

Undo/redo stays in the focused prompt with Markdown Preview or Markdown Editor open. This adds no features, settings, or global keybindings. Clipboard shortcuts, Alt-modified combinations, and Shift+Y retain their existing routing. Custom VS Code commands assigned to the intercepted undo/redo combinations no longer receive those events while the prompt has focus.

Evidence

  • Extension build, host/webview type checks, lint, formatting, Knip, and the Kilo change-marker guard passed.
  • 75 nearby prompt/history/mention tests passed. Type checks, lint, and these tests also passed after rebasing onto main.
  • Three Chromium regression tests passed against a fresh Storybook build: native undo/redo despite host forwarding, shortcut boundaries, and enhanced-prompt undo.
  • Real isolated macOS VS Code checks passed with plain text, Markdown Preview, and Markdown Editor active, including unlocked Markdown editing. Prompt undo/redo worked while the document remained unchanged. The isolated instance was cleaned up.
  • Windows-specific verification remains outstanding. Check Ctrl+Z and Ctrl+Y with each Markdown custom editor active; only the focused prompt should change.

@kilo-code-bot

kilo-code-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • .changeset/chat-input-undo.md
  • packages/kilo-vscode/tests/prompt-undo.spec.ts
  • packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx

Reviewed by grok-4.6 · Input: 162.6K · Output: 13.1K · Cached: 400.8K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit 0d85e9a into main Sep 7, 2026
25 checks passed
@marius-kilocode
marius-kilocode deleted the fix-issue-13724 branch September 7, 2026 07:48
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: chat input's Ctrl+Z / Ctrl+Y still leak to Markdown Preview & Markdown Editor custom editors (undo/redo the MD source)

2 participants