feat(ui): browse another branch in the Repo box #114
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/107-browse-branch"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
In
[6]Repo,enter(orl) on a branch in the Branches tab now shows that branch on the Files tab, starting at the root. The Files breadcrumb reads<branch>:<path>(for exampledevelop:src/ui) on every branch, the default branch included. The pick lasts until the repo changes, which resets Files to the default branch.oopens the entry on the shown branch. This is the PM's option 1 on #107.Changes
forge.TreeReader:ListTree(ctx, r, ref, dir)andReadFile(ctx, r, ref, path). Ref""means the default branch.url.Values-encodedrefquery parameter, omitted when it's empty, sofeature/xora&b#c/dreach the forge intact.forgetest.Fake: tree and file seeding is keyed by ref (SetTreeAt,SetFileAt).SetTreeandSetFileseed the default branch.core.KeygainsPath, and the tree and preview caches are keyed by (repo, ref, path), so one branch's listing is never served for another.details.filesRefholds the chosen branch, whichbrowseBranchsets from the Branches tab, and changing the repo resets it. Tree and preview results for a stale ref are dropped. A pick always refetches the root and shows the cached listing meanwhile. The crumb carries the branch prefix.docs/design.mdrecords the PM's answer, anddocs/architecture.mdshows the newTreeReadersignatures.Decisions
"", not its name, so the default branch has a single cache entry.land right arrow pick too, not onlyenter. They're the same key everywhere in navigation, per the keymap in design.md.<branch>:, matching git'srev:pathnotation.— empty —, until the repo changes or another branch is picked.Test plan
make check: exit 0. That covers format, lint (0 issues), the race suite across all packages, govulncheck, the build, shellcheck plustest-install.sh(25/25) and the Windows vet/build.internal/forge/{gitea,github}/files_ref_test.go(ref on the wire and round-tripped, empty ref sends no parameter, 404/409 → not found,WebURLkept),forgetest/fake_ref_test.go,core/files_ref_test.go(no cross-branch cache hits), andui/files_branch_test.go. The UI tests coverenter/lpicks, the crumb on picked and default branches and while loading, persistence across tabs, boxes and refresh, reset on repo change,oon a branch, stale-result dropping, a sanitized branch name, and a re-pick refetching.Refs #107
🤖 Generated with Claude Code
https://claude.ai/code/session_01WTZrh5vn4LGcjFQzRVp5TY
Enter or l on a branch in the Branches tab shows that branch's tree on the Files tab, starting at the root. The choice holds until the repo changes or another branch is picked. The breadcrumb ends in <branch>:<path> on every branch, the default branch included. forge.TreeReader takes a ref ("" is the default branch) in ListTree and ReadFile. Both adapters send it as a url.Values ref query only when it is set. core keys tree and preview entries by ref and path, so one branch's listing never answers for another's. Results for a branch other than the one shown are dropped. Refs #107 Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WTZrh5vn4LGcjFQzRVp5TY