Skip to content

fix(web): changed root files with a leading space open in the diff panel - #36606

Merged
juliusmarminge merged 4 commits into
pingdotgg:mainfrom
StiensWout:t3/leading-space-file-selection
Nov 14, 2026
Merged

juliusmarminge merged 4 commits into
pingdotgg:mainfrom
StiensWout:t3/leading-space-file-selection

Conversation

@StiensWout

Copy link
Copy Markdown
Contributor

Selecting a turn's changed root file named leading.ts opened the diff panel without revealing the file. The checkpoint-summary contract and selection store both stripped its leading space.

Keep exact Git paths through the contract and selection store. Match the diff parser's trailing-whitespace behavior only at the DiffPanel boundary, preserving today's trailing-space reveal.

Small fast-lane fix: no new state, storage, migration, module or UI flow. Web and the desktop web view share the fix; mobile displays these summaries without turn-file reveal. Discovered by the maintainer bughunt and independently confirmed by Claude Opus 5.5 on 9e180e55693badee0d9f71322f7ded79b1829710 with real Git, numstat and diff-parser probes.

Proof

  • The finding's store repro failed on main b2259d3c6c and passed with exact selection paths. The retained browser test covers that behavior through the real store and DiffPanel, with files initially collapsed.
  • The checkpoint-summary schema test fails on base and passes with exact leading/trailing path decoding.
  • pnpm exec vp run scenarios:prove scripts/scenarios/turn-file-leading-space-reveals.e2e.ts --base b2259d3c6ca71e59cea0c9cc0b9e8d8a90a027f9 --head HEAD: real changed-file click fails on base and reveals the expanded diff on head. The temporary scenario is proof tooling, not shipped code.
  • The corresponding trailing-space scenario passes on both base and head. It guards existing behavior; no trailing-name user defect is claimed.
  • pnpm exec vp run check:changed passes. Includes formatting, lint, knip, affected typechecks, focused tests and React compiler checks.
  • Local cubic: no issues; fork-specific repository context was unavailable.
Before After
Selected file remains collapsed Selected file reveals its diff

Historical summaries already stored with trimmed paths cannot recover the lost characters. Filenames differing only by trailing whitespace still collide inside the third-party parser, and whitespace-only filenames still cannot be revealed. Those parser limitations are outside this leading-space fix. The trailing-space browser case guards the boundary if the parser changes.

Council review

Reviewer Round 1
Claude Opus 5.5 9/10
GPT 6.1 Sol 9/10

No blockers or should findings. First-round average did not trigger a second round. Opus's title nit is addressed by the scoped PR title; its whitespace-only-name nit is disclosed above. No separate proof audit or evidence run in the fast lane; the builder supplied real-app red/green proof.

Created with Claude Opus 5.5 (build, trim and review) and GPT 6.1 Sol (bughunt, lead and review) in T3 Code through Claude Agent and Codex.

Closes #36605

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 14, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at eb4cb94

Macroscope's review found this PR approvable — Preserves whitespace in checkpoint filenames so files with leading spaces can be selected and revealed in the diff panel. The change is limited to filename metadata and viewer navigation, with no material operational exposure identified.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between eb4cb94 and de91799.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The checkpoint file-summary schema and turn-file selection path now preserve filenames with leading or trailing whitespace. The diff panel normalizes trailing whitespace when matching a selected turn file.

Changes: Turn-file path preservation

Layer / File(s) Summary
Preserve checkpoint paths
packages/contracts/src/orchestrationV2.ts, packages/contracts/src/orchestrationV2.test.ts
The checkpoint file-summary schema accepts non-empty paths without trimming. A test verifies that decoding preserves leading and trailing spaces.
Match turn-file selections
apps/web/src/diffPanelStore.ts, apps/web/src/components/DiffPanel.tsx, apps/web/src/components/DiffPanel.browser.test.tsx
The selection store preserves the supplied path. The diff panel trims trailing whitespace when matching a selected turn file. A browser test covers leading- and trailing-space paths.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: juliusmarminge, yash-singh1

Merge Risk: Minimal · previous review eb4cb

Selecting a changed file whose name begins with a space now reveals it in the diff panel, and trailing-space behavior is kept. The change is small and tested, and no actionable merge-blocking risk is evident.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the actual fix: changed root files with a leading space now open in the diff panel. It matches the main change in the changeset, which keeps exact paths through the contract and store …
Description check Passed The description covers the problem, the change, scope, and verification. It states the linked issue (#36605) and gives the commands and results for red/green proof. It follows the template's section s…
Linked Issues check Passed Issue #36605 requires that selecting a turn's changed root file with a leading space reveals that file expanded in the diff panel. The reported cause was trimming in the checkpoint file-summary schema…
Out of Scope Changes check Passed All changed files map to the leading-space reveal objective of #36605. The contract schema, selection store, DiffPanel boundary, and their tests each contribute to exact path preservation or to the tr…
Full details: Title check

Explanation

The title names the actual fix: changed root files with a leading space now open in the diff panel. It matches the main change in the changeset, which keeps exact paths through the contract and store and trims trailing whitespace only at the DiffPanel boundary. It is specific and uses the conventional commit form.

Full details: Description check

Explanation

The description covers the problem, the change, scope, and verification. It states the linked issue (#36605) and gives the commands and results for red/green proof. It follows the template's section structure. It also notes limits: stored trimmed summaries, trailing-space parser collisions, whitespace-only filenames, and mobile. The Problem and Change sections are brief but clear. The Verification section gives concrete commands, before/after screenshots, and the observed results.

Full details: Linked Issues check

Explanation

Issue #36605 requires that selecting a turn's changed root file with a leading space reveals that file expanded in the diff panel. The reported cause was trimming in the checkpoint file-summary schema and the selection store. The reviewed head addresses each cause:

  • packages/contracts/src/orchestrationV2.ts: OrchestrationV2CheckpointFileSummary.path changes from TrimmedNonEmptyString to Schema.NonEmptyString, so leading and trailing spaces survive decoding. The added test in orchestrationV2.test.ts checks exact decoding of a leading-space and trailing-space path.
  • apps/web/src/diffPanelStore.ts: selectTurn stores filePath ?? null instead of filePath?.trim() || null, so the exact Git path is kept in selection state.
  • apps/web/src/components/DiffPanel.tsx: selectedFilePath applies trimEnd() and maps an empty result to null. This matches the diff parser's trailing-whitespace behavior, so a leading-space name matches the parsed filename and a trailing-space name keeps its existing reveal.
  • apps/web/src/components/DiffPanel.browser.test.tsx: a parameterized browser test covers leading and trailing space paths with files initially collapsed, and checks that the file button is expanded.
    The PR description reports that the real-app scenario fails on base and passes on head. I did not rerun those scenarios. Known limits are outside the issue's requirements: stored summaries that already lost whitespace cannot recover it, and whitespace-only names cannot be revealed. The issue does not require either case.
Full details: Out of Scope Changes check

Explanation

All changed files map to the leading-space reveal objective of #36605. The contract schema, selection store, DiffPanel boundary, and their tests each contribute to exact path preservation or to the trailing-space guard. The diff shows no unrelated behavior change. The selectTurn change also removes trimming for empty and whitespace-only values. In the store, that value flows to DiffPanel, where trimEnd() yields an empty string that is mapped to null. The contract now accepts whitespace-only path strings. These effects follow from the same path-preservation objective and are disclosed in the PR as limits, so they do not count as unrelated changes.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b4c1bd1 and eb4cb94.

Files selected for processing: 5

  • apps/web/src/components/DiffPanel.browser.test.tsx
  • apps/web/src/components/DiffPanel.tsx
  • apps/web/src/diffPanelStore.ts
  • packages/contracts/src/orchestrationV2.test.ts
  • packages/contracts/src/orchestrationV2.ts

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

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 14, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Complete a replay turn editing root file leading.ts, collapse all diff files, then click that file in the turn's changed-files list. Linux Chromium, 1280×800, light theme, fresh synthetic state on each commit.

Before After
28f1786829 de91799450
Before: selected file remains collapsed After: exact file expands and reveals changed lines
Before recording After recording

Scenario source. scenarios:prove exited 0: fails on base and passes on head.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 14, 2026
@juliusmarminge
juliusmarminge merged commit 953ce60 into pingdotgg:main Nov 14, 2026
52 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 14, 2026
jieyuexing added a commit to jieyuexing/t3code-cn that referenced this pull request Nov 14, 2026
合入上游 286 个提交。冲突 8 处:
- apps/desktop/src/shell/DesktopShellEnvironment.ts:fork 的代理端点与绕过列表补全、上游 pingdotgg#24623 的 Android SDK 补全两段都保留,先代理后 Android SDK。
- apps/server/src/mcp/McpHttpServer.ts:layerTools 里 fork 的 layerPluginAgentTools 与上游的 layerMessageToolkit 都保留。
- apps/server/src/peer/RemoteDelegation.ts:服务对象两边字段合并(fork 的 checkout、finishedCheckout、place 与上游 pingdotgg#24475 的 runStatus)。
- apps/server/src/peer/RemoteDelegation.test.ts:makeLaptop 参数取上游的 beforeFollow(第 4 个,保持上游调用不变)再接 fork 的 load、descriptor,fork 唯一传这两个参数的调用补一个 undefined;层组合取上游的 ThreadManagement 包装,再接 fork 的 layerForwarding(代替 PeerForwarding.layer)。
- apps/server/src/provider/agentContextBudget.json:取上游 claude/codex 实测值,mcpToolListJsonBytes 按合并后实测 50432。
- apps/web/src/components/ChatMarkdown.tsx:上游 pingdotgg#36364 的 agentRoots 接在 fork 提到组件层的 otherProjectRoots 上。
- apps/web/src/components/DiffPanel.tsx:fork 的插件 reveal 与上游 pingdotgg#36606 的 trimEnd 都保留(trimEnd 只作用于回合差异的路径)。
- evals/mcp-tool-use/cases/orchestration.ndjson:两边新增的用例都保留。

更新说明(nightly 20261114.4682)
桌面 / 网页
- 智能体可以用主题色和 CSS 改 T3 Code 的外观(主题编辑器)
- 新开的浏览器标签按默认缩放与外观打开;Agent 从链接打开的新标签不再抢走输入框焦点;鼠标前进后退留在浏览器标签内
- Agent 在 cd 进去的检出里引用的文件链接能打开对应文件;文件预览选区滚动后复制仍是所选行;回合差异超出大小上限时会说明不完整
- 删除定时任务前先确认;去掉常规的成功通知;运行中等待前台子代理时显示原因而不是「思考中」
- 修复:模型选择不再继承另一个模型的特性、重新创建的文件夹不再显示已删文件、清屏保留终端输入模式、粘贴的 URL 与路径保留下划线、Linux 中键点击空白处不再粘进输入框等

移动端(需更新商店版才有)
- 线程列表的项目筛选先列最近活跃的项目;新线程从当前筛选的项目开始;已是项目的文件夹再次添加会直接打开
- 修复 iOS 引用块长按遮挡、Android 返回键、iPhone 上 HTML 预览内联播放视频等问题

服务端与 Agent
- 停止的提供方线程可原生恢复;Codex 的 Stop 迟迟不完成时提供 Force stop;delegate_task 子任务以 Codex 子代理启动
- 新线程首轮启动更快;线程列表只为返回的这一页构建元数据;多处线程读取不再读全部历史
- T3 Connect 新设备需要批准;其他网站不能再嵌入网页版;提供方登录链接只打开网页地址
- Git:尊重跟踪分支配置的推送远端、轮次差异跟随分支切换、远端删掉的默认分支不再用于新建 worktree 线程;GitLab、Azure DevOps、Forgejo 多处修复
- 修复:网络挂载卡住时启动进程不再冻结服务端、btrfs 上数据库目录关闭写时复制、远端委派任务的跟随者出错后不再一直显示运行中、Claude 可完整展示轮次中途的文字、OpenCode/Cursor/Pi 多处用量与子代理问题等

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Changed root files with a leading space do not reveal their diff

2 participants