feat(git): show every child repository in the Git panel with a visible switcher
A container workspace (a project directory that is not itself a repository) can hold several independent repositories. Discovery and `git.status` already report all of them; the panel listed them only in the "more actions -> repository" submenu, so nothing on screen said the others existed and the body silently rendered repositories[0]. Render one chip per discovered root above the Changes section, mark the root the panel is pinned to, and switch through the existing chooseRepo so reads, mutations and the commit graph follow the selection. A single repository workspace renders no row; the menu entry stays.
This commit is contained in:
1 parent
bd6cfa55b4
commit
f49bad2279
5 files changed
+185
No files matched your search
@@ -60,6 +60,48 @@
|
||||
.scmHeader:hover .scmActions, .scmHeader:focus-within .scmActions { opacity: 1; }
|
||||
@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 {
|
||||
flex: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
min-width: 0;
|
||||
padding: 0 6px 2px;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
.repoSwitcher::-webkit-scrollbar { display: none; }
|
||||
.repoChip {
|
||||
flex: none;
|
||||
max-width: 160px;
|
||||
min-height: 22px;
|
||||
padding: 2px 8px;
|
||||
border: 1px solid var(--dsw-alias-border-l1);
|
||||
border-radius: 3px;
|
||||
background: transparent;
|
||||
color: var(--dsw-alias-label-secondary);
|
||||
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; }
|
||||
|
||||
/* 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
|
||||
tab — the branch control must never leave the bottom of the pane.
|
||||
|
||||
Reference in new issue
Block a user