Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(control-ui): align connector Access tab legend colors with design tokens

M52dbe874901f
diff --git a/control-ui/app/globals.css b/control-ui/app/globals.css
index 2ea8c1f80..8827633cc 100644
--- a/control-ui/app/globals.css
+++ b/control-ui/app/globals.css
@@ -22,7 +22,9 @@
--cu-danger: #f87171;
--cu-danger-hover: #fca5a5;
--cu-success: #66b88f;
+ --cu-success-muted: rgba(102, 184, 143, 0.2);
--cu-warning: #e8c27a;
+ --cu-warning-muted: rgba(232, 194, 122, 0.2);
--cu-accent-rgb: 67, 119, 250;
--cu-focus-rgb: 67, 119, 250;
--cu-success-rgb: 102, 184, 143;
@@ -145,7 +147,9 @@
--cu-danger: #bf4d47;
--cu-danger-hover: #a8423d;
--cu-success: #2f8a66;
+ --cu-success-muted: rgba(47, 138, 102, 0.14);
--cu-warning: #a16b2b;
+ --cu-warning-muted: rgba(161, 107, 43, 0.14);
--cu-accent-rgb: 67, 119, 250;
--cu-focus-rgb: 67, 119, 250;
--cu-success-rgb: 47, 138, 102;
@@ -2879,7 +2883,7 @@ td.cu-registry-description {
.cu-entity-access__intro > span {
color: var(--cu-text-muted);
- font-size: 0.7rem;
+ font-size: var(--cu-font-size-2xs);
font-weight: 600;
letter-spacing: 0.06em;
text-transform: uppercase;
@@ -2888,7 +2892,7 @@ td.cu-registry-description {
.cu-entity-access__intro > p {
margin: 0;
color: var(--cu-text-soft);
- font-size: 0.8125rem;
+ font-size: var(--cu-font-size-sm);
line-height: 1.45;
}
@@ -2945,7 +2949,7 @@ td.cu-registry-description {
.cu-entity-access__heading h4 {
margin: 0;
color: var(--cu-text);
- font-size: 0.75rem;
+ font-size: var(--cu-font-size-xs);
font-weight: 600;
letter-spacing: 0.04em;
text-transform: uppercase;
@@ -2959,20 +2963,20 @@ td.cu-registry-description {
padding: calc(var(--cu-space-1) / 3) var(--cu-space-1);
border: 1px solid rgba(var(--cu-accent-rgb), 0.35);
border-radius: var(--cu-radius-pill);
- background: rgba(var(--cu-accent-rgb), 0.14);
+ background: var(--cu-accent-muted);
color: var(--cu-text-muted);
- font-size: 0.75rem;
+ font-size: var(--cu-font-size-xs);
font-variant-numeric: tabular-nums;
}
.cu-entity-access__group[data-kind='teams'] .cu-entity-access__heading span {
- border-color: rgba(var(--cu-success-rgb), 0.35);
- background: rgba(var(--cu-success-rgb), 0.12);
+ border-color: var(--cu-ok-border);
+ background: var(--cu-success-muted);
}
.cu-entity-access__group[data-kind='agents'] .cu-entity-access__heading span {
- border-color: rgba(var(--cu-warning-rgb), 0.35);
- background: rgba(var(--cu-warning-rgb), 0.12);
+ border-color: var(--cu-warn-border);
+ background: var(--cu-warning-muted);
}
.cu-entity-access__list {
@@ -2983,7 +2987,7 @@ td.cu-registry-description {
padding: 0;
overflow: auto;
color: var(--cu-text-soft);
- font-size: 0.8125rem;
+ font-size: var(--cu-font-size-sm);
list-style: none;
}
@@ -3019,7 +3023,7 @@ td.cu-registry-description {
.cu-entity-access__group .cu-muted {
margin: 0;
- font-size: 0.8125rem;
+ font-size: var(--cu-font-size-sm);
}
.cu-registry-install-access-summary {
diff --git a/control-ui/lib/__tests__/connectorAccessStyles.test.ts b/control-ui/lib/__tests__/connectorAccessStyles.test.ts
new file mode 100644
index 000000000..2273f2bd3
--- /dev/null
+++ b/control-ui/lib/__tests__/connectorAccessStyles.test.ts
@@ -0,0 +1,73 @@
+import { describe, expect, it } from 'vitest'
+import { readFileSync } from 'node:fs'
+import { resolve } from 'node:path'
+
+const css = readFileSync(resolve(__dirname, '../../app/globals.css'), 'utf8')
+
+function cssRuleBody(selector: string) {
+ const escaped = selector.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
+ const match = css.match(new RegExp(`(?:^|\\n)${escaped}\\s*\\{([^}]*)\\}`, 'm'))
+ if (!match) throw new Error(`Missing CSS rule for ${selector}`)
+ return match[1]
+}
+
+// Both theme blocks (:root/dark and :root[data-theme='light']) must declare
+// the token; an undeclared var() silently drops the whole declaration.
+function themeTokenDeclarations(token: string): string[] {
+ const declarations = [...css.matchAll(new RegExp(`${token}:\\s*([^;]+);`, 'g'))].map(match =>
+ match[1].trim()
+ )
+ if (declarations.length !== 2) {
+ throw new Error(
+ `${token} must be declared exactly twice (dark + light themes), found ${declarations.length}`
+ )
+ }
+ return declarations
+}
+
+// The connector edit Access tab renders .cu-entity-access legend cards. Its
+// colors must come from the declared tokens — theme-aware muted tints instead
+// of per-rule rgba() derivations, and the font-size scale instead of raw rem.
+describe('Connector Access tab stylesheet contract', () => {
+ it('derives the count-chip tints from the muted accent tokens', () => {
+ expect(cssRuleBody('.cu-entity-access__heading span')).toMatch(
+ /background:\s*var\(--cu-accent-muted\)/
+ )
+ expect(
+ cssRuleBody(".cu-entity-access__group[data-kind='teams'] .cu-entity-access__heading span")
+ ).toMatch(/background:\s*var\(--cu-success-muted\)/)
+ expect(
+ cssRuleBody(".cu-entity-access__group[data-kind='agents'] .cu-entity-access__heading span")
+ ).toMatch(/background:\s*var\(--cu-warning-muted\)/)
+ })
+
+ it('uses the established ok/warn border tokens for the team and agent chips', () => {
+ expect(
+ cssRuleBody(".cu-entity-access__group[data-kind='teams'] .cu-entity-access__heading span")
+ ).toMatch(/border-color:\s*var\(--cu-ok-border\)/)
+ expect(
+ cssRuleBody(".cu-entity-access__group[data-kind='agents'] .cu-entity-access__heading span")
+ ).toMatch(/border-color:\s*var\(--cu-warn-border\)/)
+ })
+
+ it('declares the muted tint tokens in both themes so the chips never resolve to nothing', () => {
+ for (const token of ['--cu-success-muted', '--cu-warning-muted']) {
+ for (const value of themeTokenDeclarations(token)) {
+ expect(value).toMatch(/^rgba\(/)
+ }
+ }
+ })
+
+ it('keeps the legend typography on the declared font-size scale', () => {
+ expect(cssRuleBody('.cu-entity-access__intro > span')).toMatch(
+ /font-size:\s*var\(--cu-font-size-2xs\)/
+ )
+ expect(cssRuleBody('.cu-entity-access__heading h4')).toMatch(
+ /font-size:\s*var\(--cu-font-size-xs\)/
+ )
+ expect(cssRuleBody('.cu-entity-access__heading span')).toMatch(
+ /font-size:\s*var\(--cu-font-size-xs\)/
+ )
+ expect(cssRuleBody('.cu-entity-access__list')).toMatch(/font-size:\s*var\(--cu-font-size-sm\)/)
+ })
+})
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 36ad3dd9a..b51d90ec0 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.664",
+ "version": "0.1.665",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.664",
+ "version": "0.1.665",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/frontend-components": "file:../packages/frontend-components",
diff --git a/control-ui/package.json b/control-ui/package.json
index fa162db2a..d14ca7a0f 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.664",
+ "version": "0.1.665",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",