diff --git a/docs/css-vars.md b/docs/css-vars.md index 7bf56e7b..ad140eb6 100644 --- a/docs/css-vars.md +++ b/docs/css-vars.md @@ -2,7 +2,7 @@ All colour variables are declared **once** in `frontend/packages/shared/src/base.css` under `:root`. -Per-page stylesheets (`dashboard.css`, `agent.css`) must reference these +Per-page stylesheets (`common.css`, `dashboard.css`, `flow.css`, `logs.css`, `agent.css`) must reference these names and must **not** redeclare them. ## Palette (`base.css`) @@ -17,11 +17,14 @@ names and must **not** redeclare them. | `--purple` | `#cba6f7` | mauve | accent — active tabs, links, highlights | | `--purple-dim` | `#45475a` | surface1 | subtle borders, terminal chrome, badge backgrounds | | `--cyan` | `#89dceb` | sky | tool-use events, info accents | +| `--blue` | `#89b4fa` | blue | links, interactive accent (distinct from sky) | | `--pink` | `#f5c2e7` | pink | thinking events | | `--amber` | `#fab387` | peach | warnings, pending / running state | +| `--yellow` | `#f9e2af` | yellow | flash messages, mild warnings | | `--green` | `#a6e3a1` | green | success, ok state | | `--red` | `#f38ba8` | red | errors, fail state | | `--border` | `#313244` | surface0 | general borders, hover/active backgrounds | +| `--subtext0` | `#a6adc8` | subtext0 | secondary toolbar/status text; dimmer than `--fg`, lighter than `--muted` | ## Common mistakes diff --git a/frontend/packages/agent/src/agent.css b/frontend/packages/agent/src/agent.css index 49a5bb8a..544cfc27 100644 --- a/frontend/packages/agent/src/agent.css +++ b/frontend/packages/agent/src/agent.css @@ -23,8 +23,9 @@ html, body { height: 100%; margin: 0; } /* Legacy in-page layout retained for the sibling stats page (`stats.html`) which doesn't apply `body.agent-shell` and stays - on a normal-document scroll. */ -body:not(.agent-shell) { + on a normal-document scroll. screen-shell is also excluded — it + manages its own full-viewport layout below. */ +body:not(.agent-shell):not(.screen-shell) { max-width: 110em; margin: 1.5em auto; padding: 0 1.5em; @@ -1033,3 +1034,103 @@ pre.diff { .stats-card.wide .chart-wrap { height: 260px; } .stats-empty-note { color: var(--muted); font-style: italic; } + +/* ─── /screen page ─── */ +/* Full-screen VNC canvas viewer (screen.html). All rules scoped to + body.screen-shell so they can coexist with the agent/stats rules. */ + +body.screen-shell { + font-size: 14px; + overflow: hidden; +} + +/* Toolbar strip at the top of the screen page. */ +#toolbar { + display: flex; + align-items: center; + gap: 0.75rem; + padding: 0.4rem 0.75rem; + background: var(--bg-elev); + border-bottom: 1px solid var(--border); +} +#toolbar a { + color: var(--blue); + text-decoration: none; + font-size: 0.85rem; +} +#toolbar a:hover { text-decoration: underline; } + +/* Toolbar toggle buttons (fit / match-size / debug). */ +.tbtn { + padding: 0.15rem 0.5rem; + font-size: 0.72rem; + font-family: inherit; + background: var(--border); + color: var(--subtext0); + border: 1px solid var(--purple-dim); + border-radius: 4px; + cursor: pointer; +} +.tbtn.active { color: var(--green); border-color: var(--green); } +.tbtn:disabled { opacity: 0.4; cursor: default; } + +/* Connection status chip at the right end of the toolbar. */ +#status { + margin-left: auto; + font-size: 0.75rem; + color: var(--subtext0); +} +#status.connected { color: var(--green); } +#status.error { color: var(--red); } + +/* RFB debug log — fixed panel at the bottom, hidden by default. */ +#debug-log { + position: fixed; + bottom: 0; left: 0; right: 0; + max-height: 40vh; + overflow-y: auto; + background: rgba(17, 17, 27, 0.95); + border-top: 1px solid var(--purple-dim); + font-size: 0.72rem; + font-family: ui-monospace, monospace; + padding: 0.4rem 0.6rem; + z-index: 100; + display: none; /* toggled by the debug button */ +} +#debug-log .dbg-line { color: var(--subtext0); margin: 1px 0; white-space: pre; } +#debug-log .dbg-line.err { color: var(--red); } +#debug-log .dbg-line.ok { color: var(--green); } +#debug-log .dbg-line.send { color: var(--blue); } + +/* Canvas container — centres the VNC framebuffer. */ +#canvas-wrap { + display: flex; + justify-content: center; + align-items: flex-start; + width: 100%; + height: calc(100% - 36px); + overflow: auto; + background: var(--crust); +} +/* Fit mode: canvas scaled in JS to fill the container. */ +#canvas-wrap.fit { align-items: center; overflow: hidden; } +#canvas-wrap canvas { display: block; cursor: default; } +/* Pin the canvas to the JS-calculated size; prevents flex-item + min-width:auto from silently expanding beyond the scaled size. */ +#canvas-wrap.fit canvas { flex: none; min-width: 0; min-height: 0; } + +/* Transient flash message (copy-text, disconnect, etc.). */ +#msg { + position: fixed; + bottom: 1rem; + left: 50%; + transform: translateX(-50%); + background: var(--border); + color: var(--yellow); + border-radius: 6px; + padding: 0.4rem 0.9rem; + font-size: 0.8rem; + opacity: 0; + transition: opacity 0.3s; + pointer-events: none; +} diff --git a/frontend/packages/agent/src/screen.html b/frontend/packages/agent/src/screen.html index d9e983ad..33b41d5c 100644 --- a/frontend/packages/agent/src/screen.html +++ b/frontend/packages/agent/src/screen.html @@ -5,78 +5,9 @@