Files
plugins/packages/agent-console/web/src/styles/tokens.css
T
qingnian108 08ad5e3956 page-agent-console 1.1.0: QA fixes, neutral accent, own dropdown menus, self-heal after a host restart, by qingnian108 (#569)
page-agent-console 1.1.0, by qingnian108 (#569).

QA fixes B1-B21, a reworked UI, a new logo, and self-heal after a plugin host restart. In this version:
- Accent: a fixed neutral grey (charcoal in light mode, light grey in dark mode). Magpie's accent tokens are dropped on purpose. Surfaces, text, lines, fonts and semantic colours still follow magpie.
- Every native <select> (composer effort/mode/Cursor fast, Settings, Debug) is now the page's own SelectMenu, a button plus a listbox.
- The registry summary again discloses the 127.0.0.1 service and its lifecycle, that only its own page gets the token, the ~46 MB first install, and that Claude Code isn't bundled (en, zh).
- session.js is written once at bind with beat:false, and beats every 4s only after the first /open. A new host deletes a dead host's session.js at startup (owner pid in session-owner.json, outside the page folder).
- The daemon swallows console EPIPE after a hard host kill and handles a lifeline close once.

Run at 930c6e2 on macOS (mote, Node 22), in a fresh copy:
- npm ci, then npm run check (tsc daemon + web): ok
- npx vitest run: 46 files, 288 passed, 17 skipped
- npm run verify:build: app.js, app.css, index.html and daemon/dist/main.js(.map) rebuild byte-identical
- bun scripts/check.mjs agent-console: ok
- Playwright Chromium and WebKit, light and dark, sandbox HOME, page served under /_magpie/plugin/<id>/page with a stub bridge passing accent #ff0000:
  - accent: --accent and the primary button stay grey (rgb(38,38,38) light, rgb(229,229,229) dark); no <select> anywhere.
  - Settings menus: click opens the menu inside the window; ArrowDown+Enter picks, closes and refocuses the trigger; the pick persists through the daemon.
  - Esc closes the menu, not the dialog, and then closes the dialog. Clicking an option keeps the dialog open; a click outside closes the menu.
  - A host that was never opened writes beat:false and doesn't rewrite session.js. SIGKILL it, start a new host: the stale file is removed and the page reaches the new daemon.
  - After an open, session.js beats. SIGKILL the host: the page heals in ~5.3s and stays. A daemon-only crash heals in ~5.3s.
  - Daemon logs: no uncaughtException or EPIPE, one lifeline line per daemon exit.
Not tried: the composer pickers in a browser (they need a thread with an installed agent; same SelectMenu component), magpie's real sandboxed frame, Windows and Linux.
2026-11-01 00:37:07 +08:00

79 lines
3.8 KiB
CSS

/* Design tokens — "option B": quiet neutrals, one accent.
Magpie passes its palette as --magpie-* (?tokens=). Its font always applies; its surface colors apply only while this page
shows the same light/dark as Magpie (html[data-host-colors], set by layout/theme.ts), so an explicit Light/Dark setting never mixes palettes.
The accent is deliberately monochrome: charcoal in light mode, light grey in dark mode. Magpie's accent tokens are ignored
(layout/applyMagpieTokens.ts drops them), so the page never picks up a hue. Only semantic colors (ok/warn/danger/info, diff) carry color.
Font sizes are 12/13/14 (+ 18 for empty-state titles), weights 400/500/600. */
:root {
--own-bg: #ffffff; --own-sb: #f8f8f7; --own-fg: #1f1f1f; --own-muted: #737373; --own-line: #ececec;
--bg: var(--own-bg);
--sb-bg: var(--own-sb);
--fg: var(--own-fg);
--muted: var(--own-muted);
--line: var(--own-line);
--meta: #a3a3a3;
--text: #262626;
--accent: #262626; /* charcoal: send, primary buttons, links, active marker, running dot */
--accent-2: #525252; /* dark grey: active bar, running dot */
--accent-fg: #ffffff;
--accent-soft: #f0f0f0; /* user bubble: light neutral grey */
--surface: color-mix(in oklab, var(--fg) 3%, var(--bg));
--surface-hover: color-mix(in oklab, var(--fg) 6%, var(--bg));
--chip-bg: #f4f5f5; --chip-line: #ececec; --pill-fg: #525252;
--search-bg: #efefee;
--tile-bg: color-mix(in oklab, var(--fg) 90%, var(--bg)); --tile-fg: var(--bg);
--badge-bg: color-mix(in oklab, var(--fg) 7%, var(--bg)); --badge-fg: color-mix(in oklab, var(--fg) 80%, var(--bg));
--run-bg: #f0f0f0; --run-fg: #404040;
--cp-line: color-mix(in oklab, var(--fg) 11%, var(--bg));
--cp-focus: #a3a3a3; /* neutral grey focus border */
--cp-ring: rgb(0 0 0 / .06);
--active-bg: #ffffff; --active-line: #e6e6e6;
--ok: #16a34a; --warn: #d97706; --danger: #dc2626; --info: #2563eb;
--code-bg: #f4f5f5; --code-line: #eaeceb; --code-fg: #404040;
--add-bg: #ecfdf3; --del-bg: #fef2f2;
--r-s: 6px; --r-m: 8px; --r-l: 12px; --r-full: 999px;
--font-ui: var(--magpie-font, "Segoe UI Variable Text", "Segoe UI", -apple-system, "PingFang SC", "Microsoft YaHei UI", system-ui, sans-serif);
--font-mono: var(--magpie-code, "Cascadia Code", "Cascadia Mono", "JetBrains Mono", ui-monospace, Consolas, monospace);
--fs-s: 12px; --fs-m: 13px; --fs-l: 14px;
--fs-hero: 18px;
--lh: 1.6;
--col: 720px;
--row: 26px;
--shadow-pop: 0 8px 24px -6px rgb(0 0 0 / .16), 0 0 0 1px var(--line);
--term-bg: #ffffff;
--term-fg: #1e1e1e;
--ease: cubic-bezier(.2,.7,.2,1);
--dur-1: 120ms; --dur-2: 200ms;
color-scheme: light;
}
:root[data-theme="dark"] {
--own-bg: #1a1a1a; --own-sb: #151515; --own-fg: #ececec; --own-muted: #9b9b9b; --own-line: #2c2c2c;
--meta: #7c7c7c;
--text: #e2e2e2;
--accent: #e5e5e5; /* light grey / near-white */
--accent-2: #b3b3b3;
--accent-fg: #171717; /* dark icon/text on light accent */
--accent-soft: #2e2e2e;
--chip-bg: #252727; --chip-line: #323434; --pill-fg: #bdbdbd;
--search-bg: #242424;
--run-bg: #2e2e2e; --run-fg: #d4d4d4;
--cp-focus: #6b6b6b;
--cp-ring: rgb(255 255 255 / .07);
--active-bg: #242424; --active-line: #333333;
--info: #60a5fa;
--code-bg: #232323; --code-line: #303030; --code-fg: #d4d4d4;
--add-bg: rgb(22 163 74 / .16); --del-bg: rgb(220 38 38 / .16);
--shadow-pop: 0 8px 24px -6px rgb(0 0 0 / .5), 0 0 0 1px var(--line);
--term-bg: #0c0c0c;
--term-fg: #cccccc;
color-scheme: dark;
}
/* Same light/dark as Magpie: use its surfaces and text colors (card = content, bg = sidebar) */
:root[data-host-colors] {
--bg: var(--magpie-card, var(--magpie-bg, var(--own-bg)));
--sb-bg: var(--magpie-bg, var(--own-sb));
--fg: var(--magpie-fg, var(--own-fg));
--muted: var(--magpie-muted, var(--own-muted));
--line: var(--magpie-line, var(--own-line));
}