Consolidate hand-rolled UI into a catalog + shared primitives
Consolidate hand-rolled UI into a catalog + shared primitives
#20 in tonybierman/dx-blog — merged 2026-05-31
Consolidates UI components that were hand-rolled across pages into reusable, consistently-styled primitives — reducing duplication and standardizing the app's look and feel. Built up over the commits below.
Commits on this branch
- Adopt Dioxus catalog components across reader UI — first pass swapping hand-rolled reader widgets for the catalog.
- Use catalog Input for the search box.
- Widen single-sidebar layouts; match facet dropdowns to navbar chrome — layout/chrome consistency.
- Convert UI buttons to the catalog Button —
ButtonVariant(Primary/Secondary/Destructive/Outline/Ghost/Link) ×ButtonSize. - Adopt catalog Input/Textarea/Select for form fields — across the admin forms.
- Theme catalog components via tokens, not hard-coded colors — brand-map in
dx-components-theme.css, no hex/rgb literals. - Add surface/text primitives and adopt them across pages (final commit) — see below.
New project-local primitives (final commit)
components/surface—Panel(Filled / Outlined / Bleed × None/Sm/Md/Lg padding),Alert(Warning/Info/Success/Danger),Badge(Brand/Amber/Emerald/Red/Neutral × Tinted/Outlined, optional pulsing dot),StatusDot.components/text—PageTitle,SectionTitle(Default / Sidebar),Eyebrow(size/tone/as),ErrorText(block +inline).
Each conceptual element is now one component with named variant/tone/size enums, adopted across the reader, home, embeds, and all admin pages.
Notable fixes
- Spacing/size are props, not appended classes. A conflicting
mb-1/text-smappended after a basemb-3/text-xsloses to Tailwind source order, so the override silently failed. TheMb/EyebrowSizeprops emit exactly one utility — restoring the intended appearance on the appearance section headings and the post editor's Markdown/Preview labels. ErrorTextinlinevariant absorbs the last inline<span>error sites (admin shell, taxonomy, settings, post editor).
Intended visual convergences (worth an eyeball in review)
- Badges that were
rounded px-1.5(dashboard activity feed, reader "awaiting approval", comment status) are now the canonicalrounded-full px-2 py-0.5pill. PageTitle'smb-6now applies to homeBentoGridand readerTagFeed(previously no bottom margin) andSearchResults(wasmb-4).- Post editor: category/status selects gained visible field labels; the empty option was renamed to "Uncategorized".
Deliberately left alone
- The "New post" link is a router
Linkstyled as a primary button; it's a single occurrence and the catalogButtonrenders a<button>, so it has no clean target. <input type="file">/ range inputs have no catalog equivalent.
Verification
cargo checkclean on both targets (server--no-default-features --features server,sqlite; wasm--no-default-features --features web --target wasm32-unknown-unknown).cargo fmt --checkpasses.
🤖 Generated with Claude Code
Last updated 2026-05-31
Links to this note
Credits
Merged pull requests, newest first.