refactor(ui): extract session turn diffs#677
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR extracts per-file diff accordion rendering from ChangesDiff Rendering Extraction
Possibly Related PRs
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Code Review
This pull request refactors the SessionTurn component by extracting the diff summary accordion into a new standalone component, SessionTurnDiffs. This change reduces the complexity of SessionTurn and updates the frontend architecture manifest to track the resolution of large files. Feedback focuses on improving accessibility by replacing generic <span> and <div> elements with native <button> elements for interactive toggles, as well as removing a redundant String() conversion in an i18n translation call.
77d1b82 to
f0958b4
Compare
b03c549 to
7b36fd1
Compare
Perf delta summaryComparator: pass
|
7b36fd1 to
7b309a6
Compare
7b309a6 to
f77b568
Compare
f77b568 to
2afefb3
Compare
c0fa4e9 to
0cfe254
Compare
Topology Update (2026-05-16)
Final base:
devafter #676 was squash merged.Dependency status: true short stack dependency. #676 and #677 both modify
packages/ui/src/components/session-turn.tsx; #677 is now restacked ondevafter #676 landed.Review order: final PR in the session-turn UI stack. This stack is independent from the message-timeline stack, whose lower PRs have already landed.
Latest head after fresh-eyes follow-up:
c0fa4e99e.Summary
Extracted the legacy
SessionTurndiff summary accordion intopackages/ui/src/components/session-turn-diffs.tsxand preserved the existingSessionTurnfallback wiring.Why
This continues the #601 message-flow architecture stack after #676. The previous PR separated the turn-change panel but left the legacy diff summary inside
session-turn.tsx. This PR moves that summary into its own owner component while keeping the fallback behavior unchanged.Canonical manifest:
.github/frontend-architecture-manifest.mdRelated Issue
Human Review Status
Fresh-eyes review clean after
c0fa4e99e. The first fresh-eyes pass found a P2 keyboard-focus visibility issue;c0fa4e99efixed it, and the second fresh-eyes review found no P0-P3 issues.Review Focus
data-slotnames.SessionTurnstill owns assistant rendering, retry/thinking state, message lookup, and fallback gating.devafter refactor(ui): extract session turn changes panel #676 was squash merged.Risk Notes
Behavior is intended unchanged. Main risk is a legacy diff summary regression because the accordion state moved into a child component. No dependency, persistence, platform, or public export change.
Architecture Boundary
Owner lane: #601 message flow.
Base/depends on: #667 -> #669 -> #670 -> #671 -> #672 -> #674 -> #675 -> #676. This PR is now restacked on
dev.Touched files:
packages/ui/src/components/session-turn.tsxpackages/ui/src/components/session-turn-diffs.tsxpackages/ui/src/components/session-turn.csspackages/ui/src/components/session-turn-parent.test.tsArchitecture effect:
SessionTurnDiffssession-turn.tsxsheds the inline diff accordion codeReview Follow-up
button type="button", with existing data-slot styling preserved through button reset rules, and the i18ncountis passed as a number.SessionTurnwiring so the component is actually used.c0fa4e99e: keyboard focus now reveals the show-all toggle with a visible outline, and the more button explicitly remains left-aligned.How To Verify
Current Blocker
perf-probe-baselineis not green onc0fa4e99e, so this PR is not mergeable yet.Evidence:
25964690195/ job76325995214failed after 30m7s. Confirmed compare failed ondefault:homepage-cold:frame_gap_max_ms_delta; diagnostic then failed in base checkout on low-endsession-scroll-reading-longcoverage.76327884487failed after 30m28s with different confirmed failures: initial comparedefault:terminal-side-panel-open:interaction_ms_median, confirmed comparedefault:session-streaming-long:*anddefault:tool-default-open-heavy-bash:frame_gap_max_ms_delta; diagnostic was cancelled during base low-end trace after timeout.Screenshots or Recordings
Not included. This PR is intended as a behavior-preserving component extraction with no visible copy change; Electron manual visual verification was not run.
Checklist
devafter the merged stack base, and my PR title and commit messages use Conventional Commits in EnglishSummary by CodeRabbit
Release Notes
Refactor
Style