Skip to content

File Explorer follows a file opened at a commit to the same path at HEAD - #674

Merged
danbarua merged 1 commit into
mainfrom
follow-commit-file
Oct 13, 2026
Merged

danbarua merged 1 commit into
mainfrom
follow-commit-file

Conversation

@danbarua

Copy link
Copy Markdown
Owner

Problem

#673 made File Explorer open the folders above the open file, but only when the open file's address is in the tree at HEAD (/workspace/{slug}/file/{path}). A commit's changed files and the graph's file nodes open a file as it was at that commit (/workspace/{slug}/commit/{id}/file/{path}). File Explorer had no row for that address, so its folders stayed closed. #673's test opened the HEAD address directly, so it did not catch this.

Change

  • API. A file read at a commit links the same path at HEAD as head, when the tree at HEAD holds a file there. A file read at HEAD has no head link.
  • File Explorer. It follows the open file's head link: it opens that path's folders and marks its row with the box. A file open at HEAD is followed as before.

Controls

  • A file HEAD no longer holds, such as one deleted later, has no head link, so File Explorer opens no folders and marks no row.
  • The marked row is the HEAD file. File Explorer marks the file at HEAD, while the centre shows the file as it was at the commit.

Verification

  • bun run check: exit 0, 1105 pass, 0 fail.
  • bun run e2e with E2E_PORT_API=9019 E2E_PORT_DEV=8970 E2E_PORT_BUILT=8971: 175 passed, 11 skipped (the dev-only tests, in the built bundle).
  • Unit test (tests/git-api.test.ts): src/a.ts at the first commit links head to /workspace/alpha/file/src/a.ts. data/blob.bin at the first commit, dropped later, has no head link. src/a.ts read at HEAD has no head link.
  • e2e (dev server and built bundle): with File Explorer and Source Explorer open, opening the commit "Change a, plan the work" and clicking its changed file notes/plan.md opens the commit's version (/commit/{id}/file/notes/plan.md). It also opens notes in File Explorer, and marks plan.md.

Linked issues

None. Follows #673.

🤖 Generated with Claude Code

A commit's changed files and the graph's file nodes open a file as it
was at that commit, which File Explorer, showing HEAD, had no row for:
its folders stayed closed. A file read at a commit now links the same
path at HEAD as head when HEAD holds a file there; File Explorer opens
that path's folders and marks its row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the area:web The web app and shared UI: app-web, ui, design, records, view-model, acp-client label Oct 12, 2026
@danbarua
danbarua merged commit 2b26be5 into main Oct 13, 2026
10 checks passed
@danbarua
danbarua deleted the follow-commit-file branch October 13, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:web The web app and shared UI: app-web, ui, design, records, view-model, acp-client

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant