Files
lucisv/editors/vscode/media/hierarchy.css
T
Guoliang ChenandClaude Mythos 5.2 e9f5090632
ci / checks (push) Successful in 52s
ci / corpus (push) Successful in 15s
release / build-and-publish (push) Successful in 4m59s
Release 0.65.2: the Hierarchy pane shows where you are
TODO §71.6. The rows leading to the file being edited are lit in the
extension's Hierarchy pane: every instance of the module the open file
declares in a light, bright orange with a solid bar and a bold label, each
ancestor a shade dimmer with a narrower bar, down to a floor. A pure module
(hierarchyCurrent.js) computes each module's distance with one breadth-first
search up the instantiation graph; the webview repaints only the rows whose
level changed, with no server request and no tree rebuild. Six theme colours
under contributes.colors and the setting lucisv.hierarchy.highlightCurrent.
hierarchyPalette_test.js computes label contrast (>= 4.5:1 on every level,
six built-in themes) and neighbour distinctness from the shipped defaults.

Dev, QA (pass with findings, one fix round) and lead review are in
docs/features/hierarchy-current-path/README.md. Not seen in a running editor.

Version bump (Cargo.toml, Cargo.lock, editors/vscode/package.json and both
package-lock.json spots); notes in CHANGELOG.md (## 0.65.2) and
editors/vscode/CHANGELOG.md.

Gates: tools/gates.sh PASS on this tree (20261119-043114), node 12/0.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
2026-11-19 04:32:43 -08:00

105 lines
5.0 KiB
CSS

:root { color-scheme: light dark; }
* { box-sizing: border-box; }
body {
margin: 0;
padding: 0;
color: var(--vscode-foreground);
background: var(--vscode-sideBar-background);
font: var(--vscode-font-weight) var(--vscode-font-size)/1.4 var(--vscode-font-family);
overflow: hidden auto;
}
.search-wrap {
position: sticky;
top: 0;
z-index: 3;
padding: 6px 8px;
background: var(--vscode-sideBar-background);
}
#search {
width: 100%;
height: 26px;
padding: 2px 7px;
color: var(--vscode-input-foreground);
background: var(--vscode-input-background);
border: 1px solid var(--vscode-input-border, transparent);
outline: none;
}
#search:focus { border-color: var(--vscode-focusBorder); }
#status { padding: 8px 10px; color: var(--vscode-descriptionForeground); }
#status.error { color: var(--vscode-errorForeground); }
#tree, #results { padding-bottom: 8px; }
#more { padding: 4px 10px 10px; color: var(--vscode-descriptionForeground); }
.row {
--indent: calc(var(--depth) * 12px);
width: 100%;
min-height: 22px;
display: flex;
align-items: center;
gap: 4px;
padding: 1px 8px 1px calc(4px + var(--indent));
border: 1px solid transparent;
color: inherit;
background: transparent;
font: inherit;
text-align: left;
cursor: default;
}
.row:hover { background: var(--vscode-list-hoverBackground); }
.row:focus { outline: 1px solid var(--vscode-list-focusOutline, var(--vscode-focusBorder)); outline-offset: -1px; }
.row.match .label { font-weight: 600; }
.row.bookmarked {
background: color-mix(in srgb, var(--vscode-charts-yellow, #cca700) 35%, transparent);
border-color: var(--vscode-charts-yellow, #cca700);
}
.row.warning .detail { color: var(--vscode-list-warningForeground, var(--vscode-editorWarning-foreground)); }
/* A DUT section header: the pane's one structural row, so it reads as a
heading rather than as another module. */
.row.section {
position: sticky;
top: 38px;
z-index: 2;
background: var(--vscode-sideBarSectionHeader-background, var(--vscode-sideBar-background));
font-weight: 700;
}
/* The path to the active file (docs/features/hierarchy-current-path).
Two layers, both background *images* so they sit over whatever colour the
row already has — hover, a sticky section header — instead of replacing it:
- a translucent tint, kept light enough that the label stays >= 4.5:1 at
every level (hierarchyPalette_test.js measures the defaults);
- a bar at the left edge, which carries "brightest": solid, 4px and fully
opaque on the current row, then narrower, fainter and finally dashed each
level up. Width and style are the cue that is not colour.
A bookmark is the user's own explicit mark: it keeps its yellow fill and
border and drops the tint, and the bar stays to say the row is also current.
The var() fallbacks are the dark defaults, for a host without the colours. */
.row[data-lit] {
--bar: color-mix(in srgb, var(--vscode-lucisv-hierarchyCurrentBar, #ffb347) var(--bar-alpha), transparent);
--bar-solid: linear-gradient(var(--bar), var(--bar));
--bar-dashed: repeating-linear-gradient(to bottom, var(--bar) 0 3px, transparent 3px 5px);
background-image: var(--bar-image), linear-gradient(var(--lit), var(--lit));
background-size: var(--bar-width) 100%, 100% 100%;
background-repeat: no-repeat;
}
.row[data-lit="0"] { --lit: var(--vscode-lucisv-hierarchyCurrent, #ffb34745); --bar-width: 4px; --bar-alpha: 100%; --bar-image: var(--bar-solid); }
.row[data-lit="1"] { --lit: var(--vscode-lucisv-hierarchyParent1, #ffb34730); --bar-width: 3px; --bar-alpha: 80%; --bar-image: var(--bar-solid); }
.row[data-lit="2"] { --lit: var(--vscode-lucisv-hierarchyParent2, #ffb34721); --bar-width: 2px; --bar-alpha: 65%; --bar-image: var(--bar-solid); }
.row[data-lit="3"] { --lit: var(--vscode-lucisv-hierarchyParent3, #ffb34716); --bar-width: 2px; --bar-alpha: 55%; --bar-image: var(--bar-dashed); }
.row[data-lit="4"] { --lit: var(--vscode-lucisv-hierarchyAncestor, #ffb3470d); --bar-width: 1px; --bar-alpha: 45%; --bar-image: var(--bar-dashed); }
.row[data-lit="0"] .label { font-weight: 600; }
.row.bookmarked[data-lit] { background-image: var(--bar-image); background-size: var(--bar-width) 100%; }
/* High contrast: the current row also gets the theme's active border — unless
it is bookmarked, whose border is the bookmark's. */
body.vscode-high-contrast .row[data-lit="0"]:not(.bookmarked),
body.vscode-high-contrast-light .row[data-lit="0"]:not(.bookmarked) {
border-color: var(--vscode-contrastActiveBorder, var(--vscode-focusBorder));
}
[hidden] { display: none !important; }
@media (forced-colors: active) {
.row.bookmarked { outline: 2px solid Highlight; }
/* Forced colours drop every background image, so the tint and the bar are
gone and levels 1-4 have no cue here. The current row keeps a dashed
*border* (and its bold label) — a border, not an outline, so the focus
ring and the bookmark outline stay its own. */
.row[data-lit="0"] { border-style: dashed; border-color: CanvasText; }
}