define a legible :Forge master workflow around root + local git pickers #87
Labels
No labels
bug
documentation
duplicate
enhancement
fugitive
good first issue
help wanted
invalid
question
v0.1.0
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
barrettruth/forge.nvim#87
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Canonical issue
This is the canonical issue for the
:Forgemaster workflow / home-surface lane.It supersedes the earlier rougher threads in:
master pickerscope a picker-agnostic master workflow for :ForgeIt is adjacent to, but intentionally separate from:
closer git integration/pr viewer#63 is specifically about first-class PR review. This issue is about the
:Forgeentry point itself and the local git workflows surfaced there, especiallybranches,commits, andworktrees.Thesis
forge.nvimshould treat:Forgeas a legible workflow surface, not just a route dispatcher.Today the plugin already has the pieces for a strong top-level git + forge workflow, but the current presentation does not make that clear. The practical result is that the user can open
:Forge, seeIssues,Branches,Commits, andWorktrees, and still not really understand:That makes the top-level workflow feel thinner and more accidental than it really is.
Philosophy
1. Legibility at the point of entry
The root
:Forgepicker should communicate intent before the user opens a nested picker.A user should not need to inspect source, help docs, or trial-and-error keypresses to understand what
Branches,Commits, andWorktreesare for.2. Local git workflows are first-class, not filler
branches,commits, andworktreesshould feel like core parts of forge.nvim's workflow model, not just incidental utility lists attached to a forge plugin.If forge.nvim is a “forge-agnostic git workflow for Neovim”, then local git views belong near the center of the product story.
3. Picker backend should be an implementation detail
Users should not have to mentally model
fzf-luavssnacksvstelescopejust to understand the workflow. Backend differences matter, but the conceptual workflow should be stable across them.4. Shell-outs should be discoverable, not magical
The plugin should not feel like a black box. It is good for advanced users to be able to answer:
That does not necessarily mean every command must be shown in the UI, but the mapping should exist somewhere explicit.
5. Do not jump to a bespoke picker before the design pressure is real
A first-party picker or UI may eventually be the right move, but the immediate problem is not “we need our own picker tech.”
The immediate problem is that the existing workflow is under-explained and under-shaped at the top, while local git sections are lighter than the more mature PR/issue/CI flows.
Verified current architecture
The current flow is roughly:
plugin/forge.luadefines:Forgeand the<Plug>launchersrequire('forge').open()resolves intolua/forge/routes.luaroutes.open()either:lua/forge/pickers.lualua/forge/picker/fzf.lualua/forge/picker/snacks.lualua/forge/picker/telescope.luaImportant structural detail:
clientabstraction (lua/forge/client.lua)pickerabstraction (lua/forge/picker/init.lua)So there is already a seam for a richer top-level workflow, but it currently only exists at the root.
Verified default root model
Current root section order:
prsissuescibranchescommitsworktreesbrowsereleasesCurrent default route aliases:
prs->prs.openissues->issues.openci->ci.current_branchbrowse->browse.contextualreleases->releases.allbranches->branches.localcommits->commits.current_branchworktrees->worktrees.listAt the moment, the root entries are essentially plain labels.
That means the root is functionally a route launcher more than a workflow surface.
Verified command surface
For a GitHub repository like this one, the current implementation shells out to commands such as:
Context and detection
git rev-parse --show-toplevelgit branch --show-currentgit rev-parse HEADgit remote get-url originIssues
gh issue list --limit <n> --state <state> --json ...PRs
gh pr list --limit <n> --state <state> --json ...Branches
List:
git for-each-ref --format=... refs/headsActions:
git switch <branch>Commits
List:
git log --max-count=100 --format=... <branch>Actions:
git show --stat --patch --decorate=short <sha>Worktrees
List:
git worktree list --porcelainActions:
PR worktree creation
git fetch origin pull/<num>/head:pr-<num>git worktree add ../pr-<num> pr-<num>Equivalent forge-specific command implementations also exist for GitLab (
glab) and Codeberg/Gitea/Forgejo (tea).Verified backend support
Current built-in picker backends:
fzf-luasnacks.nvimtelescope.nvimAll three currently support the essentials needed for this workflow work:
Notable differences today:
fzf-luahas the richest header/action-hint treatmentsnacksandtelescopepreserve highlighted rows but do not get the same header UXclientextension point, but not an equivalent public picker-backend registration APIThe real problem statement
The core problem is not just that the root picker is visually sparse.
The deeper problem is that the current workflow does not sufficiently explain itself.
Symptoms
clientandpickerabstractions is not reflected in the UX or documentation storyResulting user confusion
A user can reasonably ask:
That is the confusion this issue should resolve.
What the first concrete implementation should actually be
The first implementation milestone should not be “build a whole new picker system.”
The first real milestone should be:
:Forgepicker legiblebranchescommitsworktreesThat is the smallest change set that actually answers the product question.
What “make the root legible” means
It means that from the root picker alone, the user should be able to infer what opening a section will do.
Instead of plain entries like:
BranchesCommitsWorktreeswe should be able to render richer backend-agnostic entries such as:
Brancheslocal refs · git switch · browse branchCommitscurrent branch history · git show · browse commitWorktreesrepo worktrees · switch cwd · copy pathThis can be done with segmented display data and existing highlight groups; no picker backend rewrite is required to start here.
Proposed UX scope
Root
:ForgepickerGoals:
Potential data points for each root entry:
This does not require exposing raw shell commands in the root list, but the displayed copy should make the workflow obvious.
Branches picker
Goals:
Potential improvements:
Commits picker
Goals:
git showfeel intentional rather than incidentalPotential improvements:
Worktrees picker
Goals:
Potential improvements:
Proposed deliverables
:Forgemaster workflowfzf-lua,snacks, andtelescope