feat(git): a labeled repository picker for multi-repo workspaces

A container workspace that discovers several repositories rendered one
chip per root above the Changes section; with location labels the row
does not scale, and same-named checkouts were indistinguishable. The
row is now a compact labeled select: the current root stays on screen,
the full list is one click away, and options carry disambiguation
labels (deeper roots show their relative parent) shared with the
More -> Repository submenu. The picker shows the resolved status root —
a server fallback renders as a disabled stand-in with its own short
label instead of silently selecting the first option. Single-repo
workspaces render no row; switching still goes through chooseRepo.
This commit is contained in:
Sidebar Test authored and Menghuan1918 committed 2026-11-16 00:33:58 +08:00
1 parent 7c374293c7
commit ea770cc2e1
7 files changed
+577 -85

No files matched your search

+20 -27
View File
@@ -59,46 +59,39 @@
@media (hover: none) { .scmActions { opacity: 1; } }
/* Child repositories of a workspace container: every view in this panel is
pinned to ONE root, so the switcher is the only surface that says the others
exist. One band above the sections, one chip per discovered root; it scrolls
sideways rather than wrapping so a deep root list cannot push the changes
away from the top of the pane. */
.repoSwitcher {
pinned to ONE root, so the picker is the only surface that names the current
one and lists the others one click away. A labeled select scales to any
number of discovered roots in a single compact band — a chip per root does
not, once location labels distinguish same-named checkouts. */
.repoPick {
flex: none;
display: flex;
align-items: center;
gap: 4px;
gap: 6px;
min-width: 0;
padding: 0 6px 2px;
overflow-x: auto;
overflow-y: hidden;
scrollbar-width: none;
color: var(--dsw-alias-label-secondary);
font: var(--dsw-font-xxxs-11);
cursor: pointer;
}
.repoSwitcher::-webkit-scrollbar { display: none; }
.repoChip {
flex: none;
max-width: 160px;
min-height: 22px;
padding: 2px 8px;
.repoPickLabel { flex: none; white-space: nowrap; }
.repoPickSelect {
flex: 1;
min-width: 0;
max-width: 100%;
height: 22px;
padding: 0 4px;
border: 1px solid var(--dsw-alias-border-l1);
border-radius: 3px;
background: transparent;
color: var(--dsw-alias-label-secondary);
color: var(--dsw-alias-label-primary);
font: var(--dsw-font-xxxs-11);
text-align: left;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
cursor: pointer;
}
.repoChip:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover); }
.repoChip[data-active='true'] {
border-color: var(--dsw-alias-border-l2);
background: var(--dsw-alias-interactive-bg-hover-accent);
color: var(--dsw-alias-label-primary);
}
.repoChip:disabled { opacity: 0.45; cursor: default; }
.repoChip:focus-visible { outline: 2px solid var(--dsw-alias-interactive-bg-hover-accent); outline-offset: -2px; }
.repoPickSelect:hover:not(:disabled) { border-color: var(--dsw-alias-border-l2); background: var(--dsw-alias-interactive-bg-hover); }
.repoPickSelect:disabled { opacity: 0.45; cursor: default; }
.repoPickSelect:focus-visible { outline: 2px solid var(--dsw-alias-interactive-bg-hover-accent); outline-offset: -2px; }
/* Docked by the flex column above (a sibling of `.gitScroll`), plus sticky so
it also survives the case where the host tab body itself scrolls the whole