From 5035a5c392e26bce602bc2fa8c9c6abaaee47cc5 Mon Sep 17 00:00:00 2001 From: Alberto Balbo Date: Mon, 26 Oct 2026 23:23:31 +0100 Subject: [PATCH] fix(admin): draw Settings before the dashboard answers and keep Settings reachable on short windows Settings waited for /server/dashboard (archive statistics, volume space) before it drew, so a large archive or a slow mount kept the whole form empty for About's two rows. The form now draws as soon as /server/settings answers; database and uptime show a dash and fill in when the dashboard answers, without a redraw, so focus and edits stay. They stay off /server/info, which is anonymous. In the wide layout the sidebar never scrolled, so on short windows the docked Settings entry and the account were cut off. The page list above them now scrolls, with room for the focus rings, and the whole sidebar scrolls only when even the docked part does not fit, expanded and collapsed alike; the narrow top bar is unchanged. The bug report form now points at admin panel > Settings > About, since About is no longer a sidebar entry. Co-Authored-By: Claude Opus 5.5 --- .gitea/ISSUE_TEMPLATE/bug_report.yml | 2 +- docs/CHANGELOG.md | 5 ++-- docs/DECISIONS.md | 2 +- src/Chronos.Server/Admin/web/admin.css | 4 +++ .../Admin/web/pages/settings.js | 25 +++++++++++++++---- 5 files changed, 29 insertions(+), 9 deletions(-) diff --git a/.gitea/ISSUE_TEMPLATE/bug_report.yml b/.gitea/ISSUE_TEMPLATE/bug_report.yml index df7bfb86..9ab96d03 100644 --- a/.gitea/ISSUE_TEMPLATE/bug_report.yml +++ b/.gitea/ISSUE_TEMPLATE/bug_report.yml @@ -23,7 +23,7 @@ body: id: version attributes: label: Version - description: "Settings › About shows it (server: admin panel › About, or /api/v1/server/info)." + description: "Settings › About shows it (server: admin panel › Settings › About, or /api/v1/server/info)." placeholder: "0.2.0" validations: required: true diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 908d6ab5..e4cc1b07 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -31,8 +31,9 @@ commits follow Conventional Commits (release notes are generated from them by `C and the Releases link are on Settings › Updates; the data folder and the diagnostics bundle are on Settings › Advanced only (About's own copies of those buttons are gone) (owner review 2, R5). - Admin panel: Settings sits at the foot of the sidebar, above your account (at the end of the top bar on narrow - screens), and About is the last section of Settings, without the server name and certificate fingerprint already - shown above it; old `#/about` links open it there (owner review 2, R4, R5). + screens); on a short window the pages above them scroll instead. About is the last section of Settings, without the + server name and certificate fingerprint already shown above it, and its database and uptime fill in without holding + up the form; old `#/about` links open it there (owner review 2, R4, R5). - The Settings icon is a toothed gear in Chronos, the Uploader and the admin panel; it no longer looks like a sun (owner review 2, R4). diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md index 33df34ef..d1af80f3 100644 --- a/docs/DECISIONS.md +++ b/docs/DECISIONS.md @@ -436,7 +436,7 @@ One line per decision: date · decision · alternative · reason. | 2026-10-26 | The write volume is shown only when its figures differ from the space volume's: another total size, or free space more than 64 MiB apart. (Owner review 2, R2.) | Always show both; compare device ids | Two reads of one volume a moment apart differ by what was written in between; comparing figures also works on Windows. | | 2026-10-26 | Completing a frame upload, a render upload or a render node's result first checks the archive root's volume for the upload's size + 64 MiB and answers 507 `insufficient_storage` with the upload still receiving; a volume that cannot be measured refuses nothing. The start keeps checking `/data` only. (Owner review 2, R2.) | Check only at upload start; fail the upload; check the space path | The staging copy lands on the archive's own volume (on Unraid the share's primary storage, often the cache); refusing before the state change keeps the part file, so the client can complete again once there is room. | | 2026-10-26 | Free space comes from one injectable `VolumeSpace` service (`Server/Storage`, registered with `TryAddSingleton`; tests override `Measure`), also for the `/data` checks at upload start and for the diagnostics report, which lists the archive, the space path and `/data` with free space, file system and mount; the static `UploadRules.FreeBytes` is removed. (Owner review 2, R2.) | Keep a static helper | One source for every check, and tests can simulate a full volume. | -| 2026-10-26 | Admin panel menu in two groups: Dashboard, Users, Archive, Jobs and Logs from the top; Settings docked at the sidebar's foot above the account, or at the end of the top bar on narrow screens. `pages/about.js` is gone: About is the last, read-only group of Settings (version, API version, database, uptime counting on from when it was read), without the server name and certificate fingerprint rows that the Server and Network groups already show. `#/about` opens Settings on that group (focus on its heading) and rewrites the address to `#/settings`. (Owner review 2, R4, R5.) | Keep About as a page; an About dialog from the account box; repeat the name and fingerprint rows in About | One sidebar entry less, as the owner asked. Repeated rows on one page are noise, and the name row was stale after a save. Old bookmarks keep working. | +| 2026-10-26 | Admin panel menu in two groups: Dashboard, Users, Archive, Jobs and Logs from the top; Settings docked at the sidebar's foot above the account, or at the end of the top bar on narrow screens; on a short window only the pages above scroll, so Settings and the account stay in view. `pages/about.js` is gone: About is the last, read-only group of Settings (version, API version, database, uptime counting on from when it was read; the last two fill in when the admin dashboard answers, so the form never waits for its archive statistics, and they stay off the anonymous `/server/info`), without the server name and certificate fingerprint rows that the Server and Network groups already show. `#/about` opens Settings on that group (focus on its heading) and rewrites the address to `#/settings`. (Owner review 2, R4, R5.) | Keep About as a page; an About dialog from the account box; repeat the name and fingerprint rows in About | One sidebar entry less, as the owner asked. Repeated rows on one page are noise, and the name row was stale after a save. Old bookmarks keep working. | | 2026-10-26 | The Settings icon is an 8-tooth gear with a centre hole (outer radius 6.5, valleys on 4.6, teeth 0.6/0.85 half-width at tip/base, hole 1.7), drawn by `gear()` in `branding/ui-icons/icons.py`. The script now also writes the admin panel's `icons.js` (through a name map; the unused `about` icon dropped) and writes every file as UTF-8 with LF on every OS. (Owner review 2, R4.) | 6 teeth (crisper at 16 px but less familiar); wider hollow teeth (they merge at 16 px with 1.5 px strokes); radial stubs on a ring (close to the old sun); keep `icons.js` by hand | 8 narrow teeth close up into solid knobs at 16 px with open gaps, read as the usual settings gear at 20–32 px and stay distinct from Sun. One generator keeps the desktop and web paths identical. On Windows the script wrote `Icons.xaml` in the ANSI code page, garbling its header. | | 2026-10-26 | Desktop About becomes the last Settings page (`SettingsPage.About`); `SectionKey.About` and `AboutView` are gone and the rail keeps Settings alone at the bottom. `AboutViewModel` (now `Chronos.App.About`) stays a view model owned by the shell (`Shell.About`), not a section, so the Updates page's bindings and the update check on start are unchanged. The page shows identity only (version, build, runtime, system, licence, third-party notice, translation notice outside English) and has no Reset section; the Releases link moved to Updates › Latest version; About's own diagnostics bundle and Open data folder buttons are removed (Advanced has both). (Owner review 2, R5.) | Move `UpdateFlow` into `SettingsViewModel`; embed the old AboutView inside Settings; repeat the data folder, diagnostics and update rows on About | Smallest change that keeps every `Shell.About` binding and the update check on start; one place per action avoids duplicates inside Settings, and saving space is what the owner asked for. Nothing navigated to the About section, so no link needed redirecting. | | 2026-10-26 | Import › Folder… *Whole folder* (`ImportGrouping.WholeFolder`) makes one sequence per file format: camera bodies and pauses are ignored, formats are not; only the user's splits break it (the session splitter runs with no gap and a minimum of 1). The title defaults to the folder's name and fills `{title}`; a typed title wins. The plan row shows "Canon EOS R5 · CR3" or "2 cameras · JPEG", and a split part merges back into the part before it of the same format. Switching the grouping clears the user's splits and merges. (Owner review 2, R9.) | One sequence holding every file; one sequence per camera body | A folder shot RAW+JPEG would otherwise hold every instant twice, doubling the time-lapse; formats also decode and render differently. Bodies are ignored because the owner asked for the folder's sequence "in its entirety". | diff --git a/src/Chronos.Server/Admin/web/admin.css b/src/Chronos.Server/Admin/web/admin.css index efd6db11..feba4560 100644 --- a/src/Chronos.Server/Admin/web/admin.css +++ b/src/Chronos.Server/Admin/web/admin.css @@ -80,6 +80,10 @@ h2 { font-size: 14px; font-weight: 600; } .nav a { position: relative; } /* Exactly the widths the narrow layout below leaves (fractional widths at 125 % scaling included). */ @media not all and (max-width: 900px) { + /* Short windows: the pages above scroll, so Settings and the account stay docked in view; the whole sidebar scrolls + only when even those do not fit. The padding keeps the links' focus rings inside the scrolling list. */ + .sidebar, .nav-group:not(.bottom) { overflow-y: auto; scrollbar-width: thin; } + .nav-group:not(.bottom) { flex: 1 1 0; align-content: start; padding: 4px; margin: -4px; } .shell.collapsed { grid-template-columns: 56px minmax(0, 1fr); } .shell.collapsed .sidebar { padding-inline: 8px; } .shell.collapsed .sidebar-toggle { align-self: center; margin-inline-start: 0; } diff --git a/src/Chronos.Server/Admin/web/pages/settings.js b/src/Chronos.Server/Admin/web/pages/settings.js index de8e0933..d5291fbd 100644 --- a/src/Chronos.Server/Admin/web/pages/settings.js +++ b/src/Chronos.Server/Admin/web/pages/settings.js @@ -21,8 +21,10 @@ const MB = 1e6; const MIB = 1024 * 1024; export async function render(root, { api, info, setMeta, actions }) { - // Only the About group's database and uptime: without them those rows show a dash. + // Only the About group's database and uptime, filled in when the dashboard answers: the form never waits for its + // archive statistics, and without them those rows keep a dash. const status = api.get("/api/v1/server/dashboard").then((d) => ({ ...d, at: Date.now() }), () => null); + let dashboard = null; let settings; try { settings = await api.get("/api/v1/server/settings"); @@ -30,7 +32,6 @@ export async function render(root, { api, info, setMeta, actions }) { root.innerHTML = `
${escapeHtml(errorText(err))}
`; return; } - const dashboard = await status; setMeta(""); // In the header, like the other pages' main action, so toasts never cover it. actions.innerHTML = ``; @@ -99,12 +100,11 @@ export async function render(root, { api, info, setMeta, actions }) { * and Network groups above; the uptime counts on from when it was read. */ function about() { - const uptime = dashboard ? formatDuration(dashboard.uptimeSeconds + (Date.now() - dashboard.at) / 1000) : "—"; const rows = [ ["Admin.About.Version", `${escapeHtml(info?.version ?? "—")}`], ["Admin.About.Api", `${escapeHtml(info?.apiVersion ?? "—")}`], - ["Admin.About.Database", `${escapeHtml(dashboard?.database ?? "—")}`], - ["Admin.About.Uptime", escapeHtml(uptime)], + ["Admin.About.Database", `${escapeHtml(database())}`], + ["Admin.About.Uptime", `${escapeHtml(uptime())}`], ]; return `
@@ -114,6 +114,14 @@ export async function render(root, { api, info, setMeta, actions }) {
`; } + function database() { + return dashboard?.database ?? "—"; + } + + function uptime() { + return dashboard ? formatDuration(dashboard.uptimeSeconds + (Date.now() - dashboard.at) / 1000) : "—"; + } + /** The certificate and key files are used only in Own certificate mode; elsewhere they are off and say so. */ function pemFiles(form) { const pem = form.elements.tlsMode.value === "pem"; @@ -174,6 +182,13 @@ export async function render(root, { api, info, setMeta, actions }) { root.querySelector(".about").scrollIntoView({ block: "start" }); root.querySelector("#about-title").focus({ preventScroll: true }); } + // Only the two rows change, so the focus and the form's edits stay; a page left meanwhile is not touched. + status.then((d) => { + dashboard = d; + if (!d || !root.isConnected) return; + root.querySelector("#about-database").textContent = database(); + root.querySelector("#about-uptime").textContent = uptime(); + }); } function cap(s) {