Skip to content

Self-improving AI Employees for everyone

feat(theme): chat tokens and keyframes, and readable reply markdown

trohitgcb65a53cc197
diff --git a/client/src/index.css b/client/src/index.css
index 49e73ad8..02d81f1d 100644
--- a/client/src/index.css
+++ b/client/src/index.css
@@ -187,6 +187,7 @@
--color-bg-hover: var(--bg-hover);
--color-bg-active: var(--bg-active);
--color-bg-overlay: var(--bg-overlay);
+ --color-bg-scrim-soft: var(--bg-scrim-soft);
--color-fg-default: var(--fg-default);
--color-fg-muted: var(--fg-muted);
@@ -256,6 +257,10 @@
--shadow-popover: var(--shadow-popover);
--shadow-dialog: var(--shadow-dialog);
--shadow-dock: var(--shadow-dock);
+ /* Design-system elevation steps (base.css, dark.css), used by the chat. */
+ --shadow-card: var(--shadow-card);
+ --shadow-card-hover: var(--shadow-card-hover);
+ --shadow-modal: var(--shadow-modal);
--blur-scrim: var(--blur-scrim);
@@ -284,6 +289,8 @@
--ease-spring: var(--ease-spring);
--ease-overshoot: var(--ease-overshoot);
--ease-reveal: var(--ease-reveal);
+ --ease-default: var(--ease-default);
+ --ease-emphasis: var(--ease-emphasis);
--tracking-label: var(--tracking-label);
--tracking-hero: var(--tracking-hero);
@@ -553,6 +560,9 @@ html.oc-theme-fade *::after {
--w-rjv-type-date-color: var(--code-string);
}
+/* Markdown in chat replies (Home and Dev) and console rows. Every surface
+ * reads a theme token, so a reply's code and tables stay visible on the
+ * light family's white bubble too, and every theme paints them its own way. */
.chat-markdown p { margin: 0 0 8px 0; }
.chat-markdown p:last-child { margin-bottom: 0; }
.chat-markdown h1,
@@ -560,7 +570,7 @@ html.oc-theme-fade *::after {
.chat-markdown h3 {
margin: 12px 0 8px 0;
font-weight: 600;
- color: var(--foreground);
+ color: var(--fg-default);
}
.chat-markdown h1:first-child,
.chat-markdown h2:first-child,
@@ -568,32 +578,42 @@ html.oc-theme-fade *::after {
.chat-markdown h1 { font-size: 1.25em; }
.chat-markdown h2 { font-size: 1.1em; }
.chat-markdown h3 { font-size: 1em; }
-.chat-markdown strong { font-weight: 600; color: var(--foreground); }
+.chat-markdown strong { font-weight: 600; color: var(--fg-default); }
.chat-markdown em { font-style: italic; }
+/* Tailwind's preflight removes list markers; replies need them back. */
.chat-markdown ul,
-.chat-markdown ol { margin: 8px 0; padding-left: 20px; }
+.chat-markdown ol { margin: 8px 0; padding-left: 22px; }
+.chat-markdown ul { list-style: disc; }
+.chat-markdown ol { list-style: decimal; }
+.chat-markdown ul ul { list-style: circle; }
.chat-markdown li { margin: 4px 0; }
+.chat-markdown li::marker {
+ color: var(--fg-faint);
+ font-family: var(--font-mono);
+}
.chat-markdown code {
- background-color: color-mix(in srgb, var(--border) 30%, transparent);
- padding: 2px 6px;
- border-radius: 4px;
- font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
+ background-color: var(--bg-active);
+ border: 1px solid var(--border-default);
+ padding: 1px 6px;
+ border-radius: var(--radius-sm);
+ font-family: var(--font-mono);
font-size: 0.9em;
}
-.dark .chat-markdown code {
- background-color: var(--code-bg);
-}
.chat-markdown pre {
- background-color: var(--card);
+ background-color: var(--code-bg);
+ color: var(--code-text);
+ border: 1px solid var(--code-border, var(--border-default));
padding: 12px;
- border-radius: 6px;
+ border-radius: var(--radius-lg);
overflow-x: auto;
margin: 8px 0;
}
-.dark .chat-markdown pre {
- background-color: var(--code-bg);
+.chat-markdown pre code {
+ background: none;
+ border: 0;
+ padding: 0;
+ color: inherit;
}
-.chat-markdown pre code { background: none; padding: 0; }
.chat-markdown table {
border-collapse: collapse;
margin: 8px 0;
@@ -602,46 +622,36 @@ html.oc-theme-fade *::after {
}
.chat-markdown th,
.chat-markdown td {
- border: 1px solid var(--border);
+ border: 1px solid var(--border-default);
padding: 6px 10px;
text-align: left;
}
-.dark .chat-markdown th,
-.dark .chat-markdown td {
- border-color: var(--code-border);
-}
.chat-markdown th {
- background-color: var(--card);
+ background-color: var(--bg-panel);
+ color: var(--fg-muted);
font-weight: 600;
}
-.dark .chat-markdown th {
- background-color: var(--code-gutter-bg);
-}
.chat-markdown blockquote {
- border-left: 3px solid var(--primary);
+ border-left: 3px solid var(--border-strong);
margin: 8px 0;
- padding: 4px 12px;
- color: var(--muted-foreground);
-}
-.dark .chat-markdown blockquote {
- border-left-color: var(--code-keyword);
+ padding: 2px 0 2px 14px;
+ color: var(--fg-muted);
}
.chat-markdown a {
- color: var(--primary);
+ color: var(--action-save-ink);
text-decoration: none;
}
-.dark .chat-markdown a {
- color: var(--code-property);
-}
.chat-markdown a:hover { text-decoration: underline; }
+.chat-markdown img {
+ max-width: 100%;
+ height: auto;
+ border-radius: var(--radius-lg);
+}
.chat-markdown hr {
border: none;
- border-top: 1px solid var(--border);
+ border-top: 1px solid var(--border-default);
margin: 12px 0;
}
-.dark .chat-markdown hr {
- border-top-color: var(--code-border);
-}
/* ============================================================================
* Syntax-highlighting palette — used by react-simple-code-editor + the
@@ -651,15 +661,17 @@ html.oc-theme-fade *::after {
* ============================================================================ */
.code-editor-container { background: var(--code-bg); }
-.code-editor-container .token.comment { color: var(--code-comment); }
-.code-editor-container .token.string { color: var(--code-string); }
-.code-editor-container .token.keyword { color: var(--code-keyword); }
-.code-editor-container .token.function { color: var(--code-function); }
-.code-editor-container .token.number { color: var(--code-number); }
-.code-editor-container .token.operator { color: var(--code-operator); }
-.code-editor-container .token.class-name { color: var(--code-property); }
-.code-editor-container .token.builtin { color: var(--code-property); }
-.code-editor-container .token.boolean { color: var(--code-boolean); }
-.code-editor-container .token.punctuation { color: var(--code-punctuation); }
+/* Chat code blocks share the editor's per-theme palette. */
+.code-editor-container .token.comment, .chat-markdown .token.comment { color: var(--code-comment); }
+.code-editor-container .token.string, .chat-markdown .token.string { color: var(--code-string); }
+.code-editor-container .token.keyword, .chat-markdown .token.keyword { color: var(--code-keyword); }
+.code-editor-container .token.function, .chat-markdown .token.function { color: var(--code-function); }
+.code-editor-container .token.number, .chat-markdown .token.number { color: var(--code-number); }
+.code-editor-container .token.operator, .chat-markdown .token.operator { color: var(--code-operator); }
+.code-editor-container .token.class-name, .chat-markdown .token.class-name { color: var(--code-property); }
+.code-editor-container .token.builtin, .chat-markdown .token.builtin { color: var(--code-property); }
+.code-editor-container .token.boolean, .chat-markdown .token.boolean { color: var(--code-boolean); }
+.code-editor-container .token.punctuation, .chat-markdown .token.punctuation { color: var(--code-punctuation); }
+.chat-markdown .token.property { color: var(--code-property); }
.code-editor-container textarea { outline: none !important; caret-color: var(--code-caret); }
.code-editor-container textarea::placeholder { color: var(--muted-foreground); }
diff --git a/client/src/lib/__tests__/motion.test.ts b/client/src/lib/__tests__/motion.test.ts
index 469a17a4..1dff3d8f 100644
--- a/client/src/lib/__tests__/motion.test.ts
+++ b/client/src/lib/__tests__/motion.test.ts
@@ -1,8 +1,40 @@
+import { readFileSync } from 'node:fs';
+import { join } from 'node:path';
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
-import { animate, dur, ease, finished, invalidateMotionTokens, loop, motionSuppressed, parseDuration, stagger } from '../motion';
+import {
+ animate,
+ dur,
+ DUR_FALLBACK,
+ ease,
+ finished,
+ invalidateMotionTokens,
+ loop,
+ motionSuppressed,
+ parseDuration,
+ stagger,
+ STAGGER_FALLBACK,
+ staggerStep,
+} from '../motion';
import { pageActivity } from '../pageActivity';
import { installWaapiStub, setReducedMotion } from '../../test/waapi';
+describe('fallbacks mirror themes/base.css', () => {
+ const baseCss = readFileSync(join(__dirname, '..', '..', 'themes', 'base.css'), 'utf8');
+ const tokenMs = (name: string): number | null => {
+ const match = new RegExp(`^\\s*${name}:\\s*([^;]+);`, 'm').exec(baseCss);
+ return match ? parseDuration(match[1]) : null;
+ };
+
+ it.each(Object.entries(DUR_FALLBACK))('--dur-%s', (name, ms) => {
+ expect(tokenMs(`--dur-${name}`)).toBe(ms);
+ });
+
+ it.each(Object.entries(STAGGER_FALLBACK))('--stagger-%s', (name, ms) => {
+ expect(tokenMs(`--stagger-${name}`)).toBe(ms);
+ });
+});
+
const root = document.documentElement;
function setToken(name: string, value: string): void {
@@ -43,6 +75,12 @@ describe('token reads', () => {
expect(dur('theme-reveal')).toBe(760);
});
+ it('reads a stagger token, falling back to the base.css step', () => {
+ expect(staggerStep('follow')).toBe(70);
+ setToken('--stagger-follow', '40ms');
+ expect(staggerStep('follow')).toBe(40);
+ });
+
it('reads an easing token, falling back to the base.css curve', () => {
expect(ease('spring')).toBe('cubic-bezier(0.16, 1, 0.3, 1)');
setToken('--ease-spring', 'steps(4)');
diff --git a/client/src/lib/motion.ts b/client/src/lib/motion.ts
index 1980eb70..6628b11f 100644
--- a/client/src/lib/motion.ts
+++ b/client/src/lib/motion.ts
@@ -49,7 +49,15 @@ export type DurName =
| 'theme-fade'
| 'glow'
| 'pip-loop'
- | 'switch';
+ | 'switch'
+ | 'chat-rise'
+ | 'genui-enter'
+ | 'follow-in'
+ | 'version-swap'
+ | 'popover-in'
+ | 'chip-pop';
+
+export type StaggerName = 'intro' | 'settings' | 'follow';
/** Used when a token is unreadable (no DOM, or a theme that omits it).
* Mirrors themes/base.css; keep the two in step. */
@@ -61,7 +69,9 @@ const EASE_FALLBACK: Record<EaseName, string> = {
reveal: 'cubic-bezier(0.65, 0, 0.35, 1)',
};
-const DUR_FALLBACK: Record<DurName, number> = {
+/** Mirrors the `--dur-*` values in themes/base.css; a test reads that file
+ * and fails when the two drift apart. */
+export const DUR_FALLBACK: Record<DurName, number> = {
fast: 90,
default: 180,
slow: 320,
@@ -85,6 +95,19 @@ const DUR_FALLBACK: Record<DurName, number> = {
glow: 1400,
'pip-loop': 1600,
switch: 280,
+ 'chat-rise': 560,
+ 'genui-enter': 420,
+ 'follow-in': 460,
+ 'version-swap': 360,
+ 'popover-in': 220,
+ 'chip-pop': 360,
+};
+
+/** Mirrors the `--stagger-*` values in themes/base.css. */
+export const STAGGER_FALLBACK: Record<StaggerName, number> = {
+ intro: 80,
+ settings: 30,
+ follow: 70,
};
let cacheTheme: string | null = null;
@@ -132,6 +155,11 @@ export function dur(name: DurName): number {
return parseDuration(readToken(`--dur-${name}`)) ?? DUR_FALLBACK[name];
}
+/** The delay between consecutive elements of a staggered entrance, ms. */
+export function staggerStep(name: StaggerName): number {
+ return parseDuration(readToken(`--stagger-${name}`)) ?? STAGGER_FALLBACK[name];
+}
+
/** True when motion should be skipped right now: the user asked for reduced
* motion, or the page is not visible. */
export function motionSuppressed(): boolean {
diff --git a/client/src/lib/utils.ts b/client/src/lib/utils.ts
index ab1bac0e..000226e6 100644
--- a/client/src/lib/utils.ts
+++ b/client/src/lib/utils.ts
@@ -15,8 +15,8 @@ const twMerge = extendTailwindMerge({
theme: {
text: ["meta", "row", "lead", "title", "hero"],
radius: ["pill", "row", "card", "panel", "draft", "composer"],
- shadow: ["float", "popover", "dialog", "dock"],
- ease: ["spring", "overshoot", "reveal"],
+ shadow: ["float", "popover", "dialog", "dock", "card", "card-hover", "modal"],
+ ease: ["spring", "overshoot", "reveal", "default", "emphasis"],
tracking: ["label", "hero", "wordmark"],
leading: ["hero"],
blur: ["scrim"],
diff --git a/client/src/themes/animations.css b/client/src/themes/animations.css
index 201f4d4a..03376dde 100644
--- a/client/src/themes/animations.css
+++ b/client/src/themes/animations.css
@@ -204,7 +204,67 @@
animation: cyber-roll 8s linear infinite;
}
+/* ============================================================================
+ * Chat (design handoff chat/, 2026-10-03). Durations are --dur-* tokens in
+ * base.css. Spinners and the live ring reuse the global `spin` keyframes;
+ * blinking pips reuse opencompany-pip-blink above.
+ * ========================================================================== */
+
+/* A gradient sweeping across: skeleton lines, slots and the "Working…" label. */
+@keyframes opencompany-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
+/* The dot that follows text while a reply streams. */
+@keyframes opencompany-caret-pulse { 0%, 100% { transform: scale(0.7); opacity: 0.55; } 50% { transform: scale(1); opacity: 1; } }
+/* The three dots of the status line. */
+@keyframes opencompany-dots { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
+/* BarChart bars growing from their start. */
+@keyframes opencompany-grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
+/* A stroke drawing itself (paths with stroke-dasharray 24). */
+@keyframes opencompany-draw { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
+
+.opencompany-spinner { animation: spin var(--dur-spinner, 800ms) linear infinite; }
+/* A 2px ring around a working employee's avatar; place it at inset -3px. */
+.opencompany-live-ring {
+ background: conic-gradient(from 0deg, var(--action-tools-ink), transparent 35%, var(--action-save-ink) 65%, var(--action-tools-ink));
+ -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), black calc(100% - 2px));
+ mask: radial-gradient(farthest-side, transparent calc(100% - 2px), black calc(100% - 2px));
+ animation: spin var(--dur-live-ring, 1200ms) linear infinite;
+}
+.opencompany-shimmer {
+ background: linear-gradient(90deg, var(--bg-active) 0%, var(--bg-hover) 40%, var(--action-tools-soft) 50%, var(--bg-hover) 60%, var(--bg-active) 100%);
+ background-size: 200% 100%;
+ animation: opencompany-shimmer var(--dur-shimmer, 1600ms) linear infinite;
+}
+/* The dashed placeholder where the next generated-UI element will land. */
+.opencompany-shimmer-slot {
+ background: linear-gradient(90deg, transparent 0%, var(--bg-hover) 45%, var(--node-agent-soft) 50%, var(--bg-hover) 55%, transparent 100%);
+ background-size: 200% 100%;
+ animation: opencompany-shimmer var(--dur-shimmer, 1600ms) linear infinite;
+}
+.opencompany-shimmer-text {
+ background: linear-gradient(90deg, var(--fg-faint) 0%, var(--fg-default) 50%, var(--fg-faint) 100%);
+ background-size: 200% 100%;
+ -webkit-background-clip: text;
+ background-clip: text;
+ color: transparent;
+ animation: opencompany-shimmer var(--dur-shimmer-text, 1800ms) linear infinite;
+}
+.opencompany-caret { animation: opencompany-caret-pulse var(--dur-caret, 1000ms) ease-in-out infinite; }
+.opencompany-dots > * { animation: opencompany-dots var(--dur-dots, 1200ms) ease infinite; }
+.opencompany-dots > :nth-child(2) { animation-delay: 150ms; }
+.opencompany-dots > :nth-child(3) { animation-delay: 300ms; }
+.opencompany-grow {
+ transform-origin: left center;
+ animation: opencompany-grow-x var(--dur-bar-grow, 900ms) var(--ease-spring) both;
+}
+.opencompany-draw {
+ stroke-dasharray: 24;
+ animation: opencompany-draw var(--dur-check-draw, 420ms) var(--ease-spring) both;
+}
+
@media (prefers-reduced-motion: reduce) {
.opencompany-pulse, .opencompany-crt, .opencompany-scanline::after,
- .opencompany-trigger-armed, .opencompany-trigger-fire, .opencompany-bolt, .opencompany-pip-pulse { animation: none !important; }
+ .opencompany-trigger-armed, .opencompany-trigger-fire, .opencompany-bolt, .opencompany-pip-pulse,
+ .opencompany-spinner, .opencompany-live-ring, .opencompany-shimmer, .opencompany-shimmer-slot,
+ .opencompany-shimmer-text, .opencompany-caret, .opencompany-dots > *, .opencompany-grow,
+ .opencompany-draw { animation: none !important; }
}
diff --git a/client/src/themes/base.css b/client/src/themes/base.css
index b5425d89..58483891 100644
--- a/client/src/themes/base.css
+++ b/client/src/themes/base.css
@@ -181,6 +181,30 @@
--h-settings: 760px;
--w-settings-nav: 224px;
+ /* ── Chat (Home Talk and Dev's console Chat pane share it) — design
+ * handoff design_handoff_opencompany_home/chat (2026-10-03). Loop
+ * durations feed the opencompany-* helpers in animations.css; the rest
+ * are read by lib/motion.ts. ──────────────────────────────────────── */
+ --w-chat-column: 760px; /* thread column; the text measure is this minus its padding */
+ --h-chat-composer-max: 220px; /* the message box grows with its text up to this */
+ --dur-chat-rise: 560ms; /* thread and empty-state entrance */
+ --dur-genui-enter: 420ms; /* one generated-UI element arriving */
+ --dur-follow-in: 460ms; /* approval card and follow-up chips */
+ --stagger-follow: 70ms;
+ --dur-version-swap: 360ms; /* switching reply versions or branches */
+ --dur-popover-in: 220ms; /* slash-command menu */
+ --dur-chip-pop: 360ms; /* an attachment chip arriving */
+ --dur-bar-grow: 900ms; /* BarChart bars */
+ --dur-check-draw: 420ms; /* the drawn "sent" tick */
+ --dur-spinner: 800ms;
+ --dur-live-ring: 1200ms; /* ring around a working employee's avatar */
+ --dur-shimmer: 1600ms; /* skeleton lines and slots */
+ --dur-shimmer-text: 1800ms; /* the "Working…" label */
+ --dur-dots: 1200ms; /* status-line dots */
+ --dur-caret: 1000ms; /* streaming caret */
+ --tint-scrim-soft: 88%; /* drop overlay: how much app surface covers the thread */
+ --bg-scrim-soft: color-mix(in srgb, var(--bg-app) var(--tint-scrim-soft), transparent);
+
/* ── Employee status (Normal mode). The dot is the raw role colour; the
* pill tints it (fill 12%, border 45%) and reads in the role's ink, which
* the light family darkens. working=tool, ready=model, attention=trigger,