Skip to content

fix(tui): include surrounding context in edit approval preview - #1410

Merged
liruifengv merged 2 commits into
mainfrom
update-edit-approve
Jul 6, 2026
Merged

fix(tui): include surrounding context in edit approval preview#1410
liruifengv merged 2 commits into
mainfrom
update-edit-approve

Conversation

@liruifengv

@liruifengv liruifengv commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Related Issue

No linked issue — this is a focused bug fix reported during TUI usage.

Problem

When approving an Edit tool call, the summary panel shows the diff with surrounding context lines, but pressing ctrl+e to expand the preview opened a viewer that only displayed added/removed lines. The expanded view therefore contained less information than the collapsed summary.

What changed

  • ApprovalPreviewViewer now renders the expanded diff with renderDiffLinesClustered (contextLines: 3, no maxLines cap) instead of renderDiffLines, so the full preview includes surrounding context.
  • Added oldStart/newStart options to renderDiffLinesClustered so Edit hunks keep correct line numbers in the expanded view.
  • Added tests covering both the line-number offset and the presence of context lines in the preview viewer.

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 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d5bc4f4

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 6, 2026

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

commit: d5bc4f4

@liruifengv
liruifengv merged commit 1c817df into main Jul 6, 2026
10 checks passed
@liruifengv
liruifengv deleted the update-edit-approve branch July 6, 2026 05:50
This was referenced Jul 6, 2026
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