Skip to content

fix(vscode): run editor actions when the sidebar shows History - #14491

Merged
marius-kilocode merged 2 commits into
Kilo-Org:mainfrom
hdcodedev:fix/editor-actions-from-history
Sep 25, 2026
Merged

marius-kilocode merged 2 commits into
Kilo-Org:mainfrom
hdcodedev:fix/editor-actions-from-history

Conversation

@hdcodedev

Copy link
Copy Markdown
Contributor

Issue

No issue found.

Context

Explain Code, Fix Code, Improve Code and Add to Context did nothing while the sidebar showed History. The action was lost without any message, and the user had to switch to the chat and run it again.

With this change, the sidebar switches to the chat and the action runs there, in the session that was open before History.

Implementation

These actions are handled by the chat's prompt box, which exists only while the chat is showing. When one of them arrives on another sidebar view, the sidebar now switches to the chat and sends the action again once the prompt box is ready. The sidebar already switches to the chat the same way when a session is opened or the chat search command runs.

Screenshots / Video

Before

before.mp4

After

after.mp4

How to Test

Manual/local verification

  • Reproduced the bug on main by following the steps below.
  • bun test tests/unit/chat-input-route.test.ts passes, covering History, the chat view, and unrelated messages (agent).
  • bun run typecheck in packages/kilo-vscode passes (agent).

Reviewer test steps

  1. In VS Code, choose File → Open Folder… and open any project folder.
  2. Open the Kilo Code sidebar and click the History (clock) button.
  3. Open a source file and select a few lines.
  4. Right-click the selection and choose Kilo Code → Explain Code. The sidebar switches to the chat and the explain prompt is sent.
  5. Open History again, select some lines, and press Cmd+K Cmd+A (Ctrl+K Ctrl+A). The sidebar switches to the chat and the selection appears as a context card in the prompt box.

Checklist

  • Issue linked above, or exception explained
  • Tests/verification described
  • Screenshots/video included for visual changes, or marked N/A
  • Changeset considered for user-facing changes
  • I personally reviewed the diff and can explain the changes, including any AI-assisted work.

@kilo-code-bot

kilo-code-bot Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (4 files)
  • .changeset/editor-actions-from-history.md
  • packages/kilo-vscode/tests/unit/chat-input-route.test.ts
  • packages/kilo-vscode/webview-ui/src/App.tsx
  • packages/kilo-vscode/webview-ui/src/utils/chat-input-route.ts

Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0

Review guidance: REVIEW.md from base branch main

@marius-kilocode marius-kilocode left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @hdcodedev for the fix. Verified in VS Code with the sidebar on History: Add to Context switches to the chat and adds the selection card, and Explain Code switches and sends the prompt. Nice work.

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.

2 participants

Sponsor
SponsoredKunjungi sekarang
Promo