feat(web): collapse large git diffs by default to make chat more readable#4409
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit cb78d9b. Configure here.
ApprovabilityVerdict: Approved UI-only changes adding collapse/expand functionality for changed files display in chat. Self-contained presentation logic with tests, minor accessibility improvements, and UI state persistence updates. No backend or security implications. You can customize Macroscope's approvability policy. Learn more. |
…able (pingdotgg#4409) (cherry picked from commit 51672b6)
…able (pingdotgg#4409) (cherry picked from commit 51672b6)
…able (pingdotgg#4409) (cherry picked from commit 51672b6)
…able (pingdotgg#4409) (cherry picked from commit 51672b6)
…able (pingdotgg#4409) (cherry picked from commit 51672b6)
…able (pingdotgg#4409) (cherry picked from commit 51672b6)
…able (pingdotgg#4409) (cherry picked from commit 51672b6)
…able (pingdotgg#4409) (cherry picked from commit 51672b6)
…able (pingdotgg#4409) (cherry picked from commit 51672b6)
…able (pingdotgg#4409) (cherry picked from commit 51672b6)
…able (pingdotgg#4409) (cherry picked from commit 51672b6)
…able (pingdotgg#4409) (cherry picked from commit 51672b6)
…able (pingdotgg#4409) (cherry picked from commit 51672b6)
…able (pingdotgg#4409) (cherry picked from commit 51672b6)
…able (pingdotgg#4409) (cherry picked from commit 51672b6)
…able (pingdotgg#4409) (cherry picked from commit 51672b6)
…able (pingdotgg#4409) (cherry picked from commit 51672b6)
…able (pingdotgg#4409) (cherry picked from commit 51672b6)
…able (pingdotgg#4409) (cherry picked from commit 51672b6)
…able (pingdotgg#4409) (cherry picked from commit 51672b6)
…4309–pingdotgg#4488) (#187) * fix(client-runtime): keep a warm thread un-settled despite a merged/closed PR (pingdotgg#4309) Co-authored-by: Claude Fable 5 <noreply@anthropic.com> (cherry picked from commit 193e3c6) * Fix composer context strip alignment and glass shell (pingdotgg#4404) (cherry picked from commit 6ef7aa8) * Polish iOS git progress overlay with glass effects (pingdotgg#4387) (cherry picked from commit ce467da) * Improve composer glass fallbacks (pingdotgg#4406) Co-authored-by: codex <codex@users.noreply.github.com> (cherry picked from commit 67a7b1a) * feat(web): collapse large git diffs by default to make chat more readable (pingdotgg#4409) (cherry picked from commit 51672b6) * Stop new threads inheriting checkout/branch from viewed thread (pingdotgg#4411) Co-authored-by: Claude Fable 5 <noreply@anthropic.com> (cherry picked from commit 2f41c07) * fix: tone down branch-mismatch banner (pingdotgg#4416) Co-authored-by: Claude Fable 5 <noreply@anthropic.com> (cherry picked from commit fc3f78f) * fix: Claude Code skills discoverable for the composer $ picker (pingdotgg#4414) Co-authored-by: Claude Fable 5 <noreply@anthropic.com> (cherry picked from commit 6b9a598) * fix(web): keep settled threads reachable when opened directly (pingdotgg#4413) Co-authored-by: Claude Fable 5 <noreply@anthropic.com> (cherry picked from commit bb38c33) * feat(sidebar-v2): thread snoozing (pingdotgg#4311) Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: maria <maria@kuuro.net> (cherry picked from commit 202e560) * Upgrade Clerk packages and Expo integration (pingdotgg#4440) (cherry picked from commit 5d17354) Co-authored-by: aaditagrawal <aaditagrawal@users.noreply.github.com> * Increase light-mode contrast for user message bubbles (pingdotgg#4441) (cherry picked from commit 15e875a) * Restore model picker layout and retain iterative test state (pingdotgg#4450) Co-authored-by: codex <codex@users.noreply.github.com> (cherry picked from commit f7cc776) * Color settled PR labels on hover (pingdotgg#4451) Co-authored-by: codex <codex@users.noreply.github.com> (cherry picked from commit a7ee309) * [codex] Fix glass hover compositing artifacts (pingdotgg#4446) Co-authored-by: codex <codex@users.noreply.github.com> (cherry picked from commit ece0508) * Add Claude Opus 5 model (pingdotgg#4472) Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Theo Browne <me@t3.gg> (cherry picked from commit 41a430a) * feat(web): add collapse-all toggle to diff panel (pingdotgg#4475) (cherry picked from commit 38cfc25) * feat(web): show fast mode as a bolt instead of a "Normal" label (pingdotgg#4488) Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> (cherry picked from commit 5719e8a) * fix(sync): preserve Droid medium-access with Auto runtime mode Keep fork-only medium-access in RuntimeMode alongside upstream Auto. Update presentation maps and drop obsolete provider kind from slug helper. Co-authored-by: aaditagrawal <aaditagrawal@users.noreply.github.com> * fix(sync): restore fork release and runtime-mode adaptations Keep WSL node-pty on bullseye glibc, pin releases to the fork, and stop hard-requiring upstream relay/npm publish. Scope Auto vs Medium access by provider, normalize carried modes on new threads, and fix Claude/Droid type regressions from the restack. Co-authored-by: aaditagrawal <aaditagrawal@users.noreply.github.com> * fix(sync): refresh lockfile after Clerk upgrade restack Align patchedDependencies hashes (react-native-screens) and importer entries with the current workspace patches so frozen CI installs succeed. Co-authored-by: aaditagrawal <aaditagrawal@users.noreply.github.com> --------- Co-authored-by: Theo Browne <me@t3.gg> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: Julius Marminge <julius0216@outlook.com> Co-authored-by: codex <codex@users.noreply.github.com> Co-authored-by: maria <maria@kuuro.net> Co-authored-by: aaditagrawal <aaditagrawal@users.noreply.github.com> Co-authored-by: tomlit <tomlit@gmail.com> Co-authored-by: jan <hi@4bs3nt.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com>

What changed
Why
Large changed-file trees dominate the conversation and make completed work difficult to scan. The inline surface should summarize scope first and leave the full tree and diff available on demand.
Behavior
Validation
vp test run apps/web/src/components/chat/ChangedFilesTree.test.tsx apps/web/src/components/chat/changedFilesPresentation.test.ts apps/web/src/uiStateStore.test.tsvp run --filter @t3tools/web typecheckvp lintandvp fmt --checkNote
Collapse large git diffs in chat to improve readability
ChangedFilesCard, controlled by newexpanded,showCompactPreview, andonExpandedChangeprops; a chevron button in the header toggles between states.MessagesTimelinenow auto-expands changed-file sections only for the latest turn and only when under configurable file/line limits (via newshouldAutoExpandChangedFilesinchangedFilesPresentation.ts); older turns render collapsed.uiStateStoreis now versioned (THREAD_CHANGED_FILES_EXPANSION_VERSION = 1) and stores explicittrue/falseper turn; legacy unversioned state is discarded on load.DiffStatLabelgainsrole="group"and an aggregatedaria-labelfor screen readers, with visual tokens markedaria-hidden.Macroscope summarized d7abda3.
Note
Low Risk
Chat UI and local UI-state persistence only; no auth, API, or data-layer changes. Versioned migration may reset prior collapse preferences once.
Overview
Changed-files blocks in the chat timeline are now collapsible instead of always showing the full tree, so large diffs don’t dominate the thread.
ChangedFilesCardgains three UI modes (expanded,preview,collapsed) driven by parent props. The latest turn auto-expands only when there are ≤5 files and ≤200 changed lines; otherwise it shows a compact preview (top-level scope counts plus up to three representative files, each opening that file’s diff). Older turns default to a one-line receipt with no file list. Disclosure is a clickable header witharia-expanded; folder expand/collapse and “Open diff” actions are updated and only shown when relevant.Presentation logic moves into
changedFilesPresentation.ts(shouldAutoExpandChangedFiles,summarizeChangedFileScopes,selectChangedFilePreview).MessagesTimelinedelegates toChangedFilesCardand passeslatestTurnIdvia activity context for latest-vs-older behavior.uiStateStorenow persists both expanded and collapsed choices per turn, tagged withthreadChangedFilesExpansionVersion: 1; legacy persisted folder-only collapse state is ignored on load.DiffStatLabeladds a screen-readeraria-labelon the stat group with decorative+/-spans markedaria-hidden.Reviewed by Cursor Bugbot for commit d7abda3. Bugbot is set up for automated code reviews on this repo. Configure here.