From dfde5e041516eeb9a9e06a138e5bc88fcc826d57 Mon Sep 17 00:00:00 2001 From: Hugo Gresse Date: Mon, 25 May 2026 23:38:54 +0200 Subject: [PATCH] Polish self-edit admin button + theme the Cap widget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two small UI tweaks asked for after the last self-edit pass: 1) Pending-edits button is no longer perpetually orange. When the pending queue is empty the button drops to variant="outlined" + color="primary" so the speaker self-edit accordion does not look alarmed by default. As soon as pendingCount > 0 it switches to variant="contained" + color="warning" so admins notice they have work to review. 2) Cap captcha widget now follows the host MUI theme. The upstream defaults are tuned for light surfaces and produce a near-white box on the dark theme, which clashes hard with Paper. CapWidget now reads useTheme() and writes the colour CSS custom properties (background, border, text, checkbox, spinner) on its container div. CSS variables cascade to the widget child, so the widget picks the overrides up without us reaching into its internals. Sizing / radius / padding stay on the widget defaults — only the colour tokens are themed. Light mode keeps the exact upstream values to avoid regressing existing deployments. Dark mode maps to MUI palette tokens (background.paper, text.primary, divider, action.hover, action.disabledBackground) so the widget tracks any theme customisation a deploy might apply. Frontend tsc clean; vite build succeeds. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../components/SpeakerSelfEditSettings.tsx | 8 ++- src/public/speakerEdit/CapWidget.tsx | 54 ++++++++++++++++++- 2 files changed, 58 insertions(+), 4 deletions(-) diff --git a/src/events/page/speakers/components/SpeakerSelfEditSettings.tsx b/src/events/page/speakers/components/SpeakerSelfEditSettings.tsx index 6464bd2..173c6be 100644 --- a/src/events/page/speakers/components/SpeakerSelfEditSettings.tsx +++ b/src/events/page/speakers/components/SpeakerSelfEditSettings.tsx @@ -117,10 +117,14 @@ export const SpeakerSelfEditSettings = ({ event }: SpeakerSelfEditSettingsProps) // dialog from the summary does NOT toggle the accordion. const renderPendingEditsButton = (placement: 'summary' | 'details') => { if (!event.speakerSelfEdit?.enabled) return null + // Only highlight in warning orange when there is actually a queue + // to review. Empty queue stays on the default theme colour so the + // accordion summary does not look perpetually alarmed. + const hasPending = pendingCount > 0 return (