Skip to content

Replace toolbar branch button with repo · branch · worktree title#320

Merged
sbertix merged 2 commits into
mainfrom
sbertix/319-toolbar-details
May 14, 2026
Merged

Replace toolbar branch button with repo · branch · worktree title#320
sbertix merged 2 commits into
mainfrom
sbertix/319-toolbar-details

Conversation

@sbertix
Copy link
Copy Markdown
Collaborator

@sbertix sbertix commented May 14, 2026

Summary

  • Replace the toolbar rename-branch popover with a custom title block: repo avatar (or folder glyph) + branch (.callout/.semibold) over a repo · worktree caption whose worktree segment mirrors the sidebar tint (.main → yellow, .pinned → orange, .default → tertiary).
  • Hoist WorktreeAccent + SidebarItemModel.sidebarDisplayName onto the domain model so sidebar and toolbar consume the same source of truth.
  • Model the title as a WorktreeToolbarTitleContent.git(GitPayload) | .folder(name) sum type and pin the toolbar item with .navigation placement + .sharedBackgroundVisibility(.hidden) (placeholder too) so the slot stays stable across worktree switches.
  • Wire the GitHub owner avatar through GitClientDependency and share the resolver between the toolbar and the settings sidebar.
  • Remove the now-unreachable rename-branch chain: requestRenameBranch action + handler, gitClient.renameBranch, GitClient.renameBranch, the branchRename operation, and the two orphan tests.
  • Add unit tests for sidebarDisplayName, accent, and makeToolbarTitleContent covering folder, sole-default, sibling, and customTitle-override paths.

Test plan

  • make build-app is green.
  • Switching between worktrees in different repos doesn't shift the title horizontally.
  • Branch line uses .callout/.semibold; the caption shows repo · worktree (worktree segment hidden for sole-default and when it matches the branch's last component under worktreeRowHideSubtitleOnMatch).
  • Folders show a single-line title (folder name, no caption).
  • Repo avatar renders as a 22pt rounded square; SF Symbol fallback / folder glyph render at ~18pt inside a 24pt slot.
  • Sidebar header colour overrides flow into the toolbar repo name.
  • VoiceOver reads the title as one element ("Branch X in Y, worktree Z" / "Folder Z").

Closes #319

sbertix added 2 commits May 14, 2026 23:47
- Replace the toolbar rename-branch popover with a custom title block:
  repo avatar (or folder glyph) + branch line (.callout/.semibold) over a
  "repo · worktree" caption whose worktree segment mirrors the sidebar's
  main/pinned/default tint via a shared `WorktreeAccent` enum.
- Hoist `WorktreeAccent` and `SidebarItemModel.sidebarDisplayName` onto the
  domain model so both sidebar and toolbar consume one source of truth.
- Model the toolbar title as a `WorktreeToolbarTitleContent.git(GitPayload) | .folder(name)` sum type and place the item with `.navigation` placement + `.sharedBackgroundVisibility(.hidden)` (placeholder too) so the slot stays stable across worktree switches.
- Wire the GitHub owner avatar through `GitClientDependency` and share the resolver between toolbar and settings sidebar; size avatar 22pt rounded with a system-color shadow, pad the SF Symbol fallback to ~18pt to match toolbar imagery.
- Remove the now-unreachable rename-branch chain: `requestRenameBranch` action + handler, `gitClient.renameBranch`, `GitClient.renameBranch`, the `branchRename` operation, and the two orphan tests.
- Add focused unit tests for `sidebarDisplayName`, `accent`, and `makeToolbarTitleContent` covering folder, sole-default, sibling, and customTitle-override paths.
@sbertix sbertix enabled auto-merge (squash) May 14, 2026 21:53
@tuist
Copy link
Copy Markdown

tuist Bot commented May 14, 2026

🛠️ Tuist Run Report 🛠️

Builds 🔨

Scheme Status Duration Commit
supacode 1m 20s 62e4487cf

@sbertix sbertix merged commit 98b4cf1 into main May 14, 2026
2 checks passed
@sbertix sbertix deleted the sbertix/319-toolbar-details branch May 14, 2026 21:58
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.

Feature request: provide more context in title when left sidebar is hidden

1 participant