Файли
openidea/src/ui/List.module.css
T
l0ng-ai f4a7a7bafb perf(ui): smoother editor scrolling, tab switching and first file open (#4633)
Removes selectors that restyled whole subtrees on every inserted editor line or focus change (CodeMirror via a pnpm patch; selectorCost.test.ts guards them), measures space width once per font, shares one tooltip host, builds tab menus lazily, caches parsed SVG icons, prewarms an off-screen editor at idle, stats project-tree entries in parallel, and keeps the Git tool window at its size during a live window resize. Verified with full vitest, typecheck, ide-vfs cargo test and clippy, gitLog e2e, and a window resize in the app.
2026-11-20 09:13:29 +08:00

74 рядки
1.8 KiB
CSS

.list {
position: relative;
min-height: 0;
overflow: auto;
outline: none;
/* Rows are controls: a page that opts into text selection must not select them on drag / ⌘A. */
-webkit-user-select: none;
user-select: none;
}
.list::-webkit-scrollbar {
width: 10px;
height: 10px;
}
.list::-webkit-scrollbar-thumb {
background-color: var(--scrollbar-thumb);
border: 2px solid transparent;
border-radius: 5px;
background-clip: content-box;
}
.list::-webkit-scrollbar-thumb:hover {
background-color: var(--scrollbar-thumb-hover);
}
.list::-webkit-scrollbar-track,
.list::-webkit-scrollbar-corner {
background: transparent;
}
.emptyWrap {
display: flex;
align-items: center;
justify-content: center;
color: var(--fg-faint);
}
.sizer {
position: relative;
width: 100%;
}
/* Popup/list rows: selection inset from the edges with Popup.Selection.arc rounding. */
.row,
.section {
position: absolute;
top: 0;
left: var(--list-inset, 6px);
width: calc(100% - 2 * var(--list-inset, 6px));
display: flex;
align-items: center;
}
.row {
gap: var(--space-1-5);
padding: 0 8px;
border-radius: var(--radius-selection, 5px);
color: var(--fg-strong);
white-space: nowrap;
}
.row:hover {
background: var(--bg-tree-hover, color-mix(in srgb, var(--fg-strong) 4%, transparent));
}
.active,
.active:hover {
background: var(--bg-tree-selected);
}
/* A focusable list shows the inactive selection until it holds focus. Not `:not(:focus-within)`:
WebKit then restyles the whole window on every focus change. */
.list[tabindex="0"] .active {
background: var(--bg-tree-selected-inactive);
}
.list[tabindex="0"]:focus-within .active {
background: var(--bg-tree-selected);
}
.section {
padding: 0 8px;
color: var(--fg-muted);
font-size: var(--fs-small);
}