ui: theme picker in Settings, and ship the component gallery

The gallery at /theme-sample is now a normal route rather than a development
one, and Settings links to it, so a user can see what a theme actually looks
like before committing to it. Every new component belongs in the gallery: it is
how the design gets reviewed, and how a component that only looks wrong in one
of the four themes gets caught.

Settings gains a Theme section with the new ThemePicker, which explains what
each theme is for - notably that night mode filters videos, documents and maps
to red as well, not just the interface.

Theme names and picker options move to themes/names.ts so the component library
can read them without importing components/Theme.tsx, which still pulls in
Semantic UI. Theme.tsx re-exports them, so existing call sites are unchanged.
The navigation bar's compact picker now reads the same list, so the two cannot
drift apart.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Roland 2026-07-29 19:38:04 -06:00
parent 1bf8ea3da8
commit ea50ee2f16
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
10 changed files with 290 additions and 52 deletions

View file

@ -21,6 +21,7 @@ import {
TextInput,
Textarea,
Checkbox,
ThemePicker,
Toggle,
Tooltip,
toast,
@ -28,11 +29,14 @@ import {
import {semanticColorNames} from '../themes/mantine';
/*
* A gallery of every component in the new library, in the current theme.
* A gallery of every component in the library, in the current theme.
*
* Reachable at /theme-sample. This exists to review the design and to catch a
* component that looks wrong in one of the four themes; it is not linked from
* the navigation.
* Reachable at /theme-sample and linked from Settings, so a user can see a theme
* before committing to it.
*
* EVERY new component belongs here. It is how we review the design and how we
* catch a component that only looks wrong in one of the four themes — which has
* already happened more than once.
*/
const Section = ({label, children}) => <section style={{marginBottom: 34}}>
@ -56,20 +60,18 @@ export function ThemeSamplePage() {
return <div style={{maxWidth: 1060, margin: '0 auto', padding: '20px 16px 60px', color: 'var(--text)'}}>
<h1 style={{fontSize: 21, fontWeight: 600, margin: '8px 0 4px'}}>Component gallery</h1>
<p style={{color: 'var(--muted)', fontSize: 13, marginTop: 0}}>
Every component in the new library, rendered in the <strong>{theme}</strong> theme.
Every component in the WROLPi interface library, rendered in the <strong>{theme}</strong> theme.
Switch themes here or from the navigation bar.
</p>
<Section label='Themes'>
<Row>
{['light', 'dark', 'night', 'amber'].map(name => <Button
key={name}
variant={theme === name ? 'filled' : 'default'}
onClick={() => setTheme(name)}
>
{name}
</Button>)}
</Row>
<Section label='Theme picker'>
<Panel>
<ThemePicker/>
<p style={{fontSize: 12, color: 'var(--muted)', marginBottom: 0, marginTop: 12}}>
The same picker the Settings page uses. The navigation bar has a compact
version; both read the same list of themes.
</p>
</Panel>
</Section>
<Section label='Statistics'>