Skip to content

fix(web): offer file restore only for worktree threads - #33429

Open
dominikzabcik wants to merge 1 commit into
pingdotgg:mainfrom
dominikzabcik:fix/edit-from-here-revert
Open

dominikzabcik wants to merge 1 commit into
pingdotgg:mainfrom
dominikzabcik:fix/edit-from-here-revert

Conversation

@dominikzabcik

@dominikzabcik dominikzabcik commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Why

"Edit from here" offered "Revert files too" in threads that share the project directory. The server rejects that action because file restore requires an isolated worktree.

What changed

Scope

Covers the web chat dialog and the desktop client that uses it. Mobile, provider adapters, contracts, and server restore rules are unchanged. The server still checks isolation, including side chats, when a restore runs.

Verification

  • vp run check:changed passed format, lint, knip, affected-package typechecks, tests in five files, and React Compiler checks. It passed again after the rebase onto fix(rewind): allow conversation-only rewind in non-git workspaces #18379.
  • In the dev web client with Replay, a shared-directory thread offered only "Revert and keep changes".
  • In a worktree thread, "Revert files too" restored an edited file to its checkpoint and returned the prompt to the composer without an error.

Before:

Shared-directory thread offers file restore

After:

Shared-directory thread explains that files stay unchanged

Implemented and verified by Claude Opus 5.5 through Claude Code. Final handoff and PR preparation by GPT-6.1 Sol through the Codex harness.

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 9, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 9b2a956

Macroscope's review found this PR approvable — The revert dialog hides file restoration for threads without a worktree and explains that files remain unchanged. Existing restore safeguards and chat-only rewind behavior are unchanged.

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

@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The revert confirmation dialog receives a flag based on whether the active thread has a worktree path. The dialog explains how file restoration applies and shows the “Revert files too” action only for worktree threads.

Changes: Revert confirmation behavior

Layer / File(s) Summary
Gate file restoration in the dialog
apps/web/src/components/chat/ChatOverlayHosts.tsx, apps/web/src/components/ChatView.tsx
ChatView passes whether the active thread has a worktree path. The dialog explains that restoring files undoes edits in a worktree, and shows “Revert files too” only for worktree threads. The checkpoint-readiness condition and confirmation action are unchanged.

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

Change: Bug fix

Possibly related PRs

  • pingdotgg/t3code#18379: Both changes affect availability of the “Revert files too” action. This PR gates it by worktree status, while PR #18379 gates it by checkpoint readiness.
  • pingdotgg/t3code#27690: Both changes alter the conditions for displaying the file-restoration action in RevertConfirmHost.

Suggested labels: bugfix

Suggested reviewers: juliusmarminge, revens2

Merge Risk: Minimal · up to 2446d

The dialog now shows file restore only for worktree threads and explains that files stay unchanged otherwise. No actionable merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(web): offer file restore only for worktree threads" matches the main change. The changeset passes an isWorktree flag to RevertConfirmHost, shows the "Revert files too" option only for w…
Description check Passed The description follows the template. It has Why (Problem), What changed (Change), Scope with a link to the related issue context (#18379) and a statement that the change is a bug fix, and Verificatio…
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: Title check

Explanation

The title "fix(web): offer file restore only for worktree threads" matches the main change. The changeset passes an isWorktree flag to RevertConfirmHost, shows the "Revert files too" option only for worktree threads, and explains that files stay unchanged in shared-project threads. The title is a conventional commit that follows the repository template example style.

Full details: Description check

Explanation

The description follows the template. It has Why (Problem), What changed (Change), Scope with a link to the related issue context (#18379) and a statement that the change is a bug fix, and Verification with specific checks and observed results, including before/after screenshots for the UI change. The Scope section does not link a dedicated issue that shows the bug, and it does not explicitly say why no issue is needed, so that part is weaker. The template's agent attribution line is present. Overall the description is mostly complete.

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 8dfc2f6 and 2446dc0.

Files selected for processing: 1

  • apps/web/src/components/ChatView.tsx

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

@maria-rcks

maria-rcks commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-6.1-sol on behalf of Maria

Verified in a real dev environment

verified head 9b2a956ddfae074d9438e9372b86c03307fdb588 as-is on a disposable linux vm. used the real dev web client with repo Playwright and /usr/bin/google-chrome, plus real Codex gpt-6.1-sol turns through the local provider proxy. no mocks, replay provider, fixtures, or demo data.

  • reproduced on github/main (f12bb6229c): after Codex changed a tracked file in a shared-directory thread, "edit from here" offered "revert files too". clicking it produced the server error "file restore requires an isolated worktree."
  • on this head, the same app-created thread and prompt hide that action and explain why files stay unchanged.
  • cancel preserved the conversation. "revert and keep changes" restored the full prompt, kept the edited file, and allowed successful resubmission to Codex.
  • created a new worktree thread through the workspace picker. after a real Codex file edit, "revert files too" remained available and restored the checkpoint, returned the prompt, and left the shared checkout untouched.
  • inspected the dialog at 1440px in light mode and 390px in dark mode.
  • vp run check:changed b8c2cfad6b3363c4da144a859073b41ec77579ab passed through blacksmith-check: format, lint, knip, typechecks for two packages, tests in four files, and React Compiler checks. the worker initially lacked base history and Chromium; installed those prerequisites and reran successfully.

before, shared checkout on main:

main offers an unsupported file restore action

after, matching thread on this head:

pr hides file restore in a shared checkout

chat-only rewind and successful real Codex resubmission:

shared checkout rewind and codex resubmission

worktree file restore and prompt recovery:

worktree checkpoint restore

runtime file checks:

shared checkout after chat-only rewind: first change\n
worktree before file restore:          worktree change\n
worktree after file restore:           baseline\n
shared checkout after worktree restore:first change\n

short runtime transcript. inspected captures and verified uploaded video playback and seeking in the T3 browser.

Not verified

native desktop shell and native ios/android clients were not exercised; this pass used linux Chrome. other providers, relay/tunnel connections, attachments, and worktrees with side chats were not exercised. the pr changes the shared web dialog, not those provider or server paths. no source changes were needed.

@github-actions

Copy link
Copy Markdown
Contributor

This PR conflicts with main. Rebase it or merge main into it. If it still conflicts after 7 days with no activity, it will be closed automatically.

See the conflict window.

@github-actions github-actions Bot added the needs-rebase Conflicts with its base branch. Closes after 7 days with no activity. label Nov 14, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase Conflicts with its base branch. Closes after 7 days with no activity. size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants