Brand-derived danger color + alert_dialog confirmation on destructive admin actions
Brand-derived danger color + alert_dialog confirmation on destructive admin actions
#22 in Riparion/riparion-cms — merged 2026-05-31
Summary
Two related admin/theming improvements on this branch:
Derive the destructive red from the accent hue —
--primary-error-color(delete buttons, invalid-input borders) now tracks--danger-hue, which leans with--brand-hueinside the red band, so destructive UI stays in sync when the accent is retuned instead of reading as a fixed stranger red.Confirm every destructive admin action via the catalog
alert_dialog— no admin delete fires without an explicit confirmation modal:- The shared
ActionButton(src/pages/admin/mod.rs) gains an optionalconfirm: Option<String>prop that gates the mutation behind anAlertDialog. Posts, comments, and taxonomy (category/tag) deletes pass it; non-destructive actions (approve/reject) stay immediate. - Media deletes use a dedicated
MediaDeleteButton(src/pages/admin/media.rs) that replaces the oldwindow.confirm()JS eval — it always prompts and, for in-use images, lazily fetches and lists the posts that would be left with a broken image. - Installs the
alert_dialogcatalog widget (src/components/alert_dialog/).
- The shared
Test plan
-
cargo clippyclean on both targets (server--features server,sqlite; wasm--features web) -
cargo fmt --checkpasses -
dx serve, sign into admin, and confirm each delete (Posts / Comments / Taxonomy / Media) opens a confirmation dialog and only deletes on confirm; media confirmation lists referencing posts for in-use images
🤖 Generated with Claude Code
Last updated 2026-06-01
Links to this note
Credits
Merged pull requests, newest first.