wrolpi/app/src/components/ui/ui.css

888 lines
22 KiB
CSS
Raw Normal View History

ui: token-driven component library on Mantine Adds src/components/ui: buttons, messages, labels, progress, status, tables, form controls, panels, cards, statistics, modals, tooltips, tabs, and icons. Everything resolves its colors through theme tokens, so no component branches on the current theme, and Semantic UI keeps rendering the app meanwhile. Mantine is bridged rather than restyled: its own CSS variables are pointed at our tokens. Four details were not obvious, and each caused a visible defect in night mode before being fixed: - Structural colors must go in the resolver's light/dark blocks. Mantine emits its values under [data-mantine-color-scheme], which outranks the :root block that `variables` becomes, so its grays were winning. - The dark and gray palettes are mapped shade by shade to tokens. Mantine reads them directly for table borders, zebra stripes and input chrome; they can be neither flattened nor left alone. - Mantine writes --button-* as inline styles, which no stylesheet can outrank, so the dashed danger treatment sets real properties instead. - Switch colors are written onto inner elements, so they need scoped CSS rather than a variable on the root. Adds a --knob token for control handles, because Mantine's default thumb follows theme.white, which is near-black in the dark-based themes. An audit of every painted pixel in the /theme-sample gallery now finds no non-red channel in night mode. Icons come from @tabler/icons-react with the 102 Semantic names the app uses mapped to components; they stroke with currentColor, so they follow the theme without any rule of their own. Toasts keep the react-semantic-toasts-2 signature so those call sites migrate by changing an import. TypeScript 5 is required: Mantine's declarations use `const` type parameters, which 4.9 cannot parse (Mantine 7 is the same, so downgrading is no escape). That needs two npm overrides to keep clean installs working, both verified against a Docker build: react-scripts declares peerOptional typescript ^3||^4, and fork-ts-checker 6.5.2 assigns typescript.performance.mark, which TS 5 made getter-only - crashing the dev server's type checker on every rebuild. semantic-baseline.test.js ratchets the removal: it fails if a file not already listed imports Semantic UI. An ESLint rule would have printed 75 warnings per rebuild, and CI unsets CI= for its build step, so it would guard nothing there. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-29 19:22:03 -06:00
/*
* Styles for the token-driven component library.
*
* Rules here encode design decisions Mantine's variables cannot express on their
* own — chiefly the two that change *form* rather than color between themes:
* the dashed danger treatment and status-by-brightness. See ui-design.md.
*
* Nothing in this file hardcodes a color; every value comes from a token.
*/
/* ------------------------------------------------------------------ Icons */
.wrolpi-icon-spin {
animation: wrolpi-icon-spin 0.9s linear infinite;
}
@keyframes wrolpi-icon-spin {
to {
transform: rotate(360deg);
}
}
@media (prefers-reduced-motion: reduce) {
.wrolpi-icon-spin {
animation: none;
}
}
ui: nine leaf files off Semantic, and the components they needed Phase 2, part 2. Baseline 72 -> 63. Migrated: Tables, SortableTable, DonatePage, Share, Headline, ErrorBoundary, and the QR code, VIN decoder, and temperature calculators. New in the library, all in the gallery and tested: SearchBox Semantic's `<Search category>`, keeping its grouped `results` shape because four call sites already build it. A real combobox: arrows move, Enter takes the highlighted suggestion or submits the raw text, Escape closes without clearing. Pagination Semantic's prop names, but onPageChange gets the page number rather than an (event, data) pair. TabBar the strip and its house style only; routing stays at the call site, which is what decides what is active. IconStack two glyphs composed into one symbol, named once for assistive technology (Semantic's IconGroup). Table.HeaderCell gains `sorted` and `onSort`. That last one is a fix, not just a port. Semantic's `sorted` prop set `aria-sort`; migrating a table by hand dropped it, leaving a clickable <th> that no keyboard could reach and no screen reader could describe. Putting it in the library means the next table gets it right without anyone remembering. Night mode holes closed along the way: the QR codes on the donate, share, and calculator pages are white by necessity — a scanner needs the contrast — and they render as SVG, which the media filter does not target. In night mode that was a lit panel. They now carry `.media`, so the filter remaps the block as a unit and the contrast survives the mapping. Also: `paypal` joins the icon map rather than being imported ad hoc in a page, and FileBrowser stops passing Semantic-only table props into a DOM element.
2026-07-30 09:31:15 -06:00
.wrolpi-icon-stack {
position: relative;
display: inline-flex;
line-height: 0;
}
/*
* The corner glyph sits on the main one, so it carries the surface color behind
* it — without that the two sets of strokes cross and neither reads.
*/
.wrolpi-icon-stack-corner {
position: absolute;
right: -3px;
bottom: -3px;
display: flex;
background: var(--bg);
border-radius: 50%;
padding: 1px;
}
ui: token-driven component library on Mantine Adds src/components/ui: buttons, messages, labels, progress, status, tables, form controls, panels, cards, statistics, modals, tooltips, tabs, and icons. Everything resolves its colors through theme tokens, so no component branches on the current theme, and Semantic UI keeps rendering the app meanwhile. Mantine is bridged rather than restyled: its own CSS variables are pointed at our tokens. Four details were not obvious, and each caused a visible defect in night mode before being fixed: - Structural colors must go in the resolver's light/dark blocks. Mantine emits its values under [data-mantine-color-scheme], which outranks the :root block that `variables` becomes, so its grays were winning. - The dark and gray palettes are mapped shade by shade to tokens. Mantine reads them directly for table borders, zebra stripes and input chrome; they can be neither flattened nor left alone. - Mantine writes --button-* as inline styles, which no stylesheet can outrank, so the dashed danger treatment sets real properties instead. - Switch colors are written onto inner elements, so they need scoped CSS rather than a variable on the root. Adds a --knob token for control handles, because Mantine's default thumb follows theme.white, which is near-black in the dark-based themes. An audit of every painted pixel in the /theme-sample gallery now finds no non-red channel in night mode. Icons come from @tabler/icons-react with the 102 Semantic names the app uses mapped to components; they stroke with currentColor, so they follow the theme without any rule of their own. Toasts keep the react-semantic-toasts-2 signature so those call sites migrate by changing an import. TypeScript 5 is required: Mantine's declarations use `const` type parameters, which 4.9 cannot parse (Mantine 7 is the same, so downgrading is no escape). That needs two npm overrides to keep clean installs working, both verified against a Docker build: react-scripts declares peerOptional typescript ^3||^4, and fork-ts-checker 6.5.2 assigns typescript.performance.mark, which TS 5 made getter-only - crashing the dev server's type checker on every rebuild. semantic-baseline.test.js ratchets the removal: it fails if a file not already listed imports Semantic UI. An ESLint rule would have printed 75 warnings per rebuild, and CI unsets CI= for its build step, so it would guard nothing there. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-29 19:22:03 -06:00
/* ---------------------------------------------------------------- Buttons */
/*
* Dashed borders mean "destructive or failed", and nothing else may use them.
* In night mode a destructive button drops its fill entirely: 1.5px keeps the
* dashes legible at low brightness, where a 1px hairline dash disappears.
*/
/*
* In light, dark, and amber the button stays filled, which `color="red"` already
* does. Night is the exception, and it cannot be expressed by overriding
* Mantine's `--button-*` variables: Mantine writes those as inline styles on the
* element, which no stylesheet rule can outrank. Setting the real properties
* works instead — this selector (0,2,0 plus an element) outranks the Mantine
* class rule that reads the variables.
*/
html[data-theme="night"] .wrolpi-button-danger {
background: transparent;
color: var(--red);
border: 1.5px dashed var(--red);
}
html[data-theme="night"] .wrolpi-button-danger:hover:not(:disabled) {
background: var(--panel);
}
/* The icon inside inherits currentColor, so it follows without another rule. */
/* ----------------------------------------------------------- Theme picker */
.wrolpi-theme-picker {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
gap: 10px;
}
.wrolpi-theme-option {
display: flex;
flex-direction: column;
gap: 4px;
align-items: flex-start;
text-align: left;
padding: 10px 12px;
background: var(--panel);
color: var(--text);
border: 1px solid var(--border);
font: inherit;
cursor: pointer;
}
.wrolpi-theme-option:hover {
background: var(--head);
}
/* The selected theme is marked by a heavier border as well as color, so the
selection survives in monochrome themes. */
.wrolpi-theme-option-active {
border: 2px solid var(--blue);
padding: 9px 11px;
}
html[data-theme="night"] .wrolpi-theme-option-active,
html[data-theme="amber"] .wrolpi-theme-option-active {
border-color: var(--text);
}
.wrolpi-theme-option:focus-visible {
outline: 2px solid var(--blue);
outline-offset: 1px;
}
.wrolpi-theme-option-name {
display: inline-flex;
align-items: center;
gap: 7px;
font-weight: 600;
font-size: 13px;
}
.wrolpi-theme-option-description {
font-size: 12px;
color: var(--muted);
line-height: 1.4;
}
ui: media filtering is a per-theme setting, not a night-mode hardcode Filtering media was keyed on `data-theme="night"`, which made it a property of the theme that no user could turn off. Some people want their media tinted to match the interface; some want to see the actual image. A theme now declares a filter and whether it starts on, and the user decides: night night-red on by default. An unfiltered thumbnail undoes dark adaptation, which is the whole point of the mode. amber amber-mono off by default. Amber is a look, not a night-vision aid, so media keeps its real colors until asked for. light - no filter offered, so no toggle is shown. dark - The choice is stored per theme, so wanting amber's tint says nothing about wanting night's. The toggle lives in the theme picker, which puts it on the Settings page and in the gallery at once. Mechanically the rules now key on a `data-media-filter` attribute rather than `data-theme`: a rule keyed on the theme could not be turned off. index.html stamps that attribute before first paint alongside data-theme -- without it, night mode paints a screen of unfiltered thumbnails while the bundle arrives over a hotspot, costing the user the adaptation the theme exists to protect. Tests cover both the attribute rule and the fact that the inline script's duplicated ids and defaults still agree with names.ts. The amber matrix is the same luminance collapse tinted to #ff9500 (red full, green 0.584, blue zero) with a gentler gamma than night's: amber carries far more luminance and clips to a flat wash otherwise. The gallery gains a Media filtering section showing the WROLPi logo filtered, beside an unfiltered copy that opts out with `night-unfiltered`. That copy is behind a click on purpose -- an unfiltered image is a bright patch, and night mode should not spring one on someone reading in the dark. ui-design.md gains the media filtering contract it never got in Phase 0, including the note that a Phase 3 custom theme names an existing filter id and cannot ship its own matrix, since that would be code rather than data.
2026-07-30 08:51:28 -06:00
/* Separated from the theme grid: it configures the chosen theme, it is not a choice. */
.wrolpi-media-filter-setting {
margin-top: 14px;
padding-top: 12px;
border-top: 1px solid var(--border);
}
ui: nine leaf files off Semantic, and the components they needed Phase 2, part 2. Baseline 72 -> 63. Migrated: Tables, SortableTable, DonatePage, Share, Headline, ErrorBoundary, and the QR code, VIN decoder, and temperature calculators. New in the library, all in the gallery and tested: SearchBox Semantic's `<Search category>`, keeping its grouped `results` shape because four call sites already build it. A real combobox: arrows move, Enter takes the highlighted suggestion or submits the raw text, Escape closes without clearing. Pagination Semantic's prop names, but onPageChange gets the page number rather than an (event, data) pair. TabBar the strip and its house style only; routing stays at the call site, which is what decides what is active. IconStack two glyphs composed into one symbol, named once for assistive technology (Semantic's IconGroup). Table.HeaderCell gains `sorted` and `onSort`. That last one is a fix, not just a port. Semantic's `sorted` prop set `aria-sort`; migrating a table by hand dropped it, leaving a clickable <th> that no keyboard could reach and no screen reader could describe. Putting it in the library means the next table gets it right without anyone remembering. Night mode holes closed along the way: the QR codes on the donate, share, and calculator pages are white by necessity — a scanner needs the contrast — and they render as SVG, which the media filter does not target. In night mode that was a lit panel. They now carry `.media`, so the filter remaps the block as a unit and the contrast survives the mapping. Also: `paypal` joins the icon map rather than being imported ad hoc in a page, and FileBrowser stops passing Semantic-only table props into a DOM element.
2026-07-30 09:31:15 -06:00
/* ------------------------------------------------------------ Pagination */
.wrolpi-pagination button {
background: var(--panel);
color: var(--text);
border: 1px solid var(--border);
}
.wrolpi-pagination button[data-active] {
background: var(--blue);
color: var(--btn-text);
border-color: var(--blue);
}
/* Night and amber have no second hue to spend, so the current page is marked by a
heavier border and the panel surface instead of a filled block of color. */
html[data-theme="night"] .wrolpi-pagination button[data-active],
html[data-theme="amber"] .wrolpi-pagination button[data-active] {
background: var(--panel);
color: var(--text);
border: 2px solid var(--text);
}
.wrolpi-pagination button:disabled {
color: var(--muted);
background: var(--bg);
}
/* ---------------------------------------------------------------- Tab bar */
.wrolpi-tabs {
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 12px;
border-bottom: 1px solid var(--border);
margin-bottom: 14px;
}
.wrolpi-tabs-links {
display: flex;
flex-wrap: wrap;
}
.wrolpi-tabs-right {
padding-bottom: 6px;
}
.wrolpi-tab {
display: inline-block;
padding: 8px 14px;
color: var(--muted);
text-decoration: none;
font-size: 13px;
border: 1px solid transparent;
/* Sits on the bar's own rule, so the active tab can erase it and read as
connected to the panel below. */
margin-bottom: -1px;
}
.wrolpi-tab:hover {
color: var(--text);
}
.wrolpi-tab-active {
color: var(--text);
background: var(--panel);
border-color: var(--border);
border-bottom-color: var(--panel);
font-weight: 600;
}
.wrolpi-tab:focus-visible {
outline: 2px solid var(--blue);
outline-offset: -2px;
}
/* ------------------------------------------------------------- Search box */
.wrolpi-searchbox {
position: relative;
width: 100%;
}
.wrolpi-searchbox-control {
display: flex;
align-items: center;
gap: 8px;
background: var(--panel);
border: 1px solid var(--border);
padding: 0 8px;
}
.wrolpi-searchbox-control:focus-within {
border-color: var(--blue);
}
html[data-theme="night"] .wrolpi-searchbox-control:focus-within,
html[data-theme="amber"] .wrolpi-searchbox-control:focus-within {
border-color: var(--text);
}
.wrolpi-searchbox-icon {
display: flex;
color: var(--muted);
}
.wrolpi-searchbox-input {
flex: 1;
min-width: 0;
padding: 8px 0;
background: none;
border: none;
outline: none;
color: var(--text);
font: inherit;
font-size: 13px;
}
.wrolpi-searchbox-input::placeholder {
color: var(--muted);
}
.wrolpi-searchbox-loading,
.wrolpi-searchbox-clear {
flex: none;
}
/*
* The suggestion list overlays the page rather than pushing it down — a search
* that reflows the results underneath it is unusable while typing.
*/
.wrolpi-searchbox-results {
position: absolute;
z-index: 20;
top: 100%;
left: 0;
right: 0;
/*
* Tall enough for a full set of grouped suggestions -- directories, channels and
* domains together run past 320px, and the last group was being clipped -- but
* still capped so a long list cannot cover the page.
*/
max-height: min(60vh, 480px);
ui: nine leaf files off Semantic, and the components they needed Phase 2, part 2. Baseline 72 -> 63. Migrated: Tables, SortableTable, DonatePage, Share, Headline, ErrorBoundary, and the QR code, VIN decoder, and temperature calculators. New in the library, all in the gallery and tested: SearchBox Semantic's `<Search category>`, keeping its grouped `results` shape because four call sites already build it. A real combobox: arrows move, Enter takes the highlighted suggestion or submits the raw text, Escape closes without clearing. Pagination Semantic's prop names, but onPageChange gets the page number rather than an (event, data) pair. TabBar the strip and its house style only; routing stays at the call site, which is what decides what is active. IconStack two glyphs composed into one symbol, named once for assistive technology (Semantic's IconGroup). Table.HeaderCell gains `sorted` and `onSort`. That last one is a fix, not just a port. Semantic's `sorted` prop set `aria-sort`; migrating a table by hand dropped it, leaving a clickable <th> that no keyboard could reach and no screen reader could describe. Putting it in the library means the next table gets it right without anyone remembering. Night mode holes closed along the way: the QR codes on the donate, share, and calculator pages are white by necessity — a scanner needs the contrast — and they render as SVG, which the media filter does not target. In night mode that was a lit panel. They now carry `.media`, so the filter remaps the block as a unit and the contrast survives the mapping. Also: `paypal` joins the icon map rather than being imported ad hoc in a page, and FileBrowser stops passing Semantic-only table props into a DOM element.
2026-07-30 09:31:15 -06:00
overflow-y: auto;
background: var(--panel);
border: 1px solid var(--border);
border-top: none;
}
.wrolpi-searchbox-group-name {
padding: 6px 10px;
font-size: 11px;
font-weight: 600;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--muted);
background: var(--head);
}
.wrolpi-searchbox-result {
padding: 7px 10px;
cursor: pointer;
border-top: 1px solid var(--border);
}
.wrolpi-searchbox-result-active {
background: var(--head);
}
.wrolpi-searchbox-result-title {
font-size: 13px;
color: var(--text);
overflow-wrap: anywhere;
}
.wrolpi-searchbox-result-description {
font-size: 11px;
color: var(--muted);
}
.wrolpi-searchbox-empty {
padding: 10px;
font-size: 12px;
color: var(--muted);
}
ui: migrate the extension pages and Configs; five components they needed Phase 2, part 1. Three files leave Semantic UI (baseline 75 -> 72), and the components they needed join the library and the gallery: Header Semantic's shape (as/icon/subheader/dividing). 47 files use <Header>, and the level now picks the size, so the type scale stays a scale instead of each call site choosing a font size. Message gains an icon and a dismiss button. ActionInput input and button sharing one outline, for <Input action={...}/>. Loading centered loader with a caption, replacing the <Loader active inline='centered'> + wrapper div in 19 places. Modal becomes compound - Modal.Header/.Content/.Actions, plus Semantic's open, closeIcon, and size names - because 34 files are written against that shape. test-utils mounts MantineProvider with ThemeProvider's exact configuration: migrated components render Mantine internals and every one of their test files would otherwise need its own provider. One Semantic bleed found and fixed: semantic.min.css sets `h1,h2,h3,h4,h5 { font-family: Lato }` and loads after Mantine's element rule, so headings ignored the theme's body face. Only visible in amber, where the body is mono and the headings were not. A class-level restatement outranks it; the rule comes out when Semantic does. Verified: 925 jest tests, clean production build, and a night-mode audit of every painted pixel in the gallery (red-only, one known false positive). The Configs backup and restore flow was exercised against the real API.
2026-07-29 20:25:34 -06:00
/* ---------------------------------------------------------------- Modals */
/*
* Actions sit below the body, separated by a hairline rather than a raised bar.
* Right-aligned, so the confirming action lands where the eye finishes reading.
*/
.wrolpi-modal-actions {
display: flex;
justify-content: flex-end;
flex-wrap: wrap;
gap: 10px;
/* Bleed back out through the modal body's own padding so the rule spans the
full width; -1 * whatever Mantine padded the body with. */
margin: 18px calc(var(--mantine-spacing-md) * -1) calc(var(--mantine-spacing-md) * -1);
padding: 12px var(--mantine-spacing-md);
border-top: 1px solid var(--border);
}
ui: the last Semantic UI file, and the stylesheet with it ControllerPage was the final call site; Theme.tsx then had nothing left to wrap, so it drops from 861 lines to 338 -- the provider that resolves the theme, stamps `data-theme` and `data-media-filter`, persists both and hands Mantine our tokens. Everything below that was Semantic wrappers. The dark-mode compatibility props went with them. `i`, `s`, `t` and `inverted` existed so unmigrated components could borrow Semantic's dark treatment, and they carried hardcoded greys -- #1B1C1D, #dddddd, #eeeeee -- which is exactly what the token themes replaced. Three call sites in Common.js were still injecting the #eeeeee one into links. Then `semantic-ui-offline/semantic.min.css` came out of App.js. That took more with it than expected, and looking at the running app is the only reason it was caught: Every link lost its colour and gained the browser's underline and visited purple. The dashboard's load averages and section headings were underlined and purple. Links now take `--blue`, which remaps per theme, and underline only on hover -- many of them wrap cards, posters and icons. `box-sizing: border-box` disappeared, which silently changes the size of every padded element in the app. Semantic's reset had been providing it. The navigation bar overflowed a 1000px viewport with `nowrap` and cut "Admin" off the right edge -- the one link a user needs to reach the settings that fix a broken WROLPi. Semantic's menu wrapped; ours does now too. The gzipped CSS bundle is 47.5 kB, and one call site was still leaning on Semantic's grid classes -- now a flex column, since all three of its callers pass library components. The ratchet stays rather than being deleted. At zero it asserts four things: no file imports Semantic UI, none calls its toast library, none leans on its stylesheet, and no file reaches back through Theme.tsx. It can go when the packages are uninstalled. Theme.test.js is deleted, but not before porting the two behaviours it protected: that Button forwards a ref to the real DOM element (a class-component ref once crashed the Control page, because portals call `node.contains`), and that the progress percentage stays readable on every bar colour.
2026-07-30 13:41:05 -06:00
/* A stack of form rows, replacing Semantic's `ui stackable grid` in edit forms. */
.wrolpi-form-rows {
display: flex;
flex-direction: column;
gap: 14px;
}
/* ------------------------------------------------------------- Form fields */
/*
* `hooks/useForm.js` renders its own <label> and native <input> — it always did, with
* Semantic's Form.Input only wrapping them for field styling. These rules supply that
* styling from tokens instead, so a native input matches the library's own controls.
*/
.wrolpi-form-field input {
width: 100%;
padding: 7px 9px;
background: var(--panel);
color: var(--text);
border: 1px solid var(--border);
font: inherit;
font-size: 13px;
}
.wrolpi-form-field input::placeholder {
color: var(--muted);
}
.wrolpi-form-field input:focus {
outline: none;
border-color: var(--blue);
}
html[data-theme="night"] .wrolpi-form-field input:focus,
html[data-theme="amber"] .wrolpi-form-field input:focus {
border-color: var(--text);
}
/* An invalid field is dashed, matching every other failure state in the interface. */
.wrolpi-form-field[data-error] input {
border: 1.5px dashed var(--red);
}
.wrolpi-form-field input:disabled {
color: var(--muted);
background: var(--bg);
}
ui: migrate the extension pages and Configs; five components they needed Phase 2, part 1. Three files leave Semantic UI (baseline 75 -> 72), and the components they needed join the library and the gallery: Header Semantic's shape (as/icon/subheader/dividing). 47 files use <Header>, and the level now picks the size, so the type scale stays a scale instead of each call site choosing a font size. Message gains an icon and a dismiss button. ActionInput input and button sharing one outline, for <Input action={...}/>. Loading centered loader with a caption, replacing the <Loader active inline='centered'> + wrapper div in 19 places. Modal becomes compound - Modal.Header/.Content/.Actions, plus Semantic's open, closeIcon, and size names - because 34 files are written against that shape. test-utils mounts MantineProvider with ThemeProvider's exact configuration: migrated components render Mantine internals and every one of their test files would otherwise need its own provider. One Semantic bleed found and fixed: semantic.min.css sets `h1,h2,h3,h4,h5 { font-family: Lato }` and loads after Mantine's element rule, so headings ignored the theme's body face. Only visible in amber, where the body is mono and the headings were not. A class-level restatement outranks it; the rule comes out when Semantic does. Verified: 925 jest tests, clean production build, and a night-mode audit of every painted pixel in the gallery (red-only, one known false positive). The Configs backup and restore flow was exercised against the real API.
2026-07-29 20:25:34 -06:00
/* ---------------------------------------------------------- Action inputs */
/*
* Input and button share one outline: the input gives up its right border and
* the button's left border becomes the seam between them.
*/
.wrolpi-action-input {
display: flex;
align-items: stretch;
width: 100%;
}
.wrolpi-action-input > .mantine-TextInput-root {
flex: 1;
min-width: 0;
}
.wrolpi-action-input .mantine-TextInput-input {
border-right-width: 0;
}
.wrolpi-action-input > :not(.mantine-TextInput-root) {
flex: none;
}
ui: token-driven component library on Mantine Adds src/components/ui: buttons, messages, labels, progress, status, tables, form controls, panels, cards, statistics, modals, tooltips, tabs, and icons. Everything resolves its colors through theme tokens, so no component branches on the current theme, and Semantic UI keeps rendering the app meanwhile. Mantine is bridged rather than restyled: its own CSS variables are pointed at our tokens. Four details were not obvious, and each caused a visible defect in night mode before being fixed: - Structural colors must go in the resolver's light/dark blocks. Mantine emits its values under [data-mantine-color-scheme], which outranks the :root block that `variables` becomes, so its grays were winning. - The dark and gray palettes are mapped shade by shade to tokens. Mantine reads them directly for table borders, zebra stripes and input chrome; they can be neither flattened nor left alone. - Mantine writes --button-* as inline styles, which no stylesheet can outrank, so the dashed danger treatment sets real properties instead. - Switch colors are written onto inner elements, so they need scoped CSS rather than a variable on the root. Adds a --knob token for control handles, because Mantine's default thumb follows theme.white, which is near-black in the dark-based themes. An audit of every painted pixel in the /theme-sample gallery now finds no non-red channel in night mode. Icons come from @tabler/icons-react with the 102 Semantic names the app uses mapped to components; they stroke with currentColor, so they follow the theme without any rule of their own. Toasts keep the react-semantic-toasts-2 signature so those call sites migrate by changing an import. TypeScript 5 is required: Mantine's declarations use `const` type parameters, which 4.9 cannot parse (Mantine 7 is the same, so downgrading is no escape). That needs two npm overrides to keep clean installs working, both verified against a Docker build: react-scripts declares peerOptional typescript ^3||^4, and fork-ts-checker 6.5.2 assigns typescript.performance.mark, which TS 5 made getter-only - crashing the dev server's type checker on every rebuild. semantic-baseline.test.js ratchets the removal: it fails if a file not already listed imports Semantic UI. An ESLint rule would have printed 75 warnings per rebuild, and CI unsets CI= for its build step, so it would guard nothing there. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-29 19:22:03 -06:00
/* --------------------------------------------------------------- Switches */
/*
* Mantine's unchecked track is a gray from its own palette, which would put a
* non-red pixel on screen in night mode. Scoped to `:not(:checked)` so the
* checked track keeps coming from the `color` prop.
*/
ui: Common.js and thirteen more files off Semantic Phase 2, part 3. Baseline 63 -> 50. Common.js is the one that mattered: 51 files import it, so its Semantic usage was propping up the rest of the migration. Everything in it now comes from the library -- Paginator, the two search inputs, DirectorySearch, TabLinks, the toggles, the messages, APIButton, Breadcrumbs, SimpleAccordion, IframeViewer, CardPoster, FileIcon, LoadStatistic, the theme menu, and the hotspot icons. Also migrated: Placeholder, Apps, ArchivePreview, CbzViewer, AddToPlaylist, TaggedDeleteConfirmModal, the collection edit/tag forms, and four inventory components. New in the library, all in the gallery and tested: SearchBox Semantic's `<Search category>` with its grouped results shape kept, because four call sites already build it. A real combobox rather than a div that listens for clicks. Pagination Semantic's prop names; onPageChange gets the page number. TabBar the strip only -- routing stays with the caller. IconStack Semantic's IconGroup, named once for assistive technology. Table.HeaderCell sorted/onSort -- a real button carrying aria-sort. Button/IconButton translate Semantic's size names. That last one is defensive: unmigrated callers still pass size='tiny', and Mantine drops a size it does not recognise without a word, so the button quietly renders at the wrong size. Mapping here keeps the mixed state honest. Three real bugs found and fixed on the way, none of them cosmetic: * `fileSuffixIconName` returned fourteen icon names the map did not have, so opening a folder with a PDF, a Word document or an archive in it logged an error and drew a fallback glyph. All fourteen mapped, with a test that walks the mapper's own return values, and another asserting every mapped name resolves to a Tabler component that exists. * `Statistic` relied on Semantic's `Statistic.Group` for its spacing, so on the dashboard the load averages ran together into "1 MIN. LOAD5 MIN. LOAD15 MIN. LOAD". It carries its own spacing now. * Semantic's inverted stylesheet colors every descendant of an inverted segment, so Toggle labels inherited #dddddd -- white pixels in night mode, on the Settings page, which is exactly where someone adjusts their WROLPi in the dark. Restated from tokens. The baseline ratchet gained a third assertion: a migrated file may still lean on Semantic's CSS classes without importing the library, which the import check cannot see and which would collapse silently when Phase 4 deletes the stylesheet. There is one such bridge today and it is now declared.
2026-07-30 10:00:48 -06:00
/*
* Semantic's inverted stylesheet colors *every* descendant of `.ui.inverted.segment`
* (rgba(255,255,255,.9), and #dddddd on labels). Our components are mounted inside
* unmigrated pages that still use those wrappers, so an inherited color puts white
* pixels on screen in night mode. Restating from tokens is the fix; the rule can go
* when the last Semantic wrapper does.
*/
.wrolpi-switch .mantine-Switch-label {
color: var(--text);
}
.wrolpi-switch .mantine-Switch-description {
color: var(--muted);
}
.wrolpi-switch input:disabled + * .mantine-Switch-label,
.wrolpi-switch input:disabled ~ * .mantine-Switch-label {
color: var(--muted);
}
ui: token-driven component library on Mantine Adds src/components/ui: buttons, messages, labels, progress, status, tables, form controls, panels, cards, statistics, modals, tooltips, tabs, and icons. Everything resolves its colors through theme tokens, so no component branches on the current theme, and Semantic UI keeps rendering the app meanwhile. Mantine is bridged rather than restyled: its own CSS variables are pointed at our tokens. Four details were not obvious, and each caused a visible defect in night mode before being fixed: - Structural colors must go in the resolver's light/dark blocks. Mantine emits its values under [data-mantine-color-scheme], which outranks the :root block that `variables` becomes, so its grays were winning. - The dark and gray palettes are mapped shade by shade to tokens. Mantine reads them directly for table borders, zebra stripes and input chrome; they can be neither flattened nor left alone. - Mantine writes --button-* as inline styles, which no stylesheet can outrank, so the dashed danger treatment sets real properties instead. - Switch colors are written onto inner elements, so they need scoped CSS rather than a variable on the root. Adds a --knob token for control handles, because Mantine's default thumb follows theme.white, which is near-black in the dark-based themes. An audit of every painted pixel in the /theme-sample gallery now finds no non-red channel in night mode. Icons come from @tabler/icons-react with the 102 Semantic names the app uses mapped to components; they stroke with currentColor, so they follow the theme without any rule of their own. Toasts keep the react-semantic-toasts-2 signature so those call sites migrate by changing an import. TypeScript 5 is required: Mantine's declarations use `const` type parameters, which 4.9 cannot parse (Mantine 7 is the same, so downgrading is no escape). That needs two npm overrides to keep clean installs working, both verified against a Docker build: react-scripts declares peerOptional typescript ^3||^4, and fork-ts-checker 6.5.2 assigns typescript.performance.mark, which TS 5 made getter-only - crashing the dev server's type checker on every rebuild. semantic-baseline.test.js ratchets the removal: it fails if a file not already listed imports Semantic UI. An ESLint rule would have printed 75 warnings per rebuild, and CI unsets CI= for its build step, so it would guard nothing there. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-29 19:22:03 -06:00
.wrolpi-switch input:not(:checked) + .mantine-Switch-track {
--switch-bg: var(--border);
}
/*
* The disabled thumb has the same problem: Mantine sets it from its gray palette,
* on the thumb element itself, which is a near-white pixel in night mode.
*/
.wrolpi-switch input:disabled + * > .mantine-Switch-thumb,
.wrolpi-switch input[data-disabled] + * > .mantine-Switch-thumb {
--switch-thumb-bg-disabled: var(--muted);
}
/* ----------------------------------------------------------------- Labels */
.wrolpi-label {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 3px 9px;
font-size: 11.5px;
font-weight: 500;
line-height: 1.3;
background: var(--label-color);
color: var(--btn-text);
border: 1px solid transparent;
}
/* White and black labels would vanish into the surface they sit on. */
.wrolpi-label-white {
color: var(--black);
border-color: var(--border);
}
.wrolpi-label-black {
color: var(--white);
border-color: var(--border);
}
/*
* Night mode: a filled label is a bright patch, and a wall of tags would be a
* wall of light. Every label becomes an outline instead.
*/
html[data-theme="night"] .wrolpi-label {
background: transparent;
color: var(--label-color);
border-color: var(--label-color);
}
ui: migrate the extension pages and Configs; five components they needed Phase 2, part 1. Three files leave Semantic UI (baseline 75 -> 72), and the components they needed join the library and the gallery: Header Semantic's shape (as/icon/subheader/dividing). 47 files use <Header>, and the level now picks the size, so the type scale stays a scale instead of each call site choosing a font size. Message gains an icon and a dismiss button. ActionInput input and button sharing one outline, for <Input action={...}/>. Loading centered loader with a caption, replacing the <Loader active inline='centered'> + wrapper div in 19 places. Modal becomes compound - Modal.Header/.Content/.Actions, plus Semantic's open, closeIcon, and size names - because 34 files are written against that shape. test-utils mounts MantineProvider with ThemeProvider's exact configuration: migrated components render Mantine internals and every one of their test files would otherwise need its own provider. One Semantic bleed found and fixed: semantic.min.css sets `h1,h2,h3,h4,h5 { font-family: Lato }` and loads after Mantine's element rule, so headings ignored the theme's body face. Only visible in amber, where the body is mono and the headings were not. A class-level restatement outranks it; the rule comes out when Semantic does. Verified: 925 jest tests, clean production build, and a night-mode audit of every painted pixel in the gallery (red-only, one known false positive). The Configs backup and restore flow was exercised against the real API.
2026-07-29 20:25:34 -06:00
/* ---------------------------------------------------------------- Headers */
.wrolpi-header {
margin: 0 0 10px;
}
.wrolpi-header-dividing {
border-bottom: 1px solid var(--border);
padding-bottom: 6px;
}
.wrolpi-header-text {
display: flex;
align-items: center;
gap: 8px;
margin: 0;
/*
* Stated explicitly because semantic.min.css sets `h1,h2,h3,h4,h5 { font-family:
* Lato }` and loads after Mantine's element rule, so headings would ignore the
* theme's body face — visible in amber, where the body is mono and headings were
* not. A class outranks the element selector. Can go once Semantic is gone.
*/
font-family: var(--font-body);
font-weight: 600;
line-height: 1.25;
color: var(--text);
text-wrap: balance;
}
/* The scale lives here so no call site invents a size of its own. */
.wrolpi-header-h1 {
font-size: 26px;
}
.wrolpi-header-h2 {
font-size: 21px;
}
.wrolpi-header-h3 {
font-size: 17px;
}
.wrolpi-header-h4 {
font-size: 14px;
}
.wrolpi-header-h5 {
font-size: 13px;
letter-spacing: 0.02em;
}
.wrolpi-header-sub {
font-size: 12px;
color: var(--muted);
margin-top: 3px;
}
ui: three silent library defects the agents' reports surfaced Each of these was reported by an agent working around it rather than patched in one file, which is why all three are fixed once, for every call site. Button accepted an `href` and dropped it. Mantine renders an anchor only when it also gets `component='a'`; Semantic spelled that `as='a'`. So a migrated call site that kept just the href produced something that looks like a download link and navigates nowhere -- silently, with no warning. Button and IconButton now infer the anchor from the href. The media filter ran twice on nested media. A `.media` wrapper filters its subtree as one unit -- the audio player needs that, because its control glyphs are SVG and the element-type rule does not reach them -- but the poster image inside also matched that rule. Two passes of a luminance-to-red matrix is not one: the second takes 0.2126 of an already-red pixel, so the poster came out markedly darker than everything around it. Leaf media inside a filtered wrapper is now left alone. Progress had no indeterminate state. Semantic's `indicating` animated a stripe when the size was unknown; without it an upload that has not reported yet sits at 0% and reads as stalled -- and `aria-valuenow="0"` tells a screen reader the same wrong thing. It now animates, reports no value, and falls back to a static fill under prefers-reduced-motion. Also: night and amber now override an inline `--label-color`. A call site may legitimately need many distinguishable colours -- the Flasher's chip badges use a twelve-colour palette no four tokens can express -- but on a night-adapted screen a green or blue chip badge defeats the entire mode. The labels lose their distinctness there, which is the right trade.
2026-07-30 13:15:03 -06:00
/*
* Night and amber are single-hue by definition, and a call site may legitimately want
* many distinguishable colours — the Flasher's chip-family badges set `--label-color`
* inline from a twelve-colour palette that no four tokens can express.
*
* In those themes the palette is overridden back to the theme's own text colour, so a
* label cannot put a green or blue pixel on a night-adapted screen. `!important` is
* required because the palette arrives as an inline custom property, which a normal
* rule cannot outrank. The labels stop being distinguishable by colour, which is the
* correct trade: the theme's whole purpose is that no other hue reaches the eye.
*/
html[data-theme="night"] .wrolpi-label,
html[data-theme="amber"] .wrolpi-label {
--label-color: var(--text) !important;
}
ui: token-driven component library on Mantine Adds src/components/ui: buttons, messages, labels, progress, status, tables, form controls, panels, cards, statistics, modals, tooltips, tabs, and icons. Everything resolves its colors through theme tokens, so no component branches on the current theme, and Semantic UI keeps rendering the app meanwhile. Mantine is bridged rather than restyled: its own CSS variables are pointed at our tokens. Four details were not obvious, and each caused a visible defect in night mode before being fixed: - Structural colors must go in the resolver's light/dark blocks. Mantine emits its values under [data-mantine-color-scheme], which outranks the :root block that `variables` becomes, so its grays were winning. - The dark and gray palettes are mapped shade by shade to tokens. Mantine reads them directly for table borders, zebra stripes and input chrome; they can be neither flattened nor left alone. - Mantine writes --button-* as inline styles, which no stylesheet can outrank, so the dashed danger treatment sets real properties instead. - Switch colors are written onto inner elements, so they need scoped CSS rather than a variable on the root. Adds a --knob token for control handles, because Mantine's default thumb follows theme.white, which is near-black in the dark-based themes. An audit of every painted pixel in the /theme-sample gallery now finds no non-red channel in night mode. Icons come from @tabler/icons-react with the 102 Semantic names the app uses mapped to components; they stroke with currentColor, so they follow the theme without any rule of their own. Toasts keep the react-semantic-toasts-2 signature so those call sites migrate by changing an import. TypeScript 5 is required: Mantine's declarations use `const` type parameters, which 4.9 cannot parse (Mantine 7 is the same, so downgrading is no escape). That needs two npm overrides to keep clean installs working, both verified against a Docker build: react-scripts declares peerOptional typescript ^3||^4, and fork-ts-checker 6.5.2 assigns typescript.performance.mark, which TS 5 made getter-only - crashing the dev server's type checker on every rebuild. semantic-baseline.test.js ratchets the removal: it fails if a file not already listed imports Semantic UI. An ESLint rule would have printed 75 warnings per rebuild, and CI unsets CI= for its build step, so it would guard nothing there. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-29 19:22:03 -06:00
/* --------------------------------------------------------------- Messages */
.wrolpi-message {
ui: migrate the extension pages and Configs; five components they needed Phase 2, part 1. Three files leave Semantic UI (baseline 75 -> 72), and the components they needed join the library and the gallery: Header Semantic's shape (as/icon/subheader/dividing). 47 files use <Header>, and the level now picks the size, so the type scale stays a scale instead of each call site choosing a font size. Message gains an icon and a dismiss button. ActionInput input and button sharing one outline, for <Input action={...}/>. Loading centered loader with a caption, replacing the <Loader active inline='centered'> + wrapper div in 19 places. Modal becomes compound - Modal.Header/.Content/.Actions, plus Semantic's open, closeIcon, and size names - because 34 files are written against that shape. test-utils mounts MantineProvider with ThemeProvider's exact configuration: migrated components render Mantine internals and every one of their test files would otherwise need its own provider. One Semantic bleed found and fixed: semantic.min.css sets `h1,h2,h3,h4,h5 { font-family: Lato }` and loads after Mantine's element rule, so headings ignored the theme's body face. Only visible in amber, where the body is mono and the headings were not. A class-level restatement outranks it; the rule comes out when Semantic does. Verified: 925 jest tests, clean production build, and a night-mode audit of every painted pixel in the gallery (red-only, one known false positive). The Configs backup and restore flow was exercised against the real API.
2026-07-29 20:25:34 -06:00
display: flex;
align-items: flex-start;
gap: 10px;
ui: token-driven component library on Mantine Adds src/components/ui: buttons, messages, labels, progress, status, tables, form controls, panels, cards, statistics, modals, tooltips, tabs, and icons. Everything resolves its colors through theme tokens, so no component branches on the current theme, and Semantic UI keeps rendering the app meanwhile. Mantine is bridged rather than restyled: its own CSS variables are pointed at our tokens. Four details were not obvious, and each caused a visible defect in night mode before being fixed: - Structural colors must go in the resolver's light/dark blocks. Mantine emits its values under [data-mantine-color-scheme], which outranks the :root block that `variables` becomes, so its grays were winning. - The dark and gray palettes are mapped shade by shade to tokens. Mantine reads them directly for table borders, zebra stripes and input chrome; they can be neither flattened nor left alone. - Mantine writes --button-* as inline styles, which no stylesheet can outrank, so the dashed danger treatment sets real properties instead. - Switch colors are written onto inner elements, so they need scoped CSS rather than a variable on the root. Adds a --knob token for control handles, because Mantine's default thumb follows theme.white, which is near-black in the dark-based themes. An audit of every painted pixel in the /theme-sample gallery now finds no non-red channel in night mode. Icons come from @tabler/icons-react with the 102 Semantic names the app uses mapped to components; they stroke with currentColor, so they follow the theme without any rule of their own. Toasts keep the react-semantic-toasts-2 signature so those call sites migrate by changing an import. TypeScript 5 is required: Mantine's declarations use `const` type parameters, which 4.9 cannot parse (Mantine 7 is the same, so downgrading is no escape). That needs two npm overrides to keep clean installs working, both verified against a Docker build: react-scripts declares peerOptional typescript ^3||^4, and fork-ts-checker 6.5.2 assigns typescript.performance.mark, which TS 5 made getter-only - crashing the dev server's type checker on every rebuild. semantic-baseline.test.js ratchets the removal: it fails if a file not already listed imports Semantic UI. An ESLint rule would have printed 75 warnings per rebuild, and CI unsets CI= for its build step, so it would guard nothing there. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-29 19:22:03 -06:00
border: 1px solid var(--border);
border-left: 3px solid var(--message-color, var(--border));
background: var(--panel);
padding: 10px 14px;
font-size: 13px;
}
ui: migrate the extension pages and Configs; five components they needed Phase 2, part 1. Three files leave Semantic UI (baseline 75 -> 72), and the components they needed join the library and the gallery: Header Semantic's shape (as/icon/subheader/dividing). 47 files use <Header>, and the level now picks the size, so the type scale stays a scale instead of each call site choosing a font size. Message gains an icon and a dismiss button. ActionInput input and button sharing one outline, for <Input action={...}/>. Loading centered loader with a caption, replacing the <Loader active inline='centered'> + wrapper div in 19 places. Modal becomes compound - Modal.Header/.Content/.Actions, plus Semantic's open, closeIcon, and size names - because 34 files are written against that shape. test-utils mounts MantineProvider with ThemeProvider's exact configuration: migrated components render Mantine internals and every one of their test files would otherwise need its own provider. One Semantic bleed found and fixed: semantic.min.css sets `h1,h2,h3,h4,h5 { font-family: Lato }` and loads after Mantine's element rule, so headings ignored the theme's body face. Only visible in amber, where the body is mono and the headings were not. A class-level restatement outranks it; the rule comes out when Semantic does. Verified: 925 jest tests, clean production build, and a night-mode audit of every painted pixel in the gallery (red-only, one known false positive). The Configs backup and restore flow was exercised against the real API.
2026-07-29 20:25:34 -06:00
.wrolpi-message-content {
flex: 1;
min-width: 0;
}
/* The icon repeats what the border color already says, so it takes that color. */
.wrolpi-message-icon {
color: var(--message-color, var(--text));
display: flex;
padding-top: 1px;
}
.wrolpi-message-dismiss {
background: none;
border: none;
padding: 0;
color: var(--muted);
cursor: pointer;
display: flex;
/* Widen the tap target past the glyph without moving it. */
margin: -6px -6px -6px 0;
padding: 6px;
}
.wrolpi-message-dismiss:hover {
color: var(--text);
}
.wrolpi-message-dismiss:focus-visible {
outline: 2px solid var(--blue);
outline-offset: -2px;
}
ui: token-driven component library on Mantine Adds src/components/ui: buttons, messages, labels, progress, status, tables, form controls, panels, cards, statistics, modals, tooltips, tabs, and icons. Everything resolves its colors through theme tokens, so no component branches on the current theme, and Semantic UI keeps rendering the app meanwhile. Mantine is bridged rather than restyled: its own CSS variables are pointed at our tokens. Four details were not obvious, and each caused a visible defect in night mode before being fixed: - Structural colors must go in the resolver's light/dark blocks. Mantine emits its values under [data-mantine-color-scheme], which outranks the :root block that `variables` becomes, so its grays were winning. - The dark and gray palettes are mapped shade by shade to tokens. Mantine reads them directly for table borders, zebra stripes and input chrome; they can be neither flattened nor left alone. - Mantine writes --button-* as inline styles, which no stylesheet can outrank, so the dashed danger treatment sets real properties instead. - Switch colors are written onto inner elements, so they need scoped CSS rather than a variable on the root. Adds a --knob token for control handles, because Mantine's default thumb follows theme.white, which is near-black in the dark-based themes. An audit of every painted pixel in the /theme-sample gallery now finds no non-red channel in night mode. Icons come from @tabler/icons-react with the 102 Semantic names the app uses mapped to components; they stroke with currentColor, so they follow the theme without any rule of their own. Toasts keep the react-semantic-toasts-2 signature so those call sites migrate by changing an import. TypeScript 5 is required: Mantine's declarations use `const` type parameters, which 4.9 cannot parse (Mantine 7 is the same, so downgrading is no escape). That needs two npm overrides to keep clean installs working, both verified against a Docker build: react-scripts declares peerOptional typescript ^3||^4, and fork-ts-checker 6.5.2 assigns typescript.performance.mark, which TS 5 made getter-only - crashing the dev server's type checker on every rebuild. semantic-baseline.test.js ratchets the removal: it fails if a file not already listed imports Semantic UI. An ESLint rule would have printed 75 warnings per rebuild, and CI unsets CI= for its build step, so it would guard nothing there. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-29 19:22:03 -06:00
.wrolpi-message-title {
font-weight: 600;
margin-bottom: 2px;
}
.wrolpi-message-body {
color: var(--muted);
}
/* Errors take the danger treatment in every theme, so "dashed" stays one rule. */
.wrolpi-message-error {
border: 1.5px dashed var(--red);
}
/* --------------------------------------------------------------- Progress */
.wrolpi-progress {
position: relative;
height: 16px;
min-width: 120px;
background: var(--bg);
border: 1px solid var(--border);
}
.wrolpi-progress-fill {
height: 100%;
background: var(--progress-color, var(--blue));
transition: width 0.2s linear;
}
@media (prefers-reduced-motion: reduce) {
.wrolpi-progress-fill {
transition: none;
}
}
ui: three silent library defects the agents' reports surfaced Each of these was reported by an agent working around it rather than patched in one file, which is why all three are fixed once, for every call site. Button accepted an `href` and dropped it. Mantine renders an anchor only when it also gets `component='a'`; Semantic spelled that `as='a'`. So a migrated call site that kept just the href produced something that looks like a download link and navigates nowhere -- silently, with no warning. Button and IconButton now infer the anchor from the href. The media filter ran twice on nested media. A `.media` wrapper filters its subtree as one unit -- the audio player needs that, because its control glyphs are SVG and the element-type rule does not reach them -- but the poster image inside also matched that rule. Two passes of a luminance-to-red matrix is not one: the second takes 0.2126 of an already-red pixel, so the poster came out markedly darker than everything around it. Leaf media inside a filtered wrapper is now left alone. Progress had no indeterminate state. Semantic's `indicating` animated a stripe when the size was unknown; without it an upload that has not reported yet sits at 0% and reads as stalled -- and `aria-valuenow="0"` tells a screen reader the same wrong thing. It now animates, reports no value, and falls back to a static fill under prefers-reduced-motion. Also: night and amber now override an inline `--label-color`. A call site may legitimately need many distinguishable colours -- the Flasher's chip badges use a twelve-colour palette no four tokens can express -- but on a night-adapted screen a green or blue chip badge defeats the entire mode. The labels lose their distinctness there, which is the right trade.
2026-07-30 13:15:03 -06:00
/*
* Indeterminate: a sliding band, for work whose size is not known yet. Semantic called
* this `indicating`; without it an upload that has not reported its size sits at 0% and
* reads as stalled.
*/
.wrolpi-progress-indeterminate .wrolpi-progress-fill {
width: 35%;
animation: wrolpi-progress-slide 1.4s ease-in-out infinite;
}
@keyframes wrolpi-progress-slide {
from {
margin-left: -35%;
}
to {
margin-left: 100%;
}
}
/* Motion is the only signal here, so when it is suppressed the bar fills instead. */
@media (prefers-reduced-motion: reduce) {
.wrolpi-progress-indeterminate .wrolpi-progress-fill {
animation: none;
width: 100%;
opacity: 0.5;
}
}
ui: token-driven component library on Mantine Adds src/components/ui: buttons, messages, labels, progress, status, tables, form controls, panels, cards, statistics, modals, tooltips, tabs, and icons. Everything resolves its colors through theme tokens, so no component branches on the current theme, and Semantic UI keeps rendering the app meanwhile. Mantine is bridged rather than restyled: its own CSS variables are pointed at our tokens. Four details were not obvious, and each caused a visible defect in night mode before being fixed: - Structural colors must go in the resolver's light/dark blocks. Mantine emits its values under [data-mantine-color-scheme], which outranks the :root block that `variables` becomes, so its grays were winning. - The dark and gray palettes are mapped shade by shade to tokens. Mantine reads them directly for table borders, zebra stripes and input chrome; they can be neither flattened nor left alone. - Mantine writes --button-* as inline styles, which no stylesheet can outrank, so the dashed danger treatment sets real properties instead. - Switch colors are written onto inner elements, so they need scoped CSS rather than a variable on the root. Adds a --knob token for control handles, because Mantine's default thumb follows theme.white, which is near-black in the dark-based themes. An audit of every painted pixel in the /theme-sample gallery now finds no non-red channel in night mode. Icons come from @tabler/icons-react with the 102 Semantic names the app uses mapped to components; they stroke with currentColor, so they follow the theme without any rule of their own. Toasts keep the react-semantic-toasts-2 signature so those call sites migrate by changing an import. TypeScript 5 is required: Mantine's declarations use `const` type parameters, which 4.9 cannot parse (Mantine 7 is the same, so downgrading is no escape). That needs two npm overrides to keep clean installs working, both verified against a Docker build: react-scripts declares peerOptional typescript ^3||^4, and fork-ts-checker 6.5.2 assigns typescript.performance.mark, which TS 5 made getter-only - crashing the dev server's type checker on every rebuild. semantic-baseline.test.js ratchets the removal: it fails if a file not already listed imports Semantic UI. An ESLint rule would have printed 75 warnings per rebuild, and CI unsets CI= for its build step, so it would guard nothing there. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-29 19:22:03 -06:00
.wrolpi-progress-text {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
font-size: 11px;
font-weight: 700;
color: var(--text);
font-variant-numeric: tabular-nums;
}
/*
* The percent text sits on both the filled and empty halves of the bar, so the
* fill has to stay light enough in light mode for dark text to read over it.
*/
html[data-theme="light"] .wrolpi-progress {
background: var(--panel);
}
html[data-theme="light"] .wrolpi-progress-fill {
filter: brightness(1.75) saturate(0.55);
}
/* Night: a mostly-full bar must not become a large bright surface. */
html[data-theme="night"] .wrolpi-progress-fill,
html[data-theme="amber"] .wrolpi-progress-fill {
background: var(--muted);
}
/* ----------------------------------------------------------------- Panels */
.wrolpi-panel {
background: var(--panel);
border: 1px solid var(--border);
padding: 14px 16px;
}
/* Danger zones are dashed in every theme; it doubles as a colorblind-safe cue. */
.wrolpi-panel-danger {
border: 1.5px dashed var(--red);
}
ui: Common.js and thirteen more files off Semantic Phase 2, part 3. Baseline 63 -> 50. Common.js is the one that mattered: 51 files import it, so its Semantic usage was propping up the rest of the migration. Everything in it now comes from the library -- Paginator, the two search inputs, DirectorySearch, TabLinks, the toggles, the messages, APIButton, Breadcrumbs, SimpleAccordion, IframeViewer, CardPoster, FileIcon, LoadStatistic, the theme menu, and the hotspot icons. Also migrated: Placeholder, Apps, ArchivePreview, CbzViewer, AddToPlaylist, TaggedDeleteConfirmModal, the collection edit/tag forms, and four inventory components. New in the library, all in the gallery and tested: SearchBox Semantic's `<Search category>` with its grouped results shape kept, because four call sites already build it. A real combobox rather than a div that listens for clicks. Pagination Semantic's prop names; onPageChange gets the page number. TabBar the strip only -- routing stays with the caller. IconStack Semantic's IconGroup, named once for assistive technology. Table.HeaderCell sorted/onSort -- a real button carrying aria-sort. Button/IconButton translate Semantic's size names. That last one is defensive: unmigrated callers still pass size='tiny', and Mantine drops a size it does not recognise without a word, so the button quietly renders at the wrong size. Mapping here keeps the mixed state honest. Three real bugs found and fixed on the way, none of them cosmetic: * `fileSuffixIconName` returned fourteen icon names the map did not have, so opening a folder with a PDF, a Word document or an archive in it logged an error and drew a fallback glyph. All fourteen mapped, with a test that walks the mapper's own return values, and another asserting every mapped name resolves to a Tabler component that exists. * `Statistic` relied on Semantic's `Statistic.Group` for its spacing, so on the dashboard the load averages ran together into "1 MIN. LOAD5 MIN. LOAD15 MIN. LOAD". It carries its own spacing now. * Semantic's inverted stylesheet colors every descendant of an inverted segment, so Toggle labels inherited #dddddd -- white pixels in night mode, on the Settings page, which is exactly where someone adjusts their WROLPi in the dark. Restated from tokens. The baseline ratchet gained a third assertion: a migrated file may still lean on Semantic's CSS classes without importing the library, which the import check cannot see and which would collapse silently when Phase 4 deletes the stylesheet. There is one such bridge today and it is now declared.
2026-07-30 10:00:48 -06:00
/* ----------------------------------------------------------- Card posters */
/*
* The icon shown when a file has no poster, and the corner mark for a tagged
* file. Both live here rather than in Common.js so the card surface and the
* poster area agree in every theme.
*/
.wrolpi-card-icon {
position: relative;
display: flex;
align-items: center;
justify-content: center;
min-height: 120px;
background: var(--head);
}
.wrolpi-card-tag {
position: absolute;
top: 0;
left: 0;
display: flex;
padding: 3px 4px;
background: var(--green);
color: var(--btn-text);
}
/* Night and amber have no green to spend; the mark reads as an outline instead. */
html[data-theme="night"] .wrolpi-card-tag,
html[data-theme="amber"] .wrolpi-card-tag {
background: var(--panel);
color: var(--text);
border-right: 1px solid var(--border);
border-bottom: 1px solid var(--border);
}
ui: token-driven component library on Mantine Adds src/components/ui: buttons, messages, labels, progress, status, tables, form controls, panels, cards, statistics, modals, tooltips, tabs, and icons. Everything resolves its colors through theme tokens, so no component branches on the current theme, and Semantic UI keeps rendering the app meanwhile. Mantine is bridged rather than restyled: its own CSS variables are pointed at our tokens. Four details were not obvious, and each caused a visible defect in night mode before being fixed: - Structural colors must go in the resolver's light/dark blocks. Mantine emits its values under [data-mantine-color-scheme], which outranks the :root block that `variables` becomes, so its grays were winning. - The dark and gray palettes are mapped shade by shade to tokens. Mantine reads them directly for table borders, zebra stripes and input chrome; they can be neither flattened nor left alone. - Mantine writes --button-* as inline styles, which no stylesheet can outrank, so the dashed danger treatment sets real properties instead. - Switch colors are written onto inner elements, so they need scoped CSS rather than a variable on the root. Adds a --knob token for control handles, because Mantine's default thumb follows theme.white, which is near-black in the dark-based themes. An audit of every painted pixel in the /theme-sample gallery now finds no non-red channel in night mode. Icons come from @tabler/icons-react with the 102 Semantic names the app uses mapped to components; they stroke with currentColor, so they follow the theme without any rule of their own. Toasts keep the react-semantic-toasts-2 signature so those call sites migrate by changing an import. TypeScript 5 is required: Mantine's declarations use `const` type parameters, which 4.9 cannot parse (Mantine 7 is the same, so downgrading is no escape). That needs two npm overrides to keep clean installs working, both verified against a Docker build: react-scripts declares peerOptional typescript ^3||^4, and fork-ts-checker 6.5.2 assigns typescript.performance.mark, which TS 5 made getter-only - crashing the dev server's type checker on every rebuild. semantic-baseline.test.js ratchets the removal: it fails if a file not already listed imports Semantic UI. An ESLint rule would have printed 75 warnings per rebuild, and CI unsets CI= for its build step, so it would guard nothing there. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-29 19:22:03 -06:00
/* ------------------------------------------------------------- Statistics */
ui: Common.js and thirteen more files off Semantic Phase 2, part 3. Baseline 63 -> 50. Common.js is the one that mattered: 51 files import it, so its Semantic usage was propping up the rest of the migration. Everything in it now comes from the library -- Paginator, the two search inputs, DirectorySearch, TabLinks, the toggles, the messages, APIButton, Breadcrumbs, SimpleAccordion, IframeViewer, CardPoster, FileIcon, LoadStatistic, the theme menu, and the hotspot icons. Also migrated: Placeholder, Apps, ArchivePreview, CbzViewer, AddToPlaylist, TaggedDeleteConfirmModal, the collection edit/tag forms, and four inventory components. New in the library, all in the gallery and tested: SearchBox Semantic's `<Search category>` with its grouped results shape kept, because four call sites already build it. A real combobox rather than a div that listens for clicks. Pagination Semantic's prop names; onPageChange gets the page number. TabBar the strip only -- routing stays with the caller. IconStack Semantic's IconGroup, named once for assistive technology. Table.HeaderCell sorted/onSort -- a real button carrying aria-sort. Button/IconButton translate Semantic's size names. That last one is defensive: unmigrated callers still pass size='tiny', and Mantine drops a size it does not recognise without a word, so the button quietly renders at the wrong size. Mapping here keeps the mixed state honest. Three real bugs found and fixed on the way, none of them cosmetic: * `fileSuffixIconName` returned fourteen icon names the map did not have, so opening a folder with a PDF, a Word document or an archive in it logged an error and drew a fallback glyph. All fourteen mapped, with a test that walks the mapper's own return values, and another asserting every mapped name resolves to a Tabler component that exists. * `Statistic` relied on Semantic's `Statistic.Group` for its spacing, so on the dashboard the load averages ran together into "1 MIN. LOAD5 MIN. LOAD15 MIN. LOAD". It carries its own spacing now. * Semantic's inverted stylesheet colors every descendant of an inverted segment, so Toggle labels inherited #dddddd -- white pixels in night mode, on the Settings page, which is exactly where someone adjusts their WROLPi in the dark. Restated from tokens. The baseline ratchet gained a third assertion: a migrated file may still lean on Semantic's CSS classes without importing the library, which the import check cannot see and which would collapse silently when Phase 4 deletes the stylesheet. There is one such bridge today and it is now declared.
2026-07-30 10:00:48 -06:00
/*
* A statistic carries its own spacing rather than relying on a parent to supply
* it: unmigrated pages still drop these inside Semantic's `Statistic.Group`,
* whose CSS only spaces elements carrying Semantic's own classes, and without
* this the labels run together into one unreadable line.
*/
.wrolpi-statistic {
display: inline-block;
vertical-align: top;
margin: 0 26px 10px 0;
}
/* Inside our own group the grid does the spacing, so the intrinsic margin goes. */
.wrolpi-statistic-cell .wrolpi-statistic {
display: block;
margin: 0;
}
ui: token-driven component library on Mantine Adds src/components/ui: buttons, messages, labels, progress, status, tables, form controls, panels, cards, statistics, modals, tooltips, tabs, and icons. Everything resolves its colors through theme tokens, so no component branches on the current theme, and Semantic UI keeps rendering the app meanwhile. Mantine is bridged rather than restyled: its own CSS variables are pointed at our tokens. Four details were not obvious, and each caused a visible defect in night mode before being fixed: - Structural colors must go in the resolver's light/dark blocks. Mantine emits its values under [data-mantine-color-scheme], which outranks the :root block that `variables` becomes, so its grays were winning. - The dark and gray palettes are mapped shade by shade to tokens. Mantine reads them directly for table borders, zebra stripes and input chrome; they can be neither flattened nor left alone. - Mantine writes --button-* as inline styles, which no stylesheet can outrank, so the dashed danger treatment sets real properties instead. - Switch colors are written onto inner elements, so they need scoped CSS rather than a variable on the root. Adds a --knob token for control handles, because Mantine's default thumb follows theme.white, which is near-black in the dark-based themes. An audit of every painted pixel in the /theme-sample gallery now finds no non-red channel in night mode. Icons come from @tabler/icons-react with the 102 Semantic names the app uses mapped to components; they stroke with currentColor, so they follow the theme without any rule of their own. Toasts keep the react-semantic-toasts-2 signature so those call sites migrate by changing an import. TypeScript 5 is required: Mantine's declarations use `const` type parameters, which 4.9 cannot parse (Mantine 7 is the same, so downgrading is no escape). That needs two npm overrides to keep clean installs working, both verified against a Docker build: react-scripts declares peerOptional typescript ^3||^4, and fork-ts-checker 6.5.2 assigns typescript.performance.mark, which TS 5 made getter-only - crashing the dev server's type checker on every rebuild. semantic-baseline.test.js ratchets the removal: it fails if a file not already listed imports Semantic UI. An ESLint rule would have printed 75 warnings per rebuild, and CI unsets CI= for its build step, so it would guard nothing there. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-29 19:22:03 -06:00
.wrolpi-statistic-value {
font-size: 24px;
font-weight: 600;
font-variant-numeric: tabular-nums;
line-height: 1.15;
}
.wrolpi-statistic-label {
font-size: 11px;
letter-spacing: 0.1em;
text-transform: uppercase;
color: var(--muted);
margin-top: 2px;
}
/* ---------------------------------------------------------------- Status */
/*
* Status is encoded by hue in light/dark. In night mode hue is unavailable, so
* brightness carries it instead: dim = done, mid = active, brightest + bold =
* failed. Callers use these classes rather than naming a color.
*/
.wrolpi-status {
font-size: 12.5px;
font-weight: 500;
display: inline-flex;
align-items: center;
gap: 5px;
}
.wrolpi-status-complete {
color: var(--green);
}
.wrolpi-status-active {
color: var(--blue);
}
.wrolpi-status-pending {
color: var(--muted);
}
.wrolpi-status-failed {
color: var(--red);
}
html[data-theme="night"] .wrolpi-status-complete {
color: var(--muted);
}
html[data-theme="night"] .wrolpi-status-active {
color: var(--text);
}
html[data-theme="night"] .wrolpi-status-failed {
color: var(--red);
font-weight: 500;
}
/* ----------------------------------------------------------------- Tables */
ui: nine leaf files off Semantic, and the components they needed Phase 2, part 2. Baseline 72 -> 63. Migrated: Tables, SortableTable, DonatePage, Share, Headline, ErrorBoundary, and the QR code, VIN decoder, and temperature calculators. New in the library, all in the gallery and tested: SearchBox Semantic's `<Search category>`, keeping its grouped `results` shape because four call sites already build it. A real combobox: arrows move, Enter takes the highlighted suggestion or submits the raw text, Escape closes without clearing. Pagination Semantic's prop names, but onPageChange gets the page number rather than an (event, data) pair. TabBar the strip and its house style only; routing stays at the call site, which is what decides what is active. IconStack two glyphs composed into one symbol, named once for assistive technology (Semantic's IconGroup). Table.HeaderCell gains `sorted` and `onSort`. That last one is a fix, not just a port. Semantic's `sorted` prop set `aria-sort`; migrating a table by hand dropped it, leaving a clickable <th> that no keyboard could reach and no screen reader could describe. Putting it in the library means the next table gets it right without anyone remembering. Night mode holes closed along the way: the QR codes on the donate, share, and calculator pages are white by necessity — a scanner needs the contrast — and they render as SVG, which the media filter does not target. In night mode that was a lit panel. They now carry `.media`, so the filter remaps the block as a unit and the contrast survives the mapping. Also: `paypal` joins the icon map rather than being imported ad hoc in a page, and FileBrowser stops passing Semantic-only table props into a DOM element.
2026-07-30 09:31:15 -06:00
/* A sortable header: a real button, so the column is reachable by keyboard. */
.wrolpi-th-sort {
display: inline-flex;
align-items: center;
gap: 5px;
background: none;
border: none;
padding: 0;
margin: 0;
font: inherit;
color: inherit;
cursor: pointer;
white-space: nowrap;
}
/* The unsorted columns show a faint arrow: the affordance is visible, but it does
not compete with the column actually doing the sorting. */
.wrolpi-th-sort-idle {
opacity: 0.35;
}
.wrolpi-th-sort:hover .wrolpi-th-sort-idle {
opacity: 0.7;
}
.wrolpi-th-sort:focus-visible {
outline: 2px solid var(--blue);
outline-offset: 2px;
}
html[data-theme="night"] .wrolpi-th-sort:focus-visible,
html[data-theme="amber"] .wrolpi-th-sort:focus-visible {
outline-color: var(--text);
}
ui: token-driven component library on Mantine Adds src/components/ui: buttons, messages, labels, progress, status, tables, form controls, panels, cards, statistics, modals, tooltips, tabs, and icons. Everything resolves its colors through theme tokens, so no component branches on the current theme, and Semantic UI keeps rendering the app meanwhile. Mantine is bridged rather than restyled: its own CSS variables are pointed at our tokens. Four details were not obvious, and each caused a visible defect in night mode before being fixed: - Structural colors must go in the resolver's light/dark blocks. Mantine emits its values under [data-mantine-color-scheme], which outranks the :root block that `variables` becomes, so its grays were winning. - The dark and gray palettes are mapped shade by shade to tokens. Mantine reads them directly for table borders, zebra stripes and input chrome; they can be neither flattened nor left alone. - Mantine writes --button-* as inline styles, which no stylesheet can outrank, so the dashed danger treatment sets real properties instead. - Switch colors are written onto inner elements, so they need scoped CSS rather than a variable on the root. Adds a --knob token for control handles, because Mantine's default thumb follows theme.white, which is near-black in the dark-based themes. An audit of every painted pixel in the /theme-sample gallery now finds no non-red channel in night mode. Icons come from @tabler/icons-react with the 102 Semantic names the app uses mapped to components; they stroke with currentColor, so they follow the theme without any rule of their own. Toasts keep the react-semantic-toasts-2 signature so those call sites migrate by changing an import. TypeScript 5 is required: Mantine's declarations use `const` type parameters, which 4.9 cannot parse (Mantine 7 is the same, so downgrading is no escape). That needs two npm overrides to keep clean installs working, both verified against a Docker build: react-scripts declares peerOptional typescript ^3||^4, and fork-ts-checker 6.5.2 assigns typescript.performance.mark, which TS 5 made getter-only - crashing the dev server's type checker on every rebuild. semantic-baseline.test.js ratchets the removal: it fails if a file not already listed imports Semantic UI. An ESLint rule would have printed 75 warnings per rebuild, and CI unsets CI= for its build step, so it would guard nothing there. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-29 19:22:03 -06:00
/* A failed row carries the danger border, matching failed messages. */
.wrolpi-row-failed > td {
border-top: 1.5px dashed var(--red);
border-bottom: 1.5px dashed var(--red);
}
.wrolpi-row-failed > td:first-child {
border-left: 1.5px dashed var(--red);
}
.wrolpi-row-failed > td:last-child {
border-right: 1.5px dashed var(--red);
}
/* Wide tables scroll inside their own container; the page never scrolls sideways. */
.wrolpi-table-scroll {
overflow-x: auto;
}