feat(ui): browse another branch in the Repo box #107

Closed
opened 2026-10-09 11:59:11 -05:00 by deadstyle · 4 comments
Owner

Follow-up to #98 (parts #104, #105, #106).

Problem

The Files tab in [6] Repo browses the default branch only (#106). There's no way to look at the code on another branch.

Acceptance criteria

  • Not yet defined. Direction from the PM: reuse the same mechanics as the Files tab, pointed at a chosen branch (for example, picking a branch on the Branches tab).
  • The PM still has to settle how a branch is chosen and where the current branch shows.

Out of scope

Ahead/behind counts on the Branches tab. The PM doesn't want them.

Follow-up to #98 (parts #104, #105, #106). ## Problem The Files tab in `[6]` Repo browses the default branch only (#106). There's no way to look at the code on another branch. ## Acceptance criteria - Not yet defined. Direction from the PM: reuse the same mechanics as the Files tab, pointed at a chosen branch (for example, picking a branch on the Branches tab). - The PM still has to settle how a branch is chosen and where the current branch shows. ## Out of scope Ahead/behind counts on the Branches tab. The PM doesn't want them.
Author
Owner

🤖 Parked on two product choices; everything else reuses the Files tab as-is.

Decision needed: how a branch is chosen, and where the current branch shows.

  1. Enter on a branch in the Branches tab switches Files to it and jumps to the Files tab. The Files breadcrumb starts with the branch name (main:src/ui). Cost: one extra key press to browse another branch; nothing new to learn.
  2. A separate branch picker key inside Files. Cost: a new key and a new popup the design doesn't have yet.

Either way: the choice lasts until the repo changes or the PM picks another branch; the default branch is what you get on first open; o keeps opening the selected entry on the chosen branch.

Recommendation: 1, because it uses the Branches tab you already have and adds no new key.

Reply with 1, 2 or a change and I'll build it.

🤖 Parked on two product choices; everything else reuses the Files tab as-is. **Decision needed:** how a branch is chosen, and where the current branch shows. 1. Enter on a branch in the Branches tab switches Files to it and jumps to the Files tab. The Files breadcrumb starts with the branch name (`main:src/ui`). Cost: one extra key press to browse another branch; nothing new to learn. 2. A separate branch picker key inside Files. Cost: a new key and a new popup the design doesn't have yet. Either way: the choice lasts until the repo changes or the PM picks another branch; the default branch is what you get on first open; `o` keeps opening the selected entry on the chosen branch. **Recommendation:** 1, because it uses the Branches tab you already have and adds no new key. Reply with 1, 2 or a change and I'll build it.
Author
Owner

🤖 PM answered in session: option 1 (Enter on a branch in the Branches tab).

Acceptance criteria

  • Enter on a branch in the Branches tab of [6] Repo switches the Files tab to that branch and makes Files the active tab.
  • The Files breadcrumb starts with the branch name, as <branch>:<path> (for example develop:src/ui), including on the default branch.
  • On first open of a repo, Files shows the default branch.
  • The chosen branch lasts until the repo changes (then it resets to the default branch) or another branch is picked.
  • o opens the selected Files entry on the chosen branch.
  • Picking a branch starts Files at the repo root.
🤖 PM answered in session: option 1 (Enter on a branch in the Branches tab). ## Acceptance criteria - Enter on a branch in the Branches tab of [6] Repo switches the Files tab to that branch and makes Files the active tab. - The Files breadcrumb starts with the branch name, as `<branch>:<path>` (for example `develop:src/ui`), including on the default branch. - On first open of a repo, Files shows the default branch. - The chosen branch lasts until the repo changes (then it resets to the default branch) or another branch is picked. - `o` opens the selected Files entry on the chosen branch. - Picking a branch starts Files at the repo root.
Author
Owner

🤖 Correction to the earlier note that everything else reuses the Files tab as-is: the forge tree reader (TreeReader.ListTree / ReadFile, internal/forge/forge.go:134) reads the default branch only, with no ref parameter. Browsing another branch needs a ref threaded through the interface, both adapters (internal/forge/gitea/files.go, internal/forge/github/files.go), the test fake, internal/core/files.go and internal/ui. Re-routed from inline to labs:composer. No change to the user-visible behavior agreed above.

🤖 Correction to the earlier note that everything else reuses the Files tab as-is: the forge tree reader (`TreeReader.ListTree` / `ReadFile`, internal/forge/forge.go:134) reads the default branch only, with no ref parameter. Browsing another branch needs a ref threaded through the interface, both adapters (internal/forge/gitea/files.go, internal/forge/github/files.go), the test fake, internal/core/files.go and internal/ui. Re-routed from inline to labs:composer. No change to the user-visible behavior agreed above.
Author
Owner

🤖 merged: #114

🤖 merged: https://git.bobparsons.dev/deadstyle/lazyforge/pulls/114
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
deadstyle/lazyforge#107
No description provided.