Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-edit-preview-height.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Fix the Edit tool card jumping in height and flickering while its result streams in.
9 changes: 8 additions & 1 deletion apps/kimi-code/src/tui/components/messages/tool-call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1935,7 +1935,14 @@ export class ToolCallComponent extends Container {
this.buildStreamingPreview(this.toolCall.streamingArguments);
return;
}
const shouldCap = this.result !== undefined && !this.expanded;
// Cap Edit's diff as soon as args finalize, not only when the result
// lands — mirroring Write's writeShouldCap below. Otherwise the render
// tick between finalized args (streamingArguments cleared by the
// `tool.call.started` payload) and the result draws the full diff, then
// snaps back to the cap: a height collapse that triggers pi-tui's full
// redraw and wipes scrollback. Streaming frames (streamingArguments set)
// still take buildStreamingPreview above and never reach here.
const shouldCap = !this.expanded;
if (name === 'Write') {
const content = str(this.toolCall.args['content']);
if (content.length === 0) return;
Expand Down
Loading