Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
fix(dashboard): lighten the tint of the action required badge
Yudhi Armyndharis8ebffe14734f
diff --git a/dashboard/src/pages/Sessions.css b/dashboard/src/pages/Sessions.cssindex eaa2cb55e..1acb668cf 100644--- a/dashboard/src/pages/Sessions.css+++ b/dashboard/src/pages/Sessions.css@@ -678,12 +678,18 @@/* Same amber token as the transient states above — a literal here was the only pill not on a themevariable, and it lost contrast on the dark card. The heavier tint is what separates "needs a human"from the in-progress amber, since the two must not read alike. */-.sessions-page .status-pill.action_required,-.sessions-page .status-badge.action_required {+.sessions-page .status-pill.action_required {background: rgba(245, 158, 11, 0.22);color: var(--warning-text);}+/* The detail badge spells the status out beside its own label, so it takes the 10 percent tint of the other+ badges: --warning-text is 4.76:1 on it, 4.34:1 on the pill's 22 percent. */+.sessions-page .status-badge.action_required {+ background: rgba(245, 158, 11, 0.1);+ color: var(--warning-text);+}+.sessions-page .status-pill.ready,.sessions-page .status-badge.ready {background: rgba(34, 197, 94, 0.1);diff --git a/dashboard/src/theme-contrast.test.ts b/dashboard/src/theme-contrast.test.tsindex e0c0637bc..467c85162 100644--- a/dashboard/src/theme-contrast.test.ts+++ b/dashboard/src/theme-contrast.test.ts@@ -132,6 +132,25 @@ test('the action required pill clears 4.5:1 on its tint in the dark theme, with}});+// The detail modal repeats the status as a badge beside its own "Status" label. The 22 percent tint the card pill+// uses leaves --warning-text at 4.34:1 on white there, so the badge takes the 10 percent tint every other+// status badge has.+test('the action required badge in the session details clears 4.5:1 on its tint in every theme', () => {+ const rule =+ /\.sessions-page \.status-badge\.action_required\s*\{[^}]*background:\s*rgba\(245,\s*158,\s*11,\s*([\d.]+)\)/.exec(+ read('Sessions.css'),+ );+ assert.ok(rule, 'Sessions.css has no amber tint for the action required badge');+ for (const anchor of [LIGHT, ...DARKS]) {+ const block = blockAfter(anchor);+ for (const surface of ['--bg-white', '--bg-light']) {+ const tint = mix(rgb(hexOf(blockAfter(LIGHT), '--warning')), Number(rule[1]), rgb(hexOf(block, surface)));+ const ratio = contrast(rgb(hexOf(block, '--warning-text')), tint);+ assert.ok(ratio >= 4.5, `${anchor} badge text on ${rule[1]} over ${surface} is ${ratio.toFixed(2)}:1`);+ }+ }+});+test('the search match and the Number Checker highlight pill clear AA in both themes', () => {const search = readFileSync(join(dirname(fileURLToPath(import.meta.url)), 'components/GlobalSearch.css'), 'utf8');const mark =