Files
openidea/src/ui/Tree.module.css
T
l0ng-ai a3fe841e37 fix(ui): merge adjacent selected tree rows into one block (#1486)
Each selected row kept its own rounded corners, so a contiguous
multi-selection showed notches between rows. Rows whose neighbour is
also selected now drop the radius on that side.
2026-11-05 14:58:12 +08:00

167 lines
3.3 KiB
CSS

.wrap {
position: relative;
display: flex;
flex-direction: column;
min-height: 0;
height: 100%;
}
/* Tree.border 4,12,4,12 minus the island padding; rows are inset so the rounded selection floats. */
.tree {
flex: 1;
min-height: 0;
overflow: auto;
outline: none;
padding: 0 var(--tree-inset, 6px);
}
.tree::-webkit-scrollbar {
width: 10px;
height: 10px;
}
.tree::-webkit-scrollbar-thumb {
background-color: var(--scrollbar-thumb);
border: 2px solid transparent;
border-radius: 5px;
background-clip: content-box;
}
.tree::-webkit-scrollbar-thumb:hover {
background-color: var(--scrollbar-thumb-hover);
}
.tree::-webkit-scrollbar-track,
.tree::-webkit-scrollbar-corner {
background: transparent;
}
.emptyWrap {
display: flex;
align-items: center;
justify-content: center;
color: var(--fg-faint);
}
.sizer {
position: relative;
width: 100%;
}
.row {
position: absolute;
top: 0;
left: 0;
width: 100%;
display: flex;
align-items: center;
gap: 4px;
padding-right: 8px;
border-radius: var(--radius-selection, 5px);
color: var(--fg-strong);
white-space: nowrap;
}
/* At least the visible width so the selection covers it; wider rows overflow the sizer. */
.wideRow {
width: max-content;
min-width: 100%;
}
.contentWidth {
position: absolute;
top: 0;
left: 0;
height: 1px;
pointer-events: none;
}
.row:hover {
background: var(--bg-tree-hover, color-mix(in srgb, var(--fg-strong) 4%, transparent));
}
/* Tree.selectionInactiveBackground when unfocused, selectionBackground when focused. */
.selected,
.selected:hover {
background: var(--bg-tree-selected-inactive);
}
.tree:focus .selected,
.tree:focus-within .selected {
background: var(--bg-tree-selected);
}
/* Adjacent selected rows merge into one rounded block. */
.joinPrev {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.joinNext {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.tree:focus-visible .lead:not(.selected) {
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--focus-ring) 50%, transparent);
}
.loading {
color: var(--fg-faint);
}
.before::before,
.after::after {
content: "";
position: absolute;
left: 0;
right: 0;
height: 2px;
background: var(--focus-ring);
pointer-events: none;
z-index: 1;
}
.before::before {
top: 0;
}
.after::after {
bottom: 0;
}
.chevron {
flex: none;
width: 16px;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
color: var(--fg-muted);
}
.icon {
flex: none;
margin-right: 2px;
color: var(--fg-muted);
}
.label {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
}
.detail {
min-width: 0;
margin-left: 4px;
overflow: hidden;
text-overflow: ellipsis;
color: var(--fg-muted);
}
/* SpeedSearch popup above the tree. */
.speedSearch {
position: absolute;
top: 0;
left: 8px;
z-index: var(--z-panel);
display: flex;
align-items: center;
gap: 6px;
height: 26px;
max-width: calc(100% - 16px);
padding: 0 10px 0 8px;
border-radius: var(--radius-control, 4px);
background: var(--bg-popup);
border: 1px solid var(--border-popup);
box-shadow: var(--shadow-popup);
color: var(--fg-muted);
font-size: var(--fs-ui);
pointer-events: none;
}
.speedQuery {
color: var(--fg-strong);
overflow: hidden;
text-overflow: ellipsis;
white-space: pre;
}
.noMatch .speedQuery {
color: var(--danger);
}