Files
archie/ui/src/css/layout.css
T
sam 61e7fd3068 feat(webui): dashboard-aware chat — Archie sees the page, points you there
The web chat is now a persistent slide-over drawer available on any page
(not just the /chat route), and the agent is told which dashboard page the
operator is on so it can point them to the relevant page with a clickable chip.

Backend (gateway):
- Message gains a per-message Page field; the system prompt renders it in
  the <env> block (Current page), so Archie knows where the operator is.
- New dashboard_tools.go: a DashboardPages registry plus two web-only tools
  — page_index (lists every page and what it shows) and dashboard_navigate
  (validates a path, returns {path,label}; rejects unknown/empty paths).
- The web chat sink emits a dedicated navigate stream event when the model
  calls dashboard_navigate, independent of ShowToolCalls.

Frontend (webui):
- chat sends currentPage() (location.hash) with each stream request; a
  dashboard_navigate result renders as a clickable link chip (href=#/path).
- The chat is mounted once in a slide-over drawer with a topbar launcher,
  scrim and Esc-to-close; /chat opens the drawer instead of a second page.
- ui/dist rebuilt (committed) with the bundled changes.
- .gitignore: ignore .impeccable/ (impeccable tool critique snapshots).

New capability (per scope discipline): designed in
docs/prds/dashboard-aware-chat-navigation.md.

Tests: dashboard_tools_test (registry, resolve/reject, web-only gating),
prompt page-line cases, webui Message.Page + navigate-frame capture, and
chat-tools chip tests. task check is green.
2026-08-28 22:28:10 +10:00

364 lines
8.8 KiB
CSS

/* The shell: one contained, rounded application surface floating on a lit
* canvas.
*
* The dashboard is a *workspace*, not a document that fills the viewport --
* framing it gives the panels an edge to sit against, and lets the canvas
* behind read as light rather than wallpaper. Everything inside is translucent
* so that light carries through instead of stopping at the first opaque card.
*/
body {
/* The luminous canvas. Large, off-axis and low-frequency, so it lights the
workspace rather than competing with it. */
background:
radial-gradient(70rem 40rem at 8% -10%, var(--wash-a), transparent 62%),
radial-gradient(56rem 34rem at 92% 4%, var(--wash-b), transparent 58%),
radial-gradient(48rem 30rem at 50% 108%, var(--wash-c), transparent 60%),
var(--bg);
background-attachment: fixed;
padding: var(--sp-4);
}
.shell {
min-height: calc(100vh - var(--sp-4) * 2);
display: flex;
flex-direction: column;
border-radius: var(--radius-xl);
border: 1px solid var(--hairline);
background: var(--workspace);
backdrop-filter: blur(28px) saturate(120%);
box-shadow: var(--shadow-workspace);
overflow: hidden;
}
/* ── Command bar ────────────────────────────────────────────────────────── */
.topbar {
display: flex;
align-items: center;
gap: var(--sp-4);
padding: var(--sp-3) var(--sp-4);
border-bottom: 1px solid var(--hairline);
background: var(--bg-blur);
position: sticky;
top: 0;
z-index: 10;
}
.brand {
display: flex;
align-items: center;
gap: var(--sp-2);
font-weight: 600;
font-size: var(--text-sm);
letter-spacing: -0.01em;
flex: none;
}
.brand-mark {
width: 26px;
height: 26px;
border-radius: 8px;
background: linear-gradient(135deg, var(--accent), var(--accent-2));
display: grid;
place-items: center;
color: #fff;
font-size: var(--text-xs);
font-weight: 700;
}
/* Navigation is always labelled. Operators should never have to memorise an
icon vocabulary just to move around the control plane. */
.nav {
display: flex;
align-items: center;
gap: 2px;
margin: 0 auto;
padding: 3px;
border-radius: var(--radius-pill);
background: var(--surface-glass-strong);
border: 1px solid var(--hairline);
}
.nav-item {
display: inline-flex;
align-items: center;
gap: var(--sp-2);
padding: var(--sp-2) var(--sp-3);
border-radius: var(--radius-pill);
color: var(--fg-muted);
font-size: var(--text-sm);
white-space: nowrap;
cursor: pointer;
transition: background var(--transition), color var(--transition);
}
.nav-item:hover {
color: var(--fg);
background: var(--surface-hover);
}
.nav-item[aria-current="page"] {
background: var(--accent);
color: var(--accent-fg);
font-weight: 500;
}
.nav-item .nav-label {
display: inline;
}
/* ── Utility cluster ────────────────────────────────────────────────────── */
.topbar-end {
display: flex;
align-items: center;
gap: var(--sp-2);
flex: none;
}
.topbar-search {
display: flex;
align-items: center;
gap: var(--sp-2);
padding: var(--sp-2) var(--sp-3);
border-radius: var(--radius-pill);
background: var(--surface-glass-strong);
border: 1px solid var(--hairline);
color: var(--fg-subtle);
}
.topbar-search input {
background: none;
border: 0;
color: var(--fg);
font: inherit;
font-size: var(--text-sm);
width: 8rem;
outline: none;
}
.topbar-search input::placeholder {
color: var(--fg-subtle);
}
.mobile-search-toggle {
display: none;
}
.icon-btn {
display: grid;
place-items: center;
width: 32px;
height: 32px;
border-radius: var(--radius-pill);
border: 1px solid var(--hairline);
background: var(--surface-glass-strong);
color: var(--fg-muted);
cursor: pointer;
transition: color var(--transition), background var(--transition);
}
.icon-btn:hover {
color: var(--fg);
background: var(--surface-hover);
}
.avatar {
width: 32px;
height: 32px;
border-radius: var(--radius-pill);
display: grid;
place-items: center;
font-size: var(--text-xs);
font-weight: 600;
color: #fff;
background: linear-gradient(135deg, var(--accent), var(--accent-2));
cursor: pointer;
flex: none;
}
.ico {
flex: none;
display: block;
}
/* ── Canvas ─────────────────────────────────────────────────────────────── */
.main {
padding: var(--sp-6);
width: 100%;
flex: 1;
overflow-x: hidden;
}
/* ── Chat drawer ─────────────────────────────────────────────────────── */
/* The chat is a persistent slide-over, not a route: it is mounted once and
opened from the topbar, so the operator can talk to Archie from any page
without leaving the work that prompted the question. It overlays the
layout rather than replacing it, and the navigation/outlet stay interactive
behind the scrim. */
.chat-drawer {
position: fixed;
inset: var(--sp-4);
display: flex;
align-items: stretch;
justify-content: flex-end;
pointer-events: none;
z-index: 40;
}
.chat-drawer-panel {
pointer-events: auto;
position: relative;
z-index: 1;
display: grid;
grid-template-rows: auto minmax(0, 1fr);
width: min(430px, 100%);
height: 100%;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
box-shadow: var(--shadow-md);
overflow: hidden;
opacity: 0;
transform: translateX(1.2rem);
transition: opacity var(--transition), transform var(--transition);
}
/* A closed (opacity-0, still mounted) panel must not block the page behind
it: opacity does not disable hit-testing, so without this the invisible
430px panel would make the whole right column unclickable at z-index 40. */
.chat-drawer:not(.is-open) .chat-drawer-panel {
pointer-events: none;
}
.chat-drawer.is-open .chat-drawer-panel {
opacity: 1;
transform: none;
}
.chat-drawer-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--sp-2);
padding: var(--sp-3) var(--sp-4);
border-bottom: 1px solid var(--border);
}
.chat-scrim {
position: fixed;
inset: 0;
background: color-mix(in srgb, var(--bg) 40%, transparent);
opacity: 0;
pointer-events: none;
transition: opacity var(--transition);
}
/* The scrim shows and closes from outside clicks only when the drawer is
open; it is driven by the drawer's own state so it can never be on top of
a closed drawer. */
.chat-drawer.is-open .chat-scrim {
opacity: 1;
pointer-events: auto;
}
body.chat-open {
overflow: hidden;
}
/* ── Constrained desktop ────────────────────────────────────────────────── */
@media (max-width: 1220px) and (min-width: 901px) {
.topbar {
flex-wrap: wrap;
}
.nav {
order: 3;
width: 100%;
margin: 0;
justify-content: center;
flex-wrap: wrap;
border-radius: var(--radius-lg);
}
}
/* ── Narrow screens ─────────────────────────────────────────────────────── */
/* The frame is a desktop affordance. Below the breakpoint the workspace goes
edge to edge -- a rounded card inset on a phone wastes the only axis that
matters -- and the icon bar becomes a scrollable labelled row. */
@media (max-width: 900px) {
body {
padding: 0;
}
.shell {
min-height: 100vh;
border-radius: 0;
border: 0;
box-shadow: none;
}
.topbar {
flex-wrap: wrap;
padding: var(--sp-3);
gap: var(--sp-2);
}
.nav {
order: 3;
width: 100%;
overflow-x: auto;
justify-content: flex-start;
flex-wrap: nowrap;
border-radius: var(--radius-lg);
scrollbar-width: none;
}
.nav::-webkit-scrollbar {
display: none;
}
.nav-item .nav-label {
display: inline;
}
.topbar-search {
padding: 0;
border: 0;
background: transparent;
overflow: hidden;
}
.topbar-search-icon {
display: none;
}
.mobile-search-toggle {
display: grid;
}
.topbar-search input {
width: 0;
padding: 0;
opacity: 0;
pointer-events: none;
transition: width var(--transition), opacity var(--transition);
}
.topbar-search.is-open,
.topbar-search:focus-within {
padding-right: var(--sp-2);
border: 1px solid var(--hairline);
background: var(--surface-glass-strong);
}
.topbar-search.is-open input,
.topbar-search:focus-within input {
width: min(9rem, 34vw);
opacity: 1;
pointer-events: auto;
}
.main {
padding: var(--sp-4);
}
}