Branch menu UI and remote branch checkout

Add UI improvements and switching state for branch menu and implement remote-branch-aware checkout logic.

Frontend: add CSS for disabled branch items, compact branch name layout, subtitles and messages; show switching indicator and disable branch actions while switching; display local/remote names and remote subtitles; surface branch switch errors and in-progress messages. Add state.branches.switchingTo and update event handlers to set/clear it.

Backend (tauri): extend LocalRepoBranch with is_remote, remote_name, local_name; add git_ref_exists helper; enhance checkout_branch to detect local vs remote refs and automatically checkout or create tracking branches for remotes; parse refs to include remote branches (skip ones with existing local counterparts) and sort branches with current/local/remote order. Minor formatting tweaks.
This commit is contained in:
2026-05-14 17:45:35 +12:00
parent 22dafdd5b6
commit 4e6d665c59
4 changed files with 162 additions and 20 deletions
+29
View File
@@ -674,6 +674,11 @@
font-size: 13px;
}
.branch-menu-item:disabled {
cursor: default;
opacity: 0.72;
}
.branch-menu-item.active {
background: var(--accent-subtle);
color: var(--accent);
@@ -685,11 +690,35 @@
border-color: transparent;
}
.branch-menu-item:disabled:hover {
background: transparent;
}
.branch-menu-name {
min-width: 0;
display: flex;
flex-direction: column;
gap: 2px;
}
.branch-menu-name > span {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.branch-menu-subtitle,
.branch-current-mark {
color: var(--text-muted);
font-size: 11px;
}
.branch-menu-message {
padding: 6px 8px;
color: var(--text-muted);
font-size: 12px;
}
.danger-subtle {
color: var(--danger);
}