From a2d1ed935d47786d018cdf7279a5bd156607af1a Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Mon, 13 Jul 2026 21:51:23 -0400 Subject: [PATCH] refactor(ui): DRY the settings-card CSS tokens + fix unstyled headers (#161) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Promote .fc-section-h to a global token (app.css). It was copied identically into 4 cards, and TranslationCard used the class with NO local def — so its section headers rendered unstyled. Now fixed everywhere. - Promote .fc-good / .fc-weak status colours to globals; delete the local copies in the GPU/heads cards. (.fc-ok stays local — divergent: on-surface in HeadsCard vs success in QueuesTable. .fc-bad stays — different name.) - Delete 10 identical local .fc-muted redefinitions that crept back after the 2026-06-09 sweep; the global utility already covers them. - DbMaintenanceCard: opacity:0.6 muted text → the .fc-muted token (the exact anti-pattern that token's comment forbids). - HeadsCard: collapse byte-identical ratePct() into pct(). CSS-only + one template class swap; no logic change. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01NsmJSQxnNxGgtM5Yz4GAqi --- .../src/components/settings/CropProposersCard.vue | 5 ----- .../src/components/settings/DangerZoneCard.vue | 1 - .../src/components/settings/DbMaintenanceCard.vue | 2 +- .../components/settings/DownloadsActivityPanel.vue | 1 - .../src/components/settings/GpuActivityPanel.vue | 2 -- frontend/src/components/settings/GpuAgentCard.vue | 7 ------- frontend/src/components/settings/GpuTriageCard.vue | 7 ------- frontend/src/components/settings/HeadsCard.vue | 11 +---------- .../src/components/settings/MLBackfillCard.vue | 1 - frontend/src/styles/app.css | 14 ++++++++++++++ frontend/src/views/ExploreView.vue | 1 - frontend/src/views/TagsView.vue | 1 - 12 files changed, 16 insertions(+), 37 deletions(-) diff --git a/frontend/src/components/settings/CropProposersCard.vue b/frontend/src/components/settings/CropProposersCard.vue index 46edd54..64bb570 100644 --- a/frontend/src/components/settings/CropProposersCard.vue +++ b/frontend/src/components/settings/CropProposersCard.vue @@ -131,11 +131,6 @@ function saveToggle (p, v) { diff --git a/frontend/src/components/settings/GpuActivityPanel.vue b/frontend/src/components/settings/GpuActivityPanel.vue index 7378309..39bba29 100644 --- a/frontend/src/components/settings/GpuActivityPanel.vue +++ b/frontend/src/components/settings/GpuActivityPanel.vue @@ -95,7 +95,6 @@ onUnmounted(() => { if (pollId) clearInterval(pollId) }) diff --git a/frontend/src/components/settings/GpuAgentCard.vue b/frontend/src/components/settings/GpuAgentCard.vue index b9a8492..fca73fa 100644 --- a/frontend/src/components/settings/GpuAgentCard.vue +++ b/frontend/src/components/settings/GpuAgentCard.vue @@ -367,11 +367,6 @@ async function onReprocess() { diff --git a/frontend/src/components/settings/GpuTriageCard.vue b/frontend/src/components/settings/GpuTriageCard.vue index a2ab8ac..6f24c38 100644 --- a/frontend/src/components/settings/GpuTriageCard.vue +++ b/frontend/src/components/settings/GpuTriageCard.vue @@ -155,11 +155,6 @@ async function onRecover(it) { diff --git a/frontend/src/components/settings/MLBackfillCard.vue b/frontend/src/components/settings/MLBackfillCard.vue index 3becc59..aca226a 100644 --- a/frontend/src/components/settings/MLBackfillCard.vue +++ b/frontend/src/components/settings/MLBackfillCard.vue @@ -80,5 +80,4 @@ async function run() { diff --git a/frontend/src/styles/app.css b/frontend/src/styles/app.css index e9f9552..3e24a75 100644 --- a/frontend/src/styles/app.css +++ b/frontend/src/styles/app.css @@ -40,6 +40,20 @@ emits, so no specificity/reorder fight — no !important needed. */ .fc-muted { color: rgb(var(--v-theme-on-surface-variant)); } +/* Section sub-heading in settings cards (DRY pass #161): was redefined + identically in 4 cards, and TranslationCard used the class with NO local def + so its section headers rendered unstyled. Now one global utility. */ +.fc-section-h { + font-size: 13px; font-weight: 700; letter-spacing: 0.03em; + text-transform: uppercase; color: rgb(var(--v-theme-on-surface)); +} + +/* Status text colours (DRY pass #161): fc-good = success, fc-weak = error, + consolidated from the GPU / heads cards. fc-ok is intentionally NOT global — + it means on-surface in HeadsCard but success in QueuesTable. */ +.fc-good { color: rgb(var(--v-theme-success)); } +.fc-weak { color: rgb(var(--v-theme-error)); } + /* Vuetify 4 dropped its global CSS reset (normalisation moved into each component). FC's layouts assumed the reset zeroed margins on text elements, so restore just that — the "minimal reset" from the v4 upgrade guide — inside diff --git a/frontend/src/views/ExploreView.vue b/frontend/src/views/ExploreView.vue index e352b99..611c95d 100644 --- a/frontend/src/views/ExploreView.vue +++ b/frontend/src/views/ExploreView.vue @@ -284,7 +284,6 @@ onUnmounted(() => {