Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): diff files in a nested repository keep their intermediate folders #37407

Closedfarseenmanekhan1232(GitHub profile, opens in a new tab)wants to merge 0 commits intomain fromrefs/pull/37407/headopened View on GitHub

Opening a changed file from the Diff panel for a git repository below a non-git project root joined the repository-relative path straight onto the project root, dropping every folder between the two (Kubernetes/ in the layout from #12902), so the read failed with ProjectReadFileError.

resolveDiffPathForWorkspace now handles the inverse relationship as well as the existing workspace-inside-repository case: when the repository sits below the workspace, it prefixes the diff path with the repository's offset from the workspace root, keeping every intermediate directory and the repository folder's casing. Both the Diff panel open action and the diff/changed-file context menus go through this resolver. Added regression cases for the Windows fixture from the issue plus POSIX and mixed-separator paths; the new cases fail on main.

Fixes #12902

Model: deepseek-v4.1-flash-cf. Harness: Claude Code.

    1. Closing: farseenmanekhan1232 already has 3 or more open PRs here, which is the limit for contributors who are not vouched.

      Once one of them is merged or closed, open this again. See the open PR limit.

    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. Approvability

      Verdict: Approved at 0368178

      Macroscope's review found this PR approvable — Diff-file navigation now preserves intermediate folders for repositories nested beneath a workspace and retains path casing. The change is confined to file-navigation targets, with existing path-validation safeguards retained.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).

Sign in to join this conversation.