feat(settings): show the running build's version and commit in the admin panel

Nothing in the UI said which build was loaded. /api/version has reported
version, build and source_commit since the harness started versioning itself
apart from the public semver, but the only way to read it was to curl the
endpoint — so "is the preview actually running the commit I just merged?" took
a terminal to answer.

Pins a footer under the settings sidebar nav showing the registered version
(plus the harness build when it differs) and the short source commit, with the
full hash on hover. It sits outside the nav's scroll container so it stays at
the bottom-left, and it is .admin-only, so syncAdminVisibility() hides it from
non-admins the same way it hides the Admin nav group.

The commit resolves at import via `git rev-parse HEAD` and is the string
"unknown" when that fails — a read-only Docker tree with no .git. The footer
treats "unknown" as absent and stays hidden when nothing is left to show,
rather than printing it. The collapsed rail and the two narrow tab-rail
layouts hide it too: neither has a bottom-left to write in.
This commit is contained in:
Léo
2026-09-30 22:59:58 +02:00
parent 741f5dff2b
commit 40678bc466
4 changed files with 358 additions and 2 deletions
@@ -1171,6 +1171,38 @@ details.hwfit-serve-advanced label:has(.hwfit-sf[data-field="vllm_kv_cache_dtype
overflow-y: auto;
overflow-x: hidden;
}
/* Build provenance at the bottom of the sidebar. The nav above it takes the
free space, so this needs no absolute positioning to sit at the bottom.
`[hidden]` needs restating: an author `display` rule outranks the UA
stylesheet's [hidden] rule, so the attribute alone would not hide it. */
.settings-sidebar-build {
display: flex;
min-width: 0;
flex: 0 0 auto;
flex-direction: column;
gap: 1px;
margin-top: 8px;
padding: 4px 12px 2px;
border-top: 1px solid var(--border);
font-size: 9px;
color: color-mix(in srgb, var(--fg) 45%, transparent);
}
.settings-sidebar-build[hidden] {
display: none;
}
/* Same treatment as the "Admin" group label this sits under. */
.settings-sidebar-build-version {
font-weight: 600;
letter-spacing: 1px;
text-transform: uppercase;
}
.settings-sidebar-build-commit {
overflow: hidden;
font-variant-numeric: tabular-nums;
text-overflow: ellipsis;
white-space: nowrap;
opacity: 0.75;
}
.settings-nav-search-wrap {
position: relative;
margin: 0 0 8px;
@@ -1326,6 +1358,9 @@ body.settings-sidebar-resize-active {
.settings-sidebar.settings-sidebar-collapsed .settings-sidebar-content {
display: none;
}
.settings-sidebar.settings-sidebar-collapsed .settings-sidebar-build {
display: none;
}
.settings-sidebar.settings-sidebar-collapsed .settings-sidebar-resize-handle {
display: none;
}
@@ -1356,7 +1391,8 @@ body.settings-sidebar-resize-active {
.settings-nav-search-wrap,
.settings-sidebar-resize-handle,
.settings-sidebar-toggle {
.settings-sidebar-toggle,
.settings-sidebar-build {
display: none;
}
@@ -1384,7 +1420,8 @@ body.settings-sidebar-resize-active {
.settings-nav-search-wrap,
.settings-sidebar-resize-handle,
.settings-sidebar-toggle {
.settings-sidebar-toggle,
.settings-sidebar-build {
display: none;
}
}