Skip to content

Fix hardcoded "behind main" label to use configured baseBranch#77

Merged
0101 merged 2 commits into
mainfrom
fix-behind-label
May 29, 2026
Merged

Fix hardcoded "behind main" label to use configured baseBranch#77
0101 merged 2 commits into
mainfrom
fix-behind-label

Conversation

@0101

@0101 0101 commented May 29, 2026

Copy link
Copy Markdown
Owner

Problem

The worktree card UI hardcodes "main" in the "X behind main" label and the sync button tooltip. While the behind count is correctly calculated against the configured baseBranch, the label always says "main" — even when the repo's base branch is something else (e.g. develop).

Fix

Thread baseBranch: string from RepoModel.BaseBranch through the card rendering pipeline in src/Client/App.fs:

  • mainBehindIndicator — displays "{count} behind {baseBranch}" instead of hardcoded "main"
  • syncButton — tooltip shows "Sync with {baseBranch} (S)" instead of "Sync with main (S)"
  • mainBehindWithSync — passes baseBranch to the two functions above
  • compactWorktreeCard / worktreeCard — accept and forward baseBranch
  • renderCard — accepts baseBranch and passes it to both card variants
  • repoSection call site — passes repo.BaseBranch into renderCard

No new types or server changes needed — RepoModel already carries BaseBranch from the server's .treemon.json config (defaulting to "main").

Tests

  • dotnet build src/Client/Client.fsproj — passes
  • dotnet build src/Server/Server.fsproj — passes
  • Repos with default "main" still show "behind main" (no visual regression)

0101 added 2 commits May 29, 2026 15:00
Thread baseBranch parameter from RepoModel through renderCard,
worktreeCard, compactWorktreeCard, mainBehindWithSync, syncButton,
and mainBehindIndicator so the UI displays the actual configured
base branch name instead of always showing 'main'.
Tests now assert on ' behind ' pattern instead of 'behind main',
matching the new dynamic baseBranch label.
@0101 0101 merged commit cb4aafa into main May 29, 2026
1 check passed
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