You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Opening ~/notes.txt from an external tracked repository's Diff can open a different file in the user's home directory. The commit dialog and Diff image previews use the same link resolver, which treats a Git filename starting with ~/ as home shorthand.
Deterministic repro on origin/main (54e81819cbe825bfa36808c783c84758890e4ca0): Track a sibling Git repository at /home/alex/repo from a thread rooted elsewhere. In the repository, commit ./~/notes.txt, then modify it. Open the thread's Diff → Uncommitted scope, select the tracked repository, and click ~/notes.txt. The Git diff header supplies that literal name; because the repository is outside the thread folder, Diff sends the resolved target through the editor-launch RPC. Observed: /home/alex/notes.txt. Expected: /home/alex/repo/~/notes.txt.
Save hunter-literal-tilde.e2e.ts from the evidence gist under scripts/scenarios/ and run vp run scenarios:prove scripts/scenarios/hunter-literal-tilde.e2e.ts --base 54e81819cbe825bfa36808c783c84758890e4ca0 --head HEAD to reproduce with an isolated Git fixture and capture the editor argument.
Change
Join literal Git paths to the appropriate repository or workspace root without interpreting link shorthand. The Diff header's external-editor action, context menu, working-tree image preview, and commit dialog's changed-file action share that join across web, hosted web, and Electron. In-panel file opening and Markdown links are unchanged.
Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
Both focused tests failed on base with /home/alex/notes.txt and passed with /home/alex/repo/~/notes.txt after the fix.
Chromium component tests reproduced the missing ~/logo.png preview and the commit dialog sending /home/alex/notes.txt. After the fix, the image preview renders and the commit dialog sends /home/alex/repo/~/notes.txt to the editor hook.
vp run check:changed exited 0, including 76 affected tests and four React Compiler checks.
Not shown: live image asset serving and commit-dialog launches (covered at the browser component boundary), context-menu launch in the browser (target covered by a unit test), hosted relay and Electron launches, or Windows/macOS editor launches. Mobile does not use these web actions.
Authored by GPT-6.2 Sol (Codex); reviewed by Gemini 4 Neon (Antigravity).
Reviewing files that changed from the base of the PR and between 4eee5d6 and e805bfc.
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 change adds joinDiffFilePath and uses it to construct paths for changed-file editor actions, image previews, and file context menus. Tests cover paths that begin with a literal ~.
joinDiffFilePath joins a working directory and relative path using a separator selected from the working directory format. Editor actions use the helper when a working directory is available. Tests check that ~/notes.txt remains a literal path segment.
Preview and context-menu paths apps/web/src/components/DiffPanel.tsx, apps/web/src/fileContextMenu.ts, apps/web/src/components/DiffPanel.browser.test.tsx, apps/web/src/fileContextMenu.test.ts
Image previews and file context menus use joinDiffFilePath to combine resolved paths with their working directories. Tests include paths beginning with ~.
Literal ~/ folders in diffs now open at the correct repository path instead of being treated as home-directory shorthand. The change is small and tested, and no merge-blocking risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(web): keep literal tilde folders inside the diff repository" names the main change. The changeset joins literal Git paths to the repository or workspace root, so a tracked file named `~…
Description check
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section states the bug, expected behavior, and a deterministic reproduction on a stated base…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "fix(web): keep literal tilde folders inside the diff repository" names the main change. The changeset joins literal Git paths to the repository or workspace root, so a tracked file named ~/notes.txt no longer expands to the home directory. The title is concise, uses a conventional commit prefix, and matches the bug fix described in the objectives.
Full details: Description check
Explanation
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section states the bug, expected behavior, and a deterministic reproduction on a stated base commit. The Change section explains the shared path join across the affected surfaces. The Scope section states why no issue is linked, as the template asks. Verification lists focused tests, a scenario run, a full changed-check run, and untested areas. The description is thorough. One gap: the Verification section cites an external gist and a scenario path, which reviewers must open to confirm the evidence. The description also does not include before/after screenshots inline, though it links them. These gaps are minor, so the check passes.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
Macroscope's review found this PR approvable — Diff file actions now treat tilde-prefixed folders as literal repository paths instead of home-directory shortcuts. The change is limited to file targeting for editor actions, context menus, and image previews.
Needs human approval because:
Macroscope's correctness review did not reach a verdict
Notes:
The correctness review was unavailable. Eligibility was assessed without its result.
You can add or adjust custom eligibility rules. Learn more.
The browser tests repeated the same join at each call site; the unit
tests for openDiffFilePrimaryAction and resolveFileContextMenuAbsolutePath
already fail on main for this bug.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Environment: Linux web client, Chromium 156, 1280×800, light theme, fresh server state on each commit, Replay (dev). Projects and tracked-folder state were seeded through the real server API.
On each commit, seed fresh Git repositories with ~/notes.txt, ~/logo.png, and root control.png; commit then modify all three. Track tilde-repo from other-repo and start a Replay thread there. Open Diff → Changes, select tilde-repo, expand both images, and click ~/notes.txt. Open Thread details → Other repositories… → tilde-repo → Git action options → Commit; click Open ~/notes.txt in editor and Open control.png in editor. Record the editor shim's launch arguments.
Scenario: Git-relative tilde folders preview images inside the selected repository
- Changed files outside the thread folder open by joining the path as
upstream pingdotgg#47610 does, not through the link resolver.
- The fork's thread-branch rename and review too-large paths follow
upstream's untrimmed path schemas (pingdotgg#47804, pingdotgg#48000).
- Restore upstream's contracts filesystem and project tests.
- coder-only.md lists the two new session-storage keys.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:S10-29 changed lines (additions + deletions).vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Opening
~/notes.txtfrom an external tracked repository's Diff can open a different file in the user's home directory. The commit dialog and Diff image previews use the same link resolver, which treats a Git filename starting with~/as home shorthand.Deterministic repro on
origin/main(54e81819cbe825bfa36808c783c84758890e4ca0): Track a sibling Git repository at/home/alex/repofrom a thread rooted elsewhere. In the repository, commit./~/notes.txt, then modify it. Open the thread's Diff → Uncommitted scope, select the tracked repository, and click~/notes.txt. The Git diff header supplies that literal name; because the repository is outside the thread folder, Diff sends the resolved target through the editor-launch RPC. Observed:/home/alex/notes.txt. Expected:/home/alex/repo/~/notes.txt.Save
hunter-literal-tilde.e2e.tsfrom the evidence gist underscripts/scenarios/and runvp run scenarios:prove scripts/scenarios/hunter-literal-tilde.e2e.ts --base 54e81819cbe825bfa36808c783c84758890e4ca0 --head HEADto reproduce with an isolated Git fixture and capture the editor argument.Change
Join literal Git paths to the appropriate repository or workspace root without interpreting link shorthand. The Diff header's external-editor action, context menu, working-tree image preview, and commit dialog's changed-file action share that join across web, hosted web, and Electron. In-panel file opening and Markdown links are unchanged.
Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
/home/alex/notes.txtand passed with/home/alex/repo/~/notes.txtafter the fix.~/logo.pngpreview and the commit dialog sending/home/alex/notes.txt. After the fix, the image preview renders and the commit dialog sends/home/alex/repo/~/notes.txtto the editor hook.vp run check:changedexited 0, including 76 affected tests and four React Compiler checks.Authored by GPT-6.2 Sol (Codex); reviewed by Gemini 4 Neon (Antigravity).