Skip to content

Commit details: point each branch at its upstream, one colour per branch in the log and card - #861

Open
Havunen wants to merge 12 commits into
devfrom
feat/commit-header-badges
Open

Havunen wants to merge 12 commits into
devfrom
feat/commit-header-badges

Conversation

@Havunen

@Havunen Havunen commented Dec 3, 2026

Copy link
Copy Markdown
Member

The commit card's ref badges did not show which upstream a branch tracks, hid the default branch behind "+N", and wore colours that differed from the log and the sidebar.

Commit details card

  • Branch → upstream pairs. Each local branch is followed by an arrow and the remote branch it tracks, in the branch's colour. The checked-out pair comes first, then a remote's default branch. An upstream shared by several branches follows each of them.
  • Upstream on another commit. It still follows its branch, as a muted chip. The ahead/behind counts sit on the local branch's badge, as on its log chip.
  • No upstream. A branch with none gets a "No upstream" chip that opens the action bar's upstream picker for that branch. The chip is hidden when the repository has no remote. The picker now works on any local branch, not only the checked-out one.
  • "+N" expands to list every ref with its upstream; "Show less" folds it back.
  • Layout. A pair wraps as one and takes its own line before either name is cut. On a line too narrow for it, both names give way together. "No upstream" is never cut.
  • Remote badges show the cloud icon, and every chip on the card shares one fill.
  • Tags. The card redraws when only tags change.
  • An upstream that is not a listed remote branch (a local branch via remote ., or a bare URL) gets no badge: that badge's menu acts on a remote branch.

Log graph

From a branch's tip downward, the lane, node and chip take that branch's colour; above the tip, what continues from it keeps its own. Before, a tip took another branch's colour wherever it opened no lane of its own:

  • where the lanes of branches forked from it converge on it,
  • on the checked-out branch's lane (for example origin/main under a feature branch),
  • in current-branch scopes, which draw one lane.

A branch now has one colour in the log, the commit card and the sidebar. The cherry-pick dialog draws its commits with the same graph and follows the rule too.

Validation

  • cargo test -p gitcomet-ui-gpui --lib: 4456 passed, 0 failed.
  • cargo clippy -p gitcomet-ui-gpui --all-targets --all-features: only the warning already on dev (text_fixtures.rs:127).
  • cargo fmt --all -- --check.
  • Each new or changed test was shown to fail with its code broken.
  • Screenshots taken on a private Xvfb display: dark and light, 280/300/340 px and default pane widths, 200% zoom, hover, keyboard focus, the branch menus and the upstream picker.

Not rebased onto #851, which only adds tests to gitcomet-git-gix and touches no file changed here.

🤖 Generated with Claude Code

Havunen and others added 12 commits December 3, 2026 07:53
The commit card's branch badges take their branch's lane colour, as the
log's ref chips and the sidebar's worktree badges do, instead of tinting
only the checked-out branch with the accent. Remote branch badges show
the log's cloud icon. The lane-to-chip colours live in one helper the
log, the sidebar and the card share, and the branch colour cache moves
next to it so the details pane can hold one too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Four local branches on a commit used to fill the commit card's badges
and push the remote's default branch behind "+N". Each local branch is
now followed by its upstream when that points at the same commit, the
checked-out branch's pair comes first and any remote's default branch
next, and the cap hides whole groups from the first that does not fit.
The details pane repaints when remote branches or remotes change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A local branch on the commit card with no upstream is followed by a
"No upstream" chip, as the action bar's upstream badge reads, whose
chevron opens the upstream picker for that branch. The chip shows only
while the repository has a remote to pick from, and "+N" counts hidden
refs, not these chips. The picker and its set-only prompt now act on
any local branch that still exists rather than only the checked-out
one; the picker already names the branch it changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The upstream picker's kind, the remote default branch lookup and the
commit card's empty companion still described the behaviour before the
picker took any local branch and the card ranked by default branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A branch and the upstream or "No upstream" chip after it wrap onto a
line together, so a narrow details pane never splits a pair. The rule
between the parents and the refs sits in the gap before the first
group, out of the flow, so it shows only beside the parents and never
ends or starts a line. Every chip on the card shares the lane chips'
surface, so a light theme no longer mixes two fills in one row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When a commit holds more refs than the card shows, "+N" now opens them
all, each branch with its upstream or "No upstream" chip, and "Show
less" folds them back. The unfolded commit is remembered by id, so
another selection starts folded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Packed at the badge minimum, "No upstream" beside the parent chip was
cut to "No upst…". It now packs whole and never shrinks; a group alone
on a line too narrow for it lets the branch name give way instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The details pane's notify fingerprint skipped tags_rev, so a tag made
or deleted on the shown commit left its card stale.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A branch and its upstream were two adjacent badges, the upstream in the
colour of the branch named like it, and an upstream shared by several
branches followed only the first. Each branch is now followed by an
arrow and its own upstream badge in the branch's colour; an upstream on
another commit shows muted with how far the branch is ahead and behind.
A pair takes its own line before either name is cut, and the branch's
name gives way first.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A branch tracking a local branch (remote ".") or a bare URL got an
upstream badge whose remote-branch menu could delete the local branch.
Such a branch now stands alone.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A branch's chip, node and lane took another branch's colour where its
tip opened no lane of its own: where the lanes of branches forked from
it converge, on the checked-out branch's lane, and in current-branch
scopes. From a branch's tip down the lane is now that branch's colour,
as its badges are everywhere else; above the tip, what continues from
it keeps its own.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The counts sat on the muted upstream badge, though it is the local
branch that is ahead or behind; they move to the branch's badge, as on
its log chip. On a line too narrow for a pair, a long upstream left the
branch without its name; both now give way together, each by its share.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant