Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(core): - mount debug-routes, fix(agents): better invert colors for light mode chat bubbles (#6935)

Seamusa9d580015d3d
diff --git a/apps/web/src/components/app/split-layout/split-router/app-routes.ts b/apps/web/src/components/app/split-layout/split-router/app-routes.ts
index 1ff10cb1cb..54b1b75e08 100644
--- a/apps/web/src/components/app/split-layout/split-router/app-routes.ts
+++ b/apps/web/src/components/app/split-layout/split-router/app-routes.ts
@@ -23,6 +23,7 @@ import { remindersRoute } from '@app/features/reminders/route';
import { settingsRoute } from '@app/features/settings/route';
import { tasksSplitRoute } from '@app/features/tasks-view/route';
import { defineRoutes } from '@app/lib/split-router';
+import { debugRoutes } from './debug-routes';
import { handleLegacySplitPath, legacySplitRoute } from './legacy-route';
export const appSplitRoutes = defineRoutes({
@@ -47,6 +48,7 @@ export const appSplitRoutes = defineRoutes({
companiesRoute,
foldersRoute,
searchRoute,
+ ...debugRoutes,
legacySplitRoute,
],
globalSearch: ['referral_code'],
diff --git a/apps/web/src/components/app/split-layout/split-router/debug-routes.ts b/apps/web/src/components/app/split-layout/split-router/debug-routes.ts
new file mode 100644
index 0000000000..bdd5989e98
--- /dev/null
+++ b/apps/web/src/components/app/split-layout/split-router/debug-routes.ts
@@ -0,0 +1,59 @@
+import { defineRoute } from '@app/lib/split-router';
+import { DEV_MODE_ENV, LOCAL_ONLY } from '@core/constant/featureFlags';
+import { lazy } from 'solid-js';
+
+const debugComponentIds = [
+ 'ui',
+ 'icon-gallery',
+ ...(LOCAL_ONLY
+ ? [
+ 'theme-edit-3',
+ 'theme-debug',
+ 'core',
+ 'md',
+ 'data',
+ 'chat',
+ 'chat-attachment',
+ 'chat-tool',
+ 'http-stream',
+ 'static-markdown-stream',
+ 'resize',
+ 'notifications-playground',
+ 'props-debug',
+ 'entity-debug',
+ 'quick-access-list',
+ 'hotkey-debugger',
+ 'user-icon',
+ 'dynamic-ui',
+ 'agent-ui',
+ 'agent-replay',
+ 'agent-changes-ui',
+ ]
+ : []),
+ ...(import.meta.env.DEV ? ['spreadsheet-demo'] : []),
+ ...(DEV_MODE_ENV
+ ? [
+ 'document-where-playground',
+ 'projection-playground',
+ 'md-parse',
+ 'md-builder',
+ 'collab-surface-demo',
+ ]
+ : []),
+];
+
+/** Keep debug views behind the registry's lazy imports and environment gates. */
+export const debugRoutes = debugComponentIds.map((id) =>
+ defineRoute({
+ id: `view-${id}`,
+ path: `debug/${id}`,
+ aliases: [`component/${id}`],
+ component: lazy(async () => {
+ const { resolveComponent } = await import('../componentRegistry');
+ return { default: () => resolveComponent(id).element() };
+ }),
+ search: '*' as const,
+ externalSearch: id === 'ui' ? ['ui'] : [],
+ claim: () => ({ namespace: 'component', id }),
+ })
+);
diff --git a/apps/web/src/components/app/split-layout/tests/app-route-isolation.test.ts b/apps/web/src/components/app/split-layout/tests/app-route-isolation.test.ts
index 23294ffbde..ea103f4c90 100644
--- a/apps/web/src/components/app/split-layout/tests/app-route-isolation.test.ts
+++ b/apps/web/src/components/app/split-layout/tests/app-route-isolation.test.ts
@@ -1,6 +1,7 @@
import {
createRoutesManifest,
decodeRoute,
+ encodeRoute,
} from '@app/lib/split-router/routes';
import { describe, expect, it, vi } from 'vitest';
import { appSplitRoutes } from '../split-router/app-routes';
@@ -19,6 +20,9 @@ vi.mock('@service-connection/websocket', () => ({
vi.mock('@app/features/activity/views/my-activity-view', () => {
throw new Error('Route declarations must not eagerly load activity views');
});
+vi.mock('../componentRegistry', () => {
+ throw new Error('Route declarations must not eagerly load the registry');
+});
vi.mock('@app/features/agents-view/views/AgentsView', () => {
throw new Error('Route declarations must not eagerly load agent views');
});
@@ -63,6 +67,17 @@ vi.mock('@app/features/tasks-view/components/TasksDetailView', () => {
});
describe('application route import isolation', () => {
+ it('routes debug views and canonicalizes their legacy URLs', () => {
+ const routes = createRoutesManifest(appSplitRoutes);
+ for (const id of ['ui', 'icon-gallery']) {
+ const route = decodeRoute(routes, ['debug', id]);
+ expect(route?.location.route.matches[0].id).toBe(`view-${id}`);
+ const legacy = decodeRoute(routes, ['component', id]);
+ expect(legacy).toEqual(route);
+ expect(encodeRoute(routes, legacy!)).toEqual(['debug', id]);
+ }
+ });
+
it('builds and decodes routes without initializing view modules', () => {
const routes = createRoutesManifest(appSplitRoutes);
for (const path of [
diff --git a/apps/web/src/components/ui/components/InvertUtil.docs.tsx b/apps/web/src/components/ui/components/InvertUtil.docs.tsx
new file mode 100644
index 0000000000..a3fa440305
--- /dev/null
+++ b/apps/web/src/components/ui/components/InvertUtil.docs.tsx
@@ -0,0 +1,138 @@
+import { defineDoc } from '@app/features/ui-gallery/types';
+import { For, lazy, Suspense } from 'solid-js';
+import { Button } from './Button';
+import { Input } from './Input';
+import { InvertUtil } from './InvertUtil';
+import { Layer } from './Layer';
+import { UserMessageBubble } from './UserMessageBubble';
+
+// Keep the renderer's app dependencies out of unrelated gallery pages.
+const InvertedMarkdown = lazy(() => import('./invert-demo/InvertedMarkdown'));
+
+function InvertedPaletteSamples() {
+ return (
+ <div class="flex flex-wrap gap-2">
+ <For
+ each={[
+ 'accent',
+ 'red',
+ 'orange',
+ 'amber',
+ 'yellow',
+ 'lime',
+ 'green',
+ 'teal',
+ 'cyan',
+ 'blue',
+ 'violet',
+ 'purple',
+ 'pink',
+ ]}
+ >
+ {(color) => (
+ <span
+ class="rounded border border-edge-muted px-2 py-1 text-sm"
+ style={{
+ color: `var(--color-${color})`,
+ 'background-color': `var(--color-${color}-bg)`,
+ }}
+ >
+ {color}
+ </span>
+ )}
+ </For>
+ </div>
+ );
+}
+
+// #region demo:inverted
+function InvertedDemo() {
+ return (
+ <div class="w-full rounded-lg bg-ink p-4">
+ <InvertUtil>
+ <div class="flex flex-col gap-3">
+ <p>Inverted section</p>
+ <p class="text-sm text-ink-muted">
+ Text, borders, controls, and nested layers use the local palette.
+ </p>
+ <Input aria-label="Inverted input" placeholder="Write something…" />
+ <div class="flex flex-wrap gap-2">
+ <Button variant="ghost">Ghost</Button>
+ <Button variant="outline">Outline</Button>
+ <Button variant="strong">Strong</Button>
+ <Button variant="accent">Accent</Button>
+ <Button variant="cta">Primary action</Button>
+ <Button variant="success">Success</Button>
+ <Button variant="danger">Danger</Button>
+ <Button disabled>Disabled</Button>
+ </div>
+ <InvertedPaletteSamples />
+ <Layer offset={1}>
+ <div class="rounded-md border border-edge-muted bg-surface p-3 text-ink">
+ Raised surface
+ </div>
+ </Layer>
+ <InvertUtil>
+ <div class="rounded-md bg-surface p-3 text-ink">
+ A nested inversion restores the original foreground and
+ background.
+ <div class="mt-3 flex flex-col gap-3">
+ <InvertedPaletteSamples />
+ <Button variant="cta">Nested primary action</Button>
+ </div>
+ </div>
+ </InvertUtil>
+ <div class="min-w-0 border-t border-edge-muted pt-4">
+ <Suspense>
+ <InvertedMarkdown />
+ </Suspense>
+ </div>
+ </div>
+ </InvertUtil>
+ </div>
+ );
+}
+// #endregion
+
+// #region demo:user-message
+function UserMessageDemo() {
+ return (
+ <div class="w-full">
+ <UserMessageBubble>
+ <Suspense>
+ <InvertedMarkdown />
+ </Suspense>
+ </UserMessageBubble>
+ </div>
+ );
+}
+// #endregion
+
+export default defineDoc({
+ name: 'InvertUtil',
+ category: 'Foundations',
+ description:
+ 'Render existing components on an ink-colored background. InvertUtil scopes text, surfaces, borders, and palette lightness to the section without adding a layout box.',
+ exports: ['InvertUtil'],
+ import: "import { InvertUtil } from '@ui';",
+ demos: [
+ {
+ id: 'user-message',
+ title: 'User-sent AI message',
+ description:
+ 'The shared chat and agent message bubble uses InvertUtil on an ink-colored surface in light themes, and Layer depth={3} for a slightly lighter surface in dark themes.',
+ render: UserMessageDemo,
+ fill: true,
+ depth: 0,
+ },
+ {
+ id: 'inverted',
+ title: 'Inverted sections',
+ description:
+ 'Place InvertUtil inside a bg-ink section, or wrap a bg-surface section in it. This example includes the app’s StaticMarkdown renderer with headings, nested lists, quotes, tables, and code. It starts at depth 0 and inherits theme changes. Portals outside the boundary keep the surrounding app palette.',
+ render: InvertedDemo,
+ fill: true,
+ depth: 0,
+ },
+ ],
+});
diff --git a/apps/web/src/components/ui/components/InvertUtil.tsx b/apps/web/src/components/ui/components/InvertUtil.tsx
new file mode 100644
index 0000000000..63648047ab
--- /dev/null
+++ b/apps/web/src/components/ui/components/InvertUtil.tsx
@@ -0,0 +1,22 @@
+import type { ParentProps } from 'solid-js';
+import { Layer } from './Layer';
+
+export type InvertUtilProps = ParentProps;
+
+/**
+ * Gives a subtree an ink-colored surface and contrasting semantic colors.
+ * Like Layer, this adds no layout box. Paint the section with bg-surface inside
+ * the boundary, or put the boundary inside an existing bg-ink section.
+ * Colors follow DOM inheritance; content portaled outside must opt in separately.
+ * @do Use semantic color tokens inside the inverted boundary.
+ * @dont Assume portals outside the boundary inherit its palette.
+ */
+export function InvertUtil(props: InvertUtilProps) {
+ return (
+ <div data-invert-source style={{ display: 'contents' }}>
+ <div data-invert class="text-ink" style={{ display: 'contents' }}>
+ <Layer depth={0}>{props.children}</Layer>
+ </div>
+ </div>
+ );
+}
diff --git a/apps/web/src/components/ui/components/UserMessageBubble.tsx b/apps/web/src/components/ui/components/UserMessageBubble.tsx
index b4bc4f4120..78c0d77606 100644
--- a/apps/web/src/components/ui/components/UserMessageBubble.tsx
+++ b/apps/web/src/components/ui/components/UserMessageBubble.tsx
@@ -1,13 +1,25 @@
-import type { JSX } from 'solid-js';
+import { liveThemeMode } from '@app/features/theme/signals/themeSignals';
+import { type JSX, Show } from 'solid-js';
+import { InvertUtil } from './InvertUtil';
+import { Layer } from './Layer';
/** Shared user prompt bubble for the production chat and agent transcripts. */
export function UserMessageBubble(props: { children: JSX.Element }) {
- return (
+ const bubble = () => (
<div
data-user-message-bubble
- class="relative ml-auto w-fit min-w-0 max-w-[85%] rounded-3xl bg-ink px-4 py-2.5 text-panel dark-mode:bg-surface-4 dark-mode:text-ink [&_button]:text-inherit whitespace-pre-wrap wrap-break-word [&_.md>:first-child]:mt-0! [&_.md>:last-child]:mb-0!"
+ class="relative ml-auto w-fit min-w-0 max-w-[85%] rounded-3xl bg-surface text-ink px-4 py-2.5 whitespace-pre-wrap wrap-break-word [&_.md>:first-child]:mt-0! [&_.md>:last-child]:mb-0!"
>
{props.children}
</div>
);
+
+ return (
+ <Show
+ when={liveThemeMode() === 'light'}
+ fallback={<Layer depth={3}>{bubble()}</Layer>}
+ >
+ <InvertUtil>{bubble()}</InvertUtil>
+ </Show>
+ );
}
diff --git a/apps/web/src/components/ui/components/invert-demo/InvertedMarkdown.tsx b/apps/web/src/components/ui/components/invert-demo/InvertedMarkdown.tsx
new file mode 100644
index 0000000000..509abafad5
--- /dev/null
+++ b/apps/web/src/components/ui/components/invert-demo/InvertedMarkdown.tsx
@@ -0,0 +1,13 @@
+import {
+ StaticMarkdown,
+ StaticMarkdownContext,
+} from '@core/component/LexicalMarkdown/component/core/StaticMarkdown';
+import markdown from './inverted-markdown.md?raw';
+
+export default function InvertedMarkdown() {
+ return (
+ <StaticMarkdownContext lazy={false}>
+ <StaticMarkdown markdown={markdown} />
+ </StaticMarkdownContext>
+ );
+}
diff --git a/apps/web/src/components/ui/components/invert-demo/inverted-markdown.md b/apps/web/src/components/ui/components/invert-demo/inverted-markdown.md
new file mode 100644
index 0000000000..e2d01bbefc
--- /dev/null
+++ b/apps/web/src/components/ui/components/invert-demo/inverted-markdown.md
@@ -0,0 +1,77 @@
+# Launch notes: a workspace that reads well
+
+This is a **static Markdown document** inside an inverted section. It combines *emphasis*, **bold text**, ~~superseded decisions~~, and `inline code` in the same paragraph. The surrounding controls and this document should share one readable palette.
+
+## 1. Release overview
+
+> **Design principle:** content should remain readable wherever it is placed.
+> A quote can include *emphasis*, a [reference link](https://example.com), and `semantic tokens` without losing its hierarchy.
+
+### Acceptance checklist
+
+- [x] Headings and paragraphs retain clear contrast.
+- [x] Inline code has a distinct background.
+- [ ] Review the same content in light and dark themes.
+- [ ] Check borders, syntax highlighting, and keyboard focus.
+
+### Rollout sequence
+
+1. Prepare the preview.
+ - Compare ordinary prose with **important details**.
+ - Inspect a second level of content:
+ - Muted labels should still be legible.
+ - Borders should separate adjacent surfaces.
+2. Review the release with the team.
+3. Publish when the checks are complete.
+
+## 2. Surface inventory
+
+| Element | Token or treatment | What to inspect |
+| :--- | :--- | :--- |
+| Body copy | `text-ink` | Strong contrast against the ink-colored section |
+| Supporting text | `text-ink-muted` | Visible, with less emphasis |
+| Raised content | `bg-surface` | A distinct nested layer |
+| Dividers | `border-edge-muted` | Subtle but visible boundaries |
+| Links | [Reference material](https://example.com) | Recognizable interactive text |
+
+## 3. Implementation sketch
+
+The code block includes comments, strings, numbers, booleans, and punctuation so syntax colors can be assessed together.
+
+```typescript
+type Review = {
+ title: string;
+ approved: boolean;
+ depth: number;
+};
+
+const reviews: Review[] = [
+ { title: 'Typography', approved: true, depth: 0 },
+ { title: 'Nested surfaces', approved: false, depth: 2 },
+];
+
+// Keep the content readable at every depth.
+function summarize(items: Review[]): string {
+ const ready = items.filter((item) => item.approved);
+ return `${ready.length} of ${items.length} checks complete`;
+}
+```
+
+### Example payload
+
+```json
+{
+ "section": "release-notes",
+ "inverted": true,
+ "checks": ["text", "tables", "code", "nested layers"],
+ "remaining": 2
+}
+```
+
+---
+
+## 4. Final review
+
+Read this longer paragraph at a comfortable width, then compare it with the compact table and code above. A successful result keeps the document’s hierarchy intact: the title leads, section headings divide the work, quotes stand apart, and ordinary prose remains easy to follow. None of these elements should need special colors at the call site merely because the surrounding section uses the app’s ink color as its background.
+
+**Next step:** finish the remaining checks and share the preview.
diff --git a/apps/web/src/components/ui/index.ts b/apps/web/src/components/ui/index.ts
index 955d5cfd20..679c8fe878 100644
--- a/apps/web/src/components/ui/index.ts
+++ b/apps/web/src/components/ui/index.ts
@@ -116,6 +116,7 @@ export type {
InputGroupVariantProps,
} from './components/InputGroup';
export { InputGroup, inputGroupVariants } from './components/InputGroup';
+export { InvertUtil } from './components/InvertUtil';
export { Item, type ItemProps } from './components/Item';
export { Layer } from './components/Layer';
export { LogoProgress } from './components/LogoProgress';
diff --git a/apps/web/src/index.css b/apps/web/src/index.css
index c735e71fac..38da67f0c8 100644
--- a/apps/web/src/index.css
+++ b/apps/web/src/index.css
@@ -248,6 +248,187 @@ body.tauri-ios {
--layer-inset: var(--color-surface-3);
}
+/* Capture on a separate element so swapping the palette cannot create a
+ custom-property cycle. Nested InvertUtil boundaries capture the local colors. */
+[data-invert-source] {
+ --invert-surface: var(--color-ink);
+ --invert-ink: var(--color-page);
+ --invert-accent: var(--color-accent);
+ --invert-red: var(--color-red);
+ --invert-orange: var(--color-orange);
+ --invert-amber: var(--color-amber);
+ --invert-yellow: var(--color-yellow);
+ --invert-lime: var(--color-lime);
+ --invert-green: var(--color-green);
+ --invert-teal: var(--color-teal);
+ --invert-cyan: var(--color-cyan);
+ --invert-blue: var(--color-blue);
+ --invert-violet: var(--color-violet);
+ --invert-purple: var(--color-purple);
+ --invert-pink: var(--color-pink);
+ --invert-link: var(--color-link);
+ --invert-link-hover: var(--color-link-hover);
+ --invert-link-visited: var(--color-link-visited);
+ --invert-success: var(--color-success);
+ --invert-warning: var(--color-warning);
+ --invert-failure: var(--color-failure);
+}
+
+[data-invert] {
+ /* Move lightness toward the local foreground. Missing chroma and hue in
+ the target keep the authored palette chromatic instead of mixing to gray. */
+ --invert-palette-target: oklch(from var(--invert-ink) clamp(0.3, l, 0.85) none none);
+ --color-accent: color-mix(in oklch, var(--invert-accent) 20%, var(--invert-palette-target));
+ --color-red: color-mix(in oklch, var(--invert-red) 20%, var(--invert-palette-target));
+ --color-orange: color-mix(in oklch, var(--invert-orange) 20%, var(--invert-palette-target));
+ --color-amber: color-mix(in oklch, var(--invert-amber) 20%, var(--invert-palette-target));
+ --color-yellow: color-mix(in oklch, var(--invert-yellow) 20%, var(--invert-palette-target));
+ --color-lime: color-mix(in oklch, var(--invert-lime) 20%, var(--invert-palette-target));
+ --color-green: color-mix(in oklch, var(--invert-green) 20%, var(--invert-palette-target));
+ --color-teal: color-mix(in oklch, var(--invert-teal) 20%, var(--invert-palette-target));
+ --color-cyan: color-mix(in oklch, var(--invert-cyan) 20%, var(--invert-palette-target));
+ --color-blue: color-mix(in oklch, var(--invert-blue) 20%, var(--invert-palette-target));
+ --color-violet: color-mix(in oklch, var(--invert-violet) 20%, var(--invert-palette-target));
+ --color-purple: color-mix(in oklch, var(--invert-purple) 20%, var(--invert-palette-target));
+ --color-pink: color-mix(in oklch, var(--invert-pink) 20%, var(--invert-palette-target));
+ --color-link: color-mix(in oklch, var(--invert-link) 20%, var(--invert-palette-target));
+ --color-link-hover: color-mix(in oklch, var(--invert-link-hover) 20%, var(--invert-palette-target));
+ --color-link-visited: color-mix(in oklch, var(--invert-link-visited) 20%, var(--invert-palette-target));
+ --color-success: color-mix(in oklch, var(--invert-success) 20%, var(--invert-palette-target));
+ --color-warning: color-mix(in oklch, var(--invert-warning) 20%, var(--invert-palette-target));
+ --color-failure: color-mix(in oklch, var(--invert-failure) 20%, var(--invert-palette-target));
+ --color-accent-contrast: var(--invert-surface);
+ --color-accent-contrast-muted: oklch(from var(--color-accent-contrast) l c h / 0.7);
+ --theme-surface: initial;
+ --theme-inset: initial;
+ --theme-panel: initial;
+ --color-surface-0: var(--invert-surface);
+ --color-surface-1: color-mix(in oklch, var(--invert-surface) 96%, var(--invert-ink));
+ --color-surface-2: color-mix(in oklch, var(--invert-surface) 92%, var(--invert-ink));
+ --color-surface-3: color-mix(in oklch, var(--invert-surface) 88%, var(--invert-ink));
+ --color-surface-4: color-mix(in oklch, var(--invert-surface) 84%, var(--invert-ink));
+ --color-content-0: var(--invert-ink);
+ --color-content-1: color-mix(in oklch, var(--invert-ink) 80%, var(--invert-surface));
+ --color-content-2: color-mix(in oklch, var(--invert-ink) 65%, var(--invert-surface));
+ --color-content-3: color-mix(in oklch, var(--invert-ink) 40%, var(--invert-surface));
+ --color-content-4: color-mix(in oklch, var(--invert-ink) 55%, var(--invert-surface));
+ --color-edge: var(--color-surface-4);
+ --color-edge-muted: var(--color-surface-3);
+ /* Inherited aliases are already resolved; rebind them to the local ramp. */
+ --color-thread-rail: color-mix(in oklch, var(--color-surface-0) 90%, var(--color-content-0));
+ --color-ink: var(--color-content-0);
+ --color-ink-muted: var(--color-content-1);
+ --color-ink-subtle: var(--color-content-2);
+ --color-ink-disabled: var(--color-content-3);
+ --color-ink-placeholder: var(--color-content-4);
+ --color-page: var(--color-surface-0);
+ --color-panel: var(--color-surface-1);
+ --color-dialog: var(--color-surface-2);
+ --color-menu: var(--color-surface-2);
+ --color-menu-glass: color-mix(in oklch, var(--color-menu) 88%, transparent);
+ --color-tooltip: var(--color-surface-2);
+ --color-toast: var(--color-surface-2);
+ --color-input: transparent;
+ --color-input-focus: var(--color-surface-1);
+ --color-message: var(--color-surface-1);
+ --color-composer: var(--color-surface-2);
+ --color-composer-ink: var(--color-ink);
+ --color-composer-placeholder: var(--color-ink-placeholder);
+ --color-composer-action: var(--color-ink);
+ --color-composer-action-ink: var(--color-panel);
+ --color-code-buffer: color-mix(in srgb, var(--color-surface-0) 60%, var(--color-surface-1));
+ --color-inline-code: color-mix(in oklch, var(--color-ink) 5%, transparent);
+ --color-hover: color-mix(in oklch, var(--color-content-0) 3%, transparent);
+ --color-active: color-mix(in oklch, var(--color-content-0) 6%, transparent);
+ --color-chrome: color-mix(in oklch, var(--color-surface-3) 98%, var(--color-content-0));
+
+ --color-ink-extra-muted: var(--color-ink-subtle);
+ --color-skeleton: color-mix(in oklch, var(--color-ink) 10%, transparent);
+ --color-list-hover: var(--color-hover);
+ --color-list-highlighted: var(--color-hover);
+ --color-selected: color-mix(in oklch, var(--color-accent) 8%, transparent);
+ --color-list-selected: var(--color-selected);
+ --color-list-selected-highlighted: color-mix(in oklch, var(--color-accent) 16%, transparent);
+
+ /* Generated compatibility tokens. */
+ --color-accent-bg: color-mix(in oklch, var(--color-accent) 8%, transparent);
+ --color-accent-ink: var(--color-accent);
+ --color-accent-hover: color-mix(in oklch, var(--color-accent) 20%, transparent);
+
+ --color-red-bg: color-mix(in oklch, var(--color-red) 15%, transparent);
+ --color-red-ink: var(--color-red);
+ --color-red-hover: color-mix(in oklch, var(--color-red) 20%, transparent);
+ --color-orange-bg: color-mix(in oklch, var(--color-orange) 15%, transparent);
+ --color-orange-ink: var(--color-orange);
+ --color-orange-hover: color-mix(in oklch, var(--color-orange) 20%, transparent);
+ --color-amber-bg: color-mix(in oklch, var(--color-amber) 15%, transparent);
+ --color-amber-ink: var(--color-amber);
+ --color-amber-hover: color-mix(in oklch, var(--color-amber) 20%, transparent);
+ --color-yellow-bg: color-mix(in oklch, var(--color-yellow) 15%, transparent);
+ --color-yellow-ink: var(--color-yellow);
+ --color-yellow-hover: color-mix(in oklch, var(--color-yellow) 20%, transparent);
+ --color-lime-bg: color-mix(in oklch, var(--color-lime) 15%, transparent);
+ --color-lime-ink: var(--color-lime);
+ --color-lime-hover: color-mix(in oklch, var(--color-lime) 20%, transparent);
+ --color-green-bg: color-mix(in oklch, var(--color-green) 15%, transparent);
+ --color-green-ink: var(--color-green);
+ --color-green-hover: color-mix(in oklch, var(--color-green) 20%, transparent);
+ --color-teal-bg: color-mix(in oklch, var(--color-teal) 15%, transparent);
+ --color-teal-ink: var(--color-teal);
+ --color-teal-hover: color-mix(in oklch, var(--color-teal) 20%, transparent);
+ --color-cyan-bg: color-mix(in oklch, var(--color-cyan) 15%, transparent);
+ --color-cyan-ink: var(--color-cyan);
+ --color-cyan-hover: color-mix(in oklch, var(--color-cyan) 20%, transparent);
+ --color-blue-bg: color-mix(in oklch, var(--color-blue) 15%, transparent);
+ --color-blue-ink: var(--color-blue);
+ --color-blue-hover: color-mix(in oklch, var(--color-blue) 20%, transparent);
+ --color-violet-bg: color-mix(in oklch, var(--color-violet) 15%, transparent);
+ --color-violet-ink: var(--color-violet);
+ --color-violet-hover: color-mix(in oklch, var(--color-violet) 20%, transparent);
+ --color-purple-bg: color-mix(in oklch, var(--color-purple) 15%, transparent);
+ --color-purple-ink: var(--color-purple);
+ --color-purple-hover: color-mix(in oklch, var(--color-purple) 20%, transparent);
+ --color-pink-bg: color-mix(in oklch, var(--color-pink) 15%, transparent);
+ --color-pink-ink: var(--color-pink);
+ --color-pink-hover: color-mix(in oklch, var(--color-pink) 20%, transparent);
+
+ --color-success-bg: color-mix(in oklch, var(--color-success) 15%, transparent);
+ --color-success-ink: var(--color-success);
+ --color-success-hover: color-mix(in oklch, var(--color-success) 20%, transparent);
+ --color-warning-bg: color-mix(in oklch, var(--color-warning) 15%, transparent);
+ --color-warning-ink: var(--color-warning);
+ --color-warning-hover: color-mix(in oklch, var(--color-warning) 20%, transparent);
+ --color-failure-bg: color-mix(in oklch, var(--color-failure) 15%, transparent);
+ --color-failure-ink: var(--color-failure);
+ --color-failure-hover: color-mix(in oklch, var(--color-failure) 20%, transparent);
+ --color-alert: var(--color-warning);
+ --color-alert-bg: var(--color-warning-bg);
+ --color-alert-ink: var(--color-warning-ink);
+
+ /* Entity colors are aliases of the authored named palette. */
+ --color-comment: var(--color-yellow);
+ --color-comment-bg: oklch(from var(--color-comment) l c h / 0.15);
+ --color-comment-ink: var(--color-comment);
+
+ --color-calendar: var(--color-yellow);
+ --color-contact: var(--color-yellow);
+ --color-canvas: var(--color-amber);
+ --color-folder: var(--color-blue);
+ --color-image: var(--color-yellow);
+ --color-video: var(--color-violet);
+ --color-write: var(--color-blue);
+ --color-code: var(--color-lime);
+ --color-chat: var(--color-cyan);
+ --color-html: var(--color-orange);
+ --color-note: var(--color-violet);
+ --color-task: var(--color-green);
+ --color-snippet: var(--color-pink);
+ --color-pdf: var(--color-red);
+ --color-rss: var(--color-blue);
+ --color-default: var(--color-content-1);
+ --color-email: var(--color-default);
+}
+
/* Scope the panel semantic itself so nested bg-panel consumers share the same
inactive split chrome instead of only tinting the outer panel element. */
.split-panel-inactive {
@@ -562,7 +743,8 @@ html[data-touch-device='true'] {
-webkit-tap-highlight-color: initial;
}
-html:not([data-touch-device="true"]) {
+html:not([data-touch-device="true"]),
+html:not([data-touch-device="true"]) [data-invert] {
--color-menu-glass: var(--color-menu);
}
diff --git a/docs/AGENT_GUIDE/ai-chat.md b/docs/AGENT_GUIDE/ai-chat.md
index b0d61f0e94..b14e447d32 100644
--- a/docs/AGENT_GUIDE/ai-chat.md
+++ b/docs/AGENT_GUIDE/ai-chat.md
@@ -1,5 +1,10 @@
# AI Chat (Agents)
+User-sent messages in chat and agent transcripts use an ink-colored bubble with
+`InvertUtil` in light themes. Dark themes use `Layer depth={3}` for the slightly
+lighter bubble with the normal text palette. Preview Markdown and controls at
+`/app/debug/ui?ui=invert-util` under **User-sent AI message**.
+
## Uploading files with AI
`UploadFile` accepts a filename and standard padded base64 contents, up to 25 MiB
diff --git a/docs/AGENT_GUIDE/navigation.md b/docs/AGENT_GUIDE/navigation.md
index 346eef5218..aa1174f91b 100644
--- a/docs/AGENT_GUIDE/navigation.md
+++ b/docs/AGENT_GUIDE/navigation.md
@@ -49,6 +49,8 @@ Switching tabs or navigating an in-app route is not a back/forward-cache restore
| `/app/md/<doc>/chat/<chat>` | Doc + doc-scoped chat in a split |
| `/app/md/<doc>/channel/<channel>` | Doc + channel in a split |
| `/app/settings/account` | Settings (also `/app/settings/api-keys`, `/mcp-server`, `/shortcuts`, etc.) |
+| `/app/debug/ui?ui=invert-util` | UI gallery, including the inverted Markdown demo on the InvertUtil page |
+| `/app/debug/<component>` | Registered debug views (for example `icon-gallery`, `md`, or `agent-ui`); existing environment gates apply. `/app/component/<component>` remains a compatibility alias for these views |
When an event opens inline from Home, changing the Calendar period stays under
`/app/inbox/calendar/`, updates the period segment, and re-focuses that event.