fix(web): better right panel (new diffs styling) - #5260
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 Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
ApprovabilityVerdict: Needs human review This PR introduces a new diff file expansion feature with a new RPC endpoint, server-side file reading logic with path traversal protections, and new UI behaviors — significantly more than the 'styling' title suggests. The security-sensitive file reading code and scope of new capability warrant human review. You can customize Macroscope's approvability policy. Learn more. |
f862182 to
a764454
Compare
There was a problem hiding this comment.
One finding on the new ReviewService.getDiffFileContents path: the workspace-boundary failure it produces reports the wrong operation/detail, so the caller-visible error identifies getDiffPreview instead of the failing operation. Inline comment has the suggested fix.
Posted via Macroscope — Effect Service Conventions
There was a problem hiding this comment.
One finding on the new Git review-diff file-contents path. See the inline comment.
Posted via Macroscope — Effect Service Conventions
Dismissing prior approval to re-evaluate 821eb5e
## What's Changed * fix(web): better right panel (new diffs styling) by @maria-rcks in pingdotgg/t3code#5260 * fix(server): keep regenerated titles on topic by @t3dotgg in pingdotgg/t3code#5365 * refactor(server): make title prompts plaintext by @t3dotgg in pingdotgg/t3code#5368 * feat(web): configurable fonts and sizes under Settings → Appearance by @StiensWout in pingdotgg/t3code#5103 * feat(sidebar-v2): bring back thread pinning by @t3dotgg in pingdotgg/t3code#5312 * feat(web): make pairing QR codes actually scannable, with endpoint choice by @t3dotgg in pingdotgg/t3code#5360 * fix(desktop,web): improve in-app browser shortcuts and URL behavior by @t3dotgg in pingdotgg/t3code#4703 * fix(web): prevent legacy model picker layout shift by @FllipEis in pingdotgg/t3code#5349 * fix(server): allow remote updates with database migrations by @t3dotgg in pingdotgg/t3code#5374 **Full Changelog**: pingdotgg/t3code@v0.0.32-nightly.20260804.1000...v0.0.32-nightly.20260805.1002 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.32-nightly.20260805.1002
- Port thread pinning (#5312) into the orchestration-v2 command pipeline: thread.pin/unpin commands, thread.pinned/unpinned events, pinnedAt on the v2 thread state and projected shells, promotion semantics (pin clears settle/snooze, settle clears pin) matching the v1 decider, and client pin/unpin operations in the v2 dispatch style. - Port the regenerated-title context anchoring (#5365) into ThreadTitleRegenerationService: pin the first user message ahead of the retained tail when the digest is truncated. - Re-apply the right-panel controls positioning from #5260 to the v2 ChatView title bar controls. - Repair merge artifacts: committed conflict markers in BranchToolbar, duplicate capability keys, duplicate CommandPalette import, v1 turn naming in DiffPanel's focus-refresh effect, onSend signature merge. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit 4fb03af)
Problem
The right-panel tabs and diff chrome had inconsistent sizing and spacing, with the close affordance reserving extra trailing space. Diff rows, controls, separators, and loading skeletons also no longer matched the darker panel treatment. Expanding a file could shift the list upward because the virtualizer's bottom padding disagreed with its sticky-item measurements.
Solution
Validation
vp lint apps/web/src/components/ChatView.tsx apps/web/src/components/DiffPanel.tsx apps/web/src/components/DiffPanelShell.tsx apps/web/src/components/RightPanelTabs.tsxvp run --filter @t3tools/web typecheckvp test run apps/web/src/lib/diffCollapse.test.ts apps/web/src/lib/diffRendering.test.ts apps/web/src/diffPanelStore.test.ts apps/web/src/rightPanelStore.test.ts(44 tests)Model: GPT-5.6 Sol via Codex harness.
Note
Add diff file content expansion and refresh to the right panel diff view
getDiffFileContentsRPC (server, contracts, client) that fetches old/new file text for a diff entry, with per-side 1 MB limits, binary rejection, path-containment checks, and support for both working-tree and branch-range sources.DiffPanelnow lazily loads per-file contents, auto-refreshes on window focus and after a new turn completes, and exposes a manual refresh button with a spinner.AnnotatableCodeViewswitches fromonLineSelectionEndtoonGutterUtilityClickto trigger comments, lifts draft text state up, and accepts acodeViewKeyprop to force remounts.LocalCommentAnnotationsupports a controlledonTextChange/textprop pair and simplifies saved-comment rendering (no header or range label).onLineSelectionEndno longer creates comments inAnnotatableCodeView; gutter clicks are now the sole trigger.Macroscope summarized 13c8279.
Note
Medium Risk
New server path reads git revisions and the working tree from user-supplied paths; mitigations exist (workspace root, realpath containment) but this expands the review attack surface. Large UI/CSS and comment-interaction changes affect core diff viewing behavior.
Overview
Adds
review.getDiffFileContentsend-to-end (contracts, WS RPC, auth,ReviewService, Git driver) so the diff panel can hydrate full old/new file text when expanding unchanged regions in working-tree and branch-range previews, with workspace-boundcwd, repo-root path checks, binary rejection, and a 1 MB per-side cap.DiffPanelwires Pierre’sloadDiffFilesto that command for git scopes (not turn checkpoints), adds a manual Refresh diff control plus auto-refresh on window focus and when the latest completed turn changes, and refreshes diff styling (flat backgrounds, inline “N unmodified lines” separators, tighter headers/metrics,codeViewRevisionremount when collapsing all files).Right-panel chrome is tightened: smaller tabs with hover-to-close on the leading icon, title-bar control positioning when the panel is open, and updated loading skeletons. Diff comments now start from gutter utility clicks (not line-selection end), with simplified inline draft/saved annotation UI and lifted draft text state.
Reviewed by Cursor Bugbot for commit 13c8279. Bugbot is set up for automated code reviews on this repo. Configure here.