From b76e2a44dfa4b1ea71b42d2f89d44406fbd508f9 Mon Sep 17 00:00:00 2001 From: zurdi Date: Thu, 17 Sep 2026 16:32:14 +0200 Subject: [PATCH] feat(v2): even out the top-bar pills and stream the scan progress - The scan indicator, the now-playing pill and the user menu trigger share a new `--r-nav-pill-h` layout token, so the three pills line up at the same height. - The scan indicator drops its spinner; its bottom progress bar carries the activity instead, with a glow streaming along the unfilled track while the scan runs. The glow is a new `stream` mode on RProgressLinear. - On portrait phones the now-playing title is capped narrower and loops, so the pill no longer crowds the bar; landscape keeps the wider title. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01S76JZm1jjh32KhBbPCBvGW --- frontend/scripts/build-tokens.ts | 1 + .../components/AppShell/ScanningIndicator.vue | 24 +++++----- .../src/v2/components/AppShell/UserMenu.vue | 2 +- .../components/Soundtrack/NowPlayingPill.vue | 9 +++- .../RProgressLinear.stories.ts | 17 +++++++ .../RProgressLinear/RProgressLinear.vue | 48 ++++++++++++++++++- frontend/src/v2/styles/tokens.css | 1 + frontend/src/v2/tokens/index.ts | 5 +- 8 files changed, 90 insertions(+), 17 deletions(-) diff --git a/frontend/scripts/build-tokens.ts b/frontend/scripts/build-tokens.ts index 20de15c62..14b801a90 100644 --- a/frontend/scripts/build-tokens.ts +++ b/frontend/scripts/build-tokens.ts @@ -50,6 +50,7 @@ const NAME_OVERRIDES = { space: { rowPad: "--r-row-pad" }, layout: { navHeight: "--r-nav-h", + navPillHeight: "--r-nav-pill-h", bottomNavHeight: "--r-bottom-nav-h", bottomNavMaxWidth: "--r-bottom-nav-max-w", touchTarget: "--r-touch-target", diff --git a/frontend/src/v2/components/AppShell/ScanningIndicator.vue b/frontend/src/v2/components/AppShell/ScanningIndicator.vue index 6d0fec8a0..e79f2d35c 100644 --- a/frontend/src/v2/components/AppShell/ScanningIndicator.vue +++ b/frontend/src/v2/components/AppShell/ScanningIndicator.vue @@ -2,20 +2,18 @@ // ScanningIndicator — live status pill that appears in the AppNav // right cluster whenever a library scan is in progress. // -// Three signals stack inside the pill: -// * a spinner on the leading edge for "something is happening", +// Two signals stack inside the pill: // * a counter (scanned / total when known, scanned-only as soon // as the backend has reported a total ≥ scanned), // * a thin progress bar pinned to the bottom edge — determinate -// when `total_roms` is known, indeterminate otherwise (the -// scanner discovers files as it goes, so totals show up after -// the first platform finishes). +// with a glow streaming ahead of the fill when `total_roms` is +// known, indeterminate otherwise (the scanner discovers files as +// it goes, so totals show up after the first platform finishes). // // Click jumps to /scan so the user can inspect the live log. -// Hidden on /scan itself. Honours `prefers-reduced-motion` by -// dropping the shimmer + pulse animations; the spinner + progress -// bar keep moving since they communicate live data, not affect. -import { RIcon, RProgressLinear, RSpinner, RTooltip } from "@v2/lib"; +// Hidden on /scan itself. Under reduced motion the progress bar keeps +// filling but drops its streaming glow. +import { RIcon, RProgressLinear, RTooltip } from "@v2/lib"; import { storeToRefs } from "pinia"; import { computed } from "vue"; import { useI18n } from "vue-i18n"; @@ -68,7 +66,6 @@ const counterLabel = computed(() => { :aria-label="t('scan.scanning-library')" > - {{ t("scan.scanning") }} @@ -93,6 +90,7 @@ const counterLabel = computed(() => { :height="2" color="primary" :rounded="false" + stream /> @@ -111,7 +109,7 @@ const counterLabel = computed(() => { flex-direction: column; align-items: stretch; gap: 0; - height: 32px; + height: var(--r-nav-pill-h); padding: 0 12px; border-radius: var(--r-radius-pill); background: color-mix(in srgb, var(--r-color-brand-primary) 14%, transparent); @@ -138,8 +136,8 @@ const counterLabel = computed(() => { ); } -/* Content row sits above the bottom-pinned progress bar — top-aligned - inside the pill so the counter's baseline matches the spinner's. */ +/* Content row sits above the bottom-pinned progress bar, with the counter + centred on the label or radar glyph. */ .r-scan-indicator__row { display: inline-flex; align-items: center; diff --git a/frontend/src/v2/components/AppShell/UserMenu.vue b/frontend/src/v2/components/AppShell/UserMenu.vue index 20df4e483..b014abeed 100644 --- a/frontend/src/v2/components/AppShell/UserMenu.vue +++ b/frontend/src/v2/components/AppShell/UserMenu.vue @@ -333,7 +333,7 @@ async function onLogout() { border-radius: var(--r-radius-pill) !important; padding: 3px 12px 3px 3px !important; color: var(--r-color-fg) !important; - height: auto !important; + height: var(--r-nav-pill-h) !important; min-width: 0 !important; opacity: 1; transition: background var(--r-motion-fast) var(--r-motion-ease-out); diff --git a/frontend/src/v2/components/Soundtrack/NowPlayingPill.vue b/frontend/src/v2/components/Soundtrack/NowPlayingPill.vue index 56d8176cd..8455489db 100644 --- a/frontend/src/v2/components/Soundtrack/NowPlayingPill.vue +++ b/frontend/src/v2/components/Soundtrack/NowPlayingPill.vue @@ -108,7 +108,8 @@ const progress = computed(() => display: flex; align-items: center; min-width: 0; - padding: 1px 2px 1px 1px; + height: var(--r-nav-pill-h); + padding: 0 2px 0 0; background: var(--r-color-surface); border: 1px solid var(--r-color-border-strong); border-radius: var(--r-radius-pill); @@ -145,6 +146,12 @@ const progress = computed(() => flex: 0 1 160px; font-size: var(--r-font-size-sm); } + +/* Portrait phones cap the title and let it loop instead of widening the pill. */ +html[data-bp~="xs"] .r-v2-np-pill__title { + flex-basis: 88px; + width: 88px; +}