Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat([issue-1924-ui]): remap ui/ off-token colors onto port-* tokens
[._.]/ Adam Eivy2f4e13fcbfad
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 99bd1d096f..5781937110 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -65,6 +65,7 @@- **[issue-1924] Digital Twin theme consistency** — remapped off-token colors across the Digital Twin UI (overview, identity, enrichment, taste, testing, goals, and the rest of its tabs) onto the existing `--port-*` theme tokens, so status badges, score gradients, and AI-content highlights now follow the active theme instead of staying a fixed hue. Per-platform/per-category color palettes that intentionally differentiate unrelated items (e.g. social-account platform badges, test-category badges) were left as-is. (#1924)- **[issue-1909] `cos/TerminalCoSPanel.jsx` foreground+background re-themed together** — the panel's background had been intentionally left pinned to a fixed dark hex because the inner content hardcoded light text and status colors, so swapping the background alone onto the (lighter, in day themes) `--port-terminal-bg` token would have rendered light-on-light. The background now uses that token and the inner text uses opacity tiers of the paired `--port-terminal-text` token — blending foreground into background keeps contrast correct whether the active theme's terminal surface is dark or light — while the traffic-light dots, status indicators, log levels, and start/stop buttons move onto the existing `port-success`/`port-warning`/`port-error`/`port-accent` tokens. Refs #1909 — the remainder of the ~900-site sweep stays tracked there.- **[issue-1924] Chief of Staff panel theme consistency** — remapped off-token colors across the Chief of Staff dashboard (task list, agent cards, memory/learning/productivity/health/digest tabs, schedule editor, terminal event log) onto the existing `--port-*` theme tokens, so status badges, metric highlights, and AI-content accents now follow the active theme instead of staying a fixed blue/green/cyan/purple. Fixed 7-hue category-color palettes that intentionally differentiate unrelated categories — the per-agent-state mood colors (`AGENT_STATES`), the memory-type badge palette (`MEMORY_TYPE_COLORS`), and the workflow-stage palette (`STAGE_COLORS`) — were deliberately left as raw hues; collapsing them onto the ~4-5 available semantic tokens would make several of those categories render identically. Also documented (not yet fixed) a known contrast gap: the mood-color enum's amber "thinking" state is hard to read against light day themes in the 2 consumers with a theme-aware background; a full per-theme fix is blocked because most consumers feed the color straight into three.js material props, which can't resolve CSS custom properties. Refs #1909, Refs #1924 — remaining feature areas (`meatspace/` remainder, `city/`, `ui/`, `goals/`, `brain/`, `apps/`, `pipeline/`, `messages/`, `agents/`, `writers-room/`, `wiki/`, `settings/`, `gsd/`, `voice/`, and the rest of `client/src/pages/`) stay tracked there.+- **[issue-1924-ui] Shared UI primitives theme consistency** — remapped off-token colors in `client/src/components/ui/`: the diff renderers (`diffRuns.jsx`, `InlineDiff.jsx`, `SideBySideDiff.jsx`, `HunkDiff.jsx`) now highlight removed/added text with `--port-error`/`--port-success` instead of fixed red/green, and the shared `Toast.jsx` success/error/warning toast colors move onto `--port-success`/`--port-error`/`--port-warning`. Every site in this slice was a binary or tri-state semantic (removed vs. added, success vs. error vs. warning) rather than a category-color enum, so nothing needed to be left alone. Refs #1924.## UX & Accessibilitydiff --git a/client/src/components/ui/HunkDiff.jsx b/client/src/components/ui/HunkDiff.jsxindex d0aa6085af..67d847176e 100644--- a/client/src/components/ui/HunkDiff.jsx+++ b/client/src/components/ui/HunkDiff.jsx@@ -21,11 +21,11 @@ function ChangeBlock({ oldLines, newLines }) {const { tooLarge, oldRuns, newRuns } = useMemo(() => diffWords(oldText, newText), [oldText, newText]);return (<div className="flex gap-4 px-3 py-2 bg-port-card/50 border-y border-port-border/60">- <div className="min-w-0 flex-1 whitespace-pre-wrap break-words leading-relaxed text-red-200">- {tooLarge ? <span className="text-red-400">{oldText}</span> : renderRuns(oldRuns, false)}+ <div className="min-w-0 flex-1 whitespace-pre-wrap break-words leading-relaxed text-port-error">+ {tooLarge ? <span className="text-port-error">{oldText}</span> : renderRuns(oldRuns, false)}</div>- <div className="min-w-0 flex-1 whitespace-pre-wrap break-words leading-relaxed text-green-200">- {tooLarge ? <span className="text-green-400">{newText}</span> : renderRuns(newRuns, true)}+ <div className="min-w-0 flex-1 whitespace-pre-wrap break-words leading-relaxed text-port-success">+ {tooLarge ? <span className="text-port-success">{newText}</span> : renderRuns(newRuns, true)}</div></div>);diff --git a/client/src/components/ui/HunkDiff.test.jsx b/client/src/components/ui/HunkDiff.test.jsxindex 32279067fa..b505026a3f 100644--- a/client/src/components/ui/HunkDiff.test.jsx+++ b/client/src/components/ui/HunkDiff.test.jsx@@ -15,8 +15,8 @@ describe('HunkDiff', () => {const oldText = `${lines('top', 3)}\nThe cat sat here\n${lines('bottom', 3)}`;const newText = `${lines('top', 3)}\nThe dog sat here\n${lines('bottom', 3)}`;const { container } = render(<HunkDiff oldText={oldText} newText={newText} />);- const removed = container.querySelectorAll('.bg-red-900\\/50');- const added = container.querySelectorAll('.bg-green-900\\/50');+ const removed = container.querySelectorAll('.bg-port-error\\/50');+ const added = container.querySelectorAll('.bg-port-success\\/50');expect(removed).toHaveLength(1);expect(added).toHaveLength(1);expect(removed[0].textContent).toBe('cat');@@ -41,7 +41,7 @@ describe('HunkDiff', () => {const oldText = `${body}\nmiddle cat paragraph\n${body}`;const newText = `${body}\nmiddle dog paragraph\n${body}`;const { container } = render(<HunkDiff oldText={oldText} newText={newText} />);- const removed = container.querySelectorAll('.bg-red-900\\/50');+ const removed = container.querySelectorAll('.bg-port-error\\/50');expect(removed).toHaveLength(1);expect(removed[0].textContent).toBe('cat');expect(screen.queryByText(/Diff too large/)).not.toBeInTheDocument();diff --git a/client/src/components/ui/InlineDiff.jsx b/client/src/components/ui/InlineDiff.jsxindex 5ce34bfa0e..2795c923f3 100644--- a/client/src/components/ui/InlineDiff.jsx+++ b/client/src/components/ui/InlineDiff.jsx@@ -32,16 +32,16 @@ const InlineDiff = memo(function InlineDiff({ oldText, newText, emptyLabel = 'No<div className="text-gray-500 text-[11px] uppercase tracking-wider">Diff too large for inline highlighting — both versions shown in full</div>- <div className="text-red-400 leading-relaxed whitespace-pre-wrap">{oldStr}</div>- <div className="text-green-400 leading-relaxed whitespace-pre-wrap">{newStr}</div>+ <div className="text-port-error leading-relaxed whitespace-pre-wrap">{oldStr}</div>+ <div className="text-port-success leading-relaxed whitespace-pre-wrap">{newStr}</div></div>);}return (<div className="font-mono text-xs p-4 space-y-2 bg-port-bg">- <div className="text-red-400 leading-relaxed whitespace-pre-wrap">{renderRuns(oldRuns, false)}</div>- <div className="text-green-400 leading-relaxed whitespace-pre-wrap">{renderRuns(newRuns, true)}</div>+ <div className="text-port-error leading-relaxed whitespace-pre-wrap">{renderRuns(oldRuns, false)}</div>+ <div className="text-port-success leading-relaxed whitespace-pre-wrap">{renderRuns(newRuns, true)}</div></div>);});diff --git a/client/src/components/ui/InlineDiff.test.jsx b/client/src/components/ui/InlineDiff.test.jsxindex e07d9343b8..d9b9380620 100644--- a/client/src/components/ui/InlineDiff.test.jsx+++ b/client/src/components/ui/InlineDiff.test.jsx@@ -18,15 +18,15 @@ describe('InlineDiff', () => {const { container } = render(<InlineDiff oldText="The cat sat" newText="The dog sat" />);expect(screen.queryByText('No changes.')).not.toBeInTheDocument();// Two stacked diff rows — the red (removed) and green (added) divs.- expect(container.querySelectorAll('.text-red-400')).toHaveLength(1);- expect(container.querySelectorAll('.text-green-400')).toHaveLength(1);+ expect(container.querySelectorAll('.text-port-error.leading-relaxed')).toHaveLength(1);+ expect(container.querySelectorAll('.text-port-success.leading-relaxed')).toHaveLength(1);});it('highlights only the changed words inside each row, not the unchanged ones', () => {const { container } = render(<InlineDiff oldText="The cat sat" newText="The dog sat" />);// Removed-word span lives inside the red row.- const removedSpans = container.querySelectorAll('.text-red-400 .bg-red-900\\/50');- const addedSpans = container.querySelectorAll('.text-green-400 .bg-green-900\\/50');+ const removedSpans = container.querySelectorAll('.text-port-error .bg-port-error\\/50');+ const addedSpans = container.querySelectorAll('.text-port-success .bg-port-success\\/50');expect(removedSpans).toHaveLength(1);expect(addedSpans).toHaveLength(1);expect(removedSpans[0].textContent).toBe('cat');@@ -45,7 +45,7 @@ describe('InlineDiff', () => {const { container } = render(<InlineDiff oldText={buildHuge('a')} newText={buildHuge('b')} />);expect(screen.getByText(/Diff too large/i)).toBeInTheDocument();// No per-word highlight spans — just the two flat color blocks.- expect(container.querySelectorAll('.bg-red-900\\/50, .bg-green-900\\/50')).toHaveLength(0);+ expect(container.querySelectorAll('.bg-port-error\\/50, .bg-port-success\\/50')).toHaveLength(0);});it('stays within the LCS path when one side is short, even if the other is long', () => {diff --git a/client/src/components/ui/SideBySideDiff.jsx b/client/src/components/ui/SideBySideDiff.jsxindex 4aad2220d4..e884ca0440 100644--- a/client/src/components/ui/SideBySideDiff.jsx+++ b/client/src/components/ui/SideBySideDiff.jsx@@ -43,8 +43,8 @@ const SideBySideDiff = memo(function SideBySideDiff({Diff too large for word highlighting — both versions shown in full</div><div className="flex gap-4">- <Column label={oldLabel}><span className="text-red-400">{oldStr}</span></Column>- <Column label={newLabel}><span className="text-green-400">{newStr}</span></Column>+ <Column label={oldLabel}><span className="text-port-error">{oldStr}</span></Column>+ <Column label={newLabel}><span className="text-port-success">{newStr}</span></Column></div></div>);@@ -53,8 +53,8 @@ const SideBySideDiff = memo(function SideBySideDiff({return (<div className="font-mono text-xs p-4 bg-port-bg"><div className="flex gap-4">- <Column label={oldLabel}><span className="text-red-200">{renderRuns(oldRuns, false)}</span></Column>- <Column label={newLabel}><span className="text-green-200">{renderRuns(newRuns, true)}</span></Column>+ <Column label={oldLabel}><span className="text-port-error">{renderRuns(oldRuns, false)}</span></Column>+ <Column label={newLabel}><span className="text-port-success">{renderRuns(newRuns, true)}</span></Column></div></div>);diff --git a/client/src/components/ui/SideBySideDiff.test.jsx b/client/src/components/ui/SideBySideDiff.test.jsxindex dfdba3ff8a..038d11de3a 100644--- a/client/src/components/ui/SideBySideDiff.test.jsx+++ b/client/src/components/ui/SideBySideDiff.test.jsx@@ -18,8 +18,8 @@ describe('SideBySideDiff', () => {it('highlights removed words on the left and added words on the right', () => {const { container } = render(<SideBySideDiff oldText="The cat sat" newText="The dog sat" />);- const removed = container.querySelectorAll('.bg-red-900\\/50');- const added = container.querySelectorAll('.bg-green-900\\/50');+ const removed = container.querySelectorAll('.bg-port-error\\/50');+ const added = container.querySelectorAll('.bg-port-success\\/50');expect(removed).toHaveLength(1);expect(added).toHaveLength(1);expect(removed[0].textContent).toBe('cat');@@ -30,7 +30,7 @@ describe('SideBySideDiff', () => {const build = (p) => Array.from({ length: 2500 }, (_, i) => `${p}${i}`).join(' ');const { container } = render(<SideBySideDiff oldText={build('a')} newText={build('b')} />);expect(screen.getByText(/Diff too large/i)).toBeInTheDocument();- expect(container.querySelectorAll('.bg-red-900\\/50, .bg-green-900\\/50')).toHaveLength(0);+ expect(container.querySelectorAll('.bg-port-error\\/50, .bg-port-success\\/50')).toHaveLength(0);});it('treats null/undefined as empty (identical → empty label)', () => {diff --git a/client/src/components/ui/Toast.jsx b/client/src/components/ui/Toast.jsxindex 895d494d80..c28cfe5213 100644--- a/client/src/components/ui/Toast.jsx+++ b/client/src/components/ui/Toast.jsx@@ -77,7 +77,7 @@ export const toast = Object.assign(export default toast;const TYPE_ICON = { success: '✓', error: '✕', loading: '⟳', warning: '⚠' };-const TYPE_CLASS = { success: 'text-green-400', error: 'text-red-400', loading: 'text-gray-400 animate-spin', warning: 'text-yellow-400' };+const TYPE_CLASS = { success: 'text-port-success', error: 'text-port-error', loading: 'text-gray-400 animate-spin', warning: 'text-port-warning' };export function Toaster({ position = 'bottom-right', toastOptions = {} }) {const [items, setItems] = useState([]);diff --git a/client/src/components/ui/diffRuns.jsx b/client/src/components/ui/diffRuns.jsxindex 83774b46d3..9868bd193c 100644--- a/client/src/components/ui/diffRuns.jsx+++ b/client/src/components/ui/diffRuns.jsx@@ -7,7 +7,7 @@export const renderRuns = (runs, added) =>runs.map((run, i) => (run.changed ? (- <span key={i} className={added ? 'bg-green-900/50 text-green-300' : 'bg-red-900/50 text-red-300'}>+ <span key={i} className={added ? 'bg-port-success/50 text-port-success' : 'bg-port-error/50 text-port-error'}>{run.text}</span>) : (