Skip to content

Show turn edit diffs inline in native chat - #27758

Merged
brennanb2025 merged 3 commits into
mainfrom
brennanb2025/turn-edit-diff-viewer
Oct 12, 2026
Merged

brennanb2025 merged 3 commits into
mainfrom
brennanb2025/turn-edit-diff-viewer

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​70 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​68
Prod 10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​177 $\color{#cf222e}{\Huge{\mathbf{−}}}$​66 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​111

ELI5

The changed-file summary added in #27631 shows totals and file names, but it does not show the edits there. Clicking a file jumps back to its earlier edit card. The summary also includes the sentence “Totals from recorded edits in this turn,” which adds no useful information. Now each file has a disclosure that shows its recorded patch directly beneath the summary.

What Changed

  • Removed the extra sentence from the expanded changed-file summary.
  • Added a disclosure beside each file. Opening it shows the existing in-chat diff card, including line numbers and added and removed lines. If a file was edited several times in the turn, it shows each recorded patch in order.
  • Kept clicking the file name as a jump to the original edit card. Patch details are parsed only when the inline disclosure opens.

Why

The summary already knows which recorded edits produced its totals. Keeping references to those edits lets it reuse the existing diff card and parser instead of introducing a second viewer or parsing every patch while the transcript renders.

Linked Issue

Maintainer follow-up to #27631; no separate issue.

Visual Proof

Headless browser preview of the actual rollup component with a representative patch:

File list Inline diff opened
Changed-file list Inline diff opened

Testing

  • Clicked the disclosure in a headless browser preview and inspected the rendered patch.
  • Automated tests updated: 93 related chat tests passed; 17 focused tests passed after the final test addition.
  • Standard full typecheck and changed-code quality checks passed.
  • CI-only Bun typecheck on this machine: its installed Bun 1.3.14 lacks bun check; CI uses the repository's newer Bun setup. The other 24 orca-ci-checks gates passed.

Review

Ready for review.

Agent skill upstream boundary

  • Not applicable; no upstream skill source was copied.

Notes

This changes renderer presentation only. It adds no platform-specific paths, shortcuts, remote calls, or persisted fields. Detailed patch work remains lazy until a reader opens a file.

Checklist

  • This PR is small and focused.
  • I explained the user-facing before and after, mechanism, and choice of existing viewer.
  • Inline screenshots attached.
  • Self-reviewed for correctness and performance.
  • Cross-platform, SSH, and path impact considered.
  • Full lint, build, and CI-only Bun typecheck will be covered by CI.

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e85b32ba-38e2-40fd-a9dc-623ec0d71ef3

📥 Commits

Reviewing files that changed from the base of the PR and between 09a036d and 081cfdb.


📒 Files selected for processing (9)
  • src/renderer/src/components/native-chat/native-chat-edit-cards.ts
  • src/renderer/src/components/native-chat/native-chat-turn-diffs.test.ts
  • src/renderer/src/components/native-chat/native-chat-turn-diffs.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json

🚧 Files skipped from review as they are similar to previous changes (6)
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/es.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.



📝 Walkthrough

Walkthrough

Turn diff file records now retain ordered references to their edits and can resolve each edit’s file patch. The turn diff rollup displays file paths and change counts with expandable patches. NativeChatDiffCard accepts an optional initialOpen prop. Tests cover edit ordering, rename merges, and diff disclosure. Locale entries add labels for showing and hiding diffs.


Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 081cf

The inline diff controls have no identified interaction conflict, and no actionable merge-blocking issue remains after normal checks.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 7 files. (6 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly summarizes the primary user-facing change: showing turn edit diffs inline in native chat.
Description check Passed The description is complete and aligned with the template. It explains the user-facing change, rationale, implementation, visual proof, testing, platform considerations, and checklist status. The link…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 7 files. (6 skipped: 6 unsupported.)


  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@brennanb2025

brennanb2025 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor Author

The changed-file summary showed file names and totals, but readers had to jump back to earlier edit cards to see the changes. This PR lets each file expand its recorded patches in place, keeps file-name navigation to the original edit, and removes the redundant totals explanation.

The full review kept that design and fixed one performance defect: opening one file also parsed unrelated edits in the same message. Commit bf4ee94759f now resolves each selected recorded edit through the existing parser cache. Regression tests prove unrelated edit bodies stay unopened, repeated patches remain ordered, multi-file selections stay correct, and original cards share the parsed data.

Two adversarial review rounds, an independent architecture challenge, and final readiness with a dedicated performance review found no remaining meaningful code issue. Deferred: action-tooltip polish on the Show/Hide diff button.

Final reviewed and pushed head: 081cfdb58266, including the one end-of-review sync with main. Verification passed:

  • 147 targeted and integration tests across nine files.
  • All 24 current-workflow orca-ci-checks gates, including compiler checks using isolated Bun 1.4.3.
  • GitHub CI: static analysis, all five Node test shards, relay integration, macOS and Windows packaging, and the final evidence/verification jobs. The CI watch resumed once after a network timeout; no jobs were rerun.

Remote Electron QA passed on M4Air at the final head, using the Electron skill and Playwright through Chrome DevTools Protocol with every app window hidden and unfocused. The final rendered test passed in 5.1 seconds. It verified two-file totals, two recorded patches for one file in order, isolation between files, added and removed text, line numbers 42/84/7, long-path truncation and full title, keyboard disclosure, hide/reopen, and file-name navigation to the newest original edit. Settled screenshots were checked for readable patch rows and clipping; the temporary test fixture was removed and the QA app exited.

The rendered test used mocked recorded session history and tab inventory through the real app interface. Live provider sessions were not exercised. Windows and Linux interactive QA and large-history frame-time or retained-memory profiling were not completed. Two Windows QA worktrees remain preserved because safe cleanup preconditions could not be established.

Collapsed file summary:

Collapsed summary with two files and counts

Both recorded patches for the selected file:

Selected-file patches in order, at lines 42 and 84

Second file expanded independently:

Both file diffs, including the second file at line 7

File-name navigation to the original edit:

Original newest-edit card after file-name navigation

Review, fixes, CI, and M4Air rendered QA are complete. No merge was performed.

@brennanb2025
brennanb2025 merged commit 8a7d19e into main Oct 12, 2026
30 checks passed
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