Skip to content

fix(tui): dismiss /btw panel before cancelling compaction on Esc and Ctrl+C#1811

Merged
liruifengv merged 1 commit into
mainfrom
fix/btw-esc-compaction-priority
Jul 17, 2026
Merged

fix(tui): dismiss /btw panel before cancelling compaction on Esc and Ctrl+C#1811
liruifengv merged 1 commit into
mainfrom
fix/btw-esc-compaction-priority

Conversation

@liruifengv

Copy link
Copy Markdown
Collaborator

Related Issue

No linked issue — the problem is explained below.

Problem

While a compaction is running, opening a /btw side question and pressing Esc (or Ctrl+C) cancels the in-progress compaction instead of dismissing the /btw panel. The editor keyboard handler checked the compacting state before the open /btw panel, so the panel stayed mounted and the compaction was aborted — the user had to press Esc again to actually close the panel.

What changed

Reordered the Esc and Ctrl+C handling so an open /btw panel is handled first: Esc dismisses the panel, and Ctrl+C cancels a running /btw question (then closes the panel) — all without touching the compaction. Compaction is only cancelled once no /btw panel is open, which matches the "dismiss the topmost UI layer first" expectation. This fits Kimi Code because it only reorders existing handler branches in the TUI keyboard controller; no SDK or core behavior changes. Added controller tests covering both keys with the panel open, gone, and absent.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 190edc0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jul 17, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@190edc0
npx https://pkg.pr.new/@moonshot-ai/kimi-code@190edc0

commit: 190edc0

@liruifengv
liruifengv merged commit cec15e2 into main Jul 17, 2026
18 checks passed
@liruifengv
liruifengv deleted the fix/btw-esc-compaction-priority branch July 17, 2026 05:29
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