Design guide for the web app
Design contract. This page is the single source of truth for every surface of the Octryx AI web app (
frontend/chatin the repository). If this page and the code contradict each other, this page wins. Patches that violate it are not merged. Living document: every extension of the system lands here first, then in the token files, then in the code.
The values live only in the code: frontend/chat/src/styles/chat/ds-tokens.css (sizes), ui-set.css (shared component shapes) and theme-base.css (colours, light and dark).
0. Hierarchy of truth
This wiki page ← rules, principles
↓
ds-tokens.css · ui-set.css · theme-base.css ← token implementation (+ domain CSS alongside)
↓
Live React code ← must not deviate from hereA deviation in the code that is not documented on this page counts as a visual bug.
1. Design principles
Five sentences. They stand above every detail rule.
| # | Principle | Meaning |
|---|---|---|
| P 01 | Calm surfaces | Borders + gentle elevation instead of shadows. Gradients may appear only as atmosphere, never as content color. |
| P 02 | Accent is meaning | The cream accent marks focus / route / in flow. Green is exclusively the semantic “Active”. Never swap them. |
| P 03 | Drawer instead of modal | Create / edit is always a right side drawer. Modal dialogs only for pure confirms. |
| P 04 | Table-first for lists | Data is tables, not walls of cards. Cards only for elements with icon + hierarchy + > 3 sub-values. |
| P 05 | Global ≠ project | Credentials and definitions are global. Assignment and usage are per project. UIs must make this separation visible. |
2. Brand identity
2.1 Mark
- File:
assets/logo.png - Shape: round circle, 1:1
- Minimum size: 24×24 px
- Usage: only on a neutral or taupe background — never on a colored surface and never tinted.
2.2 Brand palette — the five values
| Token | Hex | Usage |
|---|---|---|
--brand-taupe-deep | #1F1C17 | Dark-mode page background |
--brand-taupe | #4F4840 | Logo background, primary button light |
--brand-taupe-soft | #807769 | Subtle borders, dividers |
--brand-cream | #E8DFC5 | Visual accent, primary button dark |
--brand-cream-strong | #F3ECD6 | Highlight, headlines, inline code color |
2.3 Accent ≠ Status
The strict separation:
| Token | Value (Dark) | Value (Light) | Role |
|---|---|---|---|
--accent | #E8DFC5 | #4F4840 | Visual accent — focus, active tabs, primary |
--accent-strong | #F3ECD6 | #2B261F | Headlines, accent text, inline code |
--accent-soft | rgba(216,200,154,.14) | rgba(79,72,64,.10) | Tinted active backgrounds |
--status-active | #79B88E | #226845 (text) | Semantic — only active badge / live dot |
Don't: use sage green where accent is meant (e.g. primary button fill, tab underline). If a surface looks too green to you — it is.
2.4 Tone of voice
- Direct, technical, concise. No marketing phrases, no exclamations.
- Imperative in action buttons: “Save changes”, “Delete forever”, “Publish” — never “Save my changes please”.
- Sentence case in headers (except brand & proper names). Never Title Case Everywhere.
- English throughout: the UI, the docs and the internal specs.
3. Color tokens
All values as CSS custom properties on :root / [data-theme="light"]. Never hex codes directly in components.
3.1 Surface
| Token | Dark | Light | Role |
|---|---|---|---|
--bg | #0e100f | #f5f1e8 | Page background |
--bg-soft | #141715 | #ede7db | Sub-shell |
--panel-strong | #171918 | #fcfaf4 | Cards, drawers, modals |
--surface-overlay | rgba(255,255,255,.018) | rgba(36,39,35,.025) | Default card fill |
--surface-overlay-strong | rgba(255,255,255,.036) | rgba(36,39,35,.045) | Elevated / hover |
--surface-overlay-hover | rgba(255,255,255,.06) | rgba(36,39,35,.07) | Interactive hover |
3.2 Borders
| Token | Dark | Role |
|---|---|---|
--border-soft | rgba(255,255,255,.04) | Card borders, default |
--border | rgba(255,255,255,.065) | Separator |
--border-strong | rgba(255,255,255,.095) | Hover / focus |
--shell-divider | rgba(255,255,255,.055) | Shell + header dividers |
3.3 Text
| Token | Dark | Light | Role |
|---|---|---|---|
--text | #efece4 | #1a1d1c | Body |
--highlight | #f7f4ec | #151816 | Titles |
--muted-strong | #cbc7bc | #555a53 | Secondary text |
--muted | #898f86 | #7a8076 | Captions, eyebrows |
4. Typography
One sans family (Inter) for UI, one mono (IBM Plex Mono) for code, IDs, paths.
font-family: "Inter", "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
font-family-mono: "IBM Plex Mono", Consolas, monospace;| Role | Size | Weight | Letter-spacing | Example |
|---|---|---|---|---|
| eyebrow / kbd | 10 px | 700 | +0.14em | SECTION · EYEBROW |
| label / chip | 10.5 px | 700 | +0.11em | STATUS · ACTIVE |
| caption | 11.5 px | 400 | 0 | Description |
| body small | 12.5 px | 400 | 0 | Form labels |
| body | 13.5 px | 400 | 0 | Default body |
| card name | 14.7 px | 700 | -0.015em | Channel · slack-prod |
| section title | 16.8 px | 650 | -0.02em | Knowledge base |
| page title | 23 px | 700 | -0.03em | Admin Panel |
| empty-state h2 | 24–34 px (clamp) | 700 | -0.045em | Empty-state header |
| mono / id | 12.5 px | 400 | 0 | proj_7Xa·b8f |
Rule: No other font stack. No Inter with Cyrillic mods. If a value is missing here — you don't need it.
5. Spacing
4 px based. Every spacing must come from this table — no in-between values.
| Token | rem | px | Usage |
|---|---|---|---|
| xs | 0.25 | 4 | Icon gap, tight chip padding |
| sm | 0.5 | 8 | Default gap, button-gap |
| md | 0.75 | 12 | Section padding, card-gap |
| lg | 1 | 16 | Card padding |
| xl | 1.5 | 24 | Between sections |
| 2xl | 2 | 32 | Major gaps, tab-body padding |
| 3xl | 3 | 48 | Hero space, empty-state offset |
6. Radii & elevation
6.1 Radii
| Token | rem | Usage |
|---|---|---|
| sm | 0.40 | Small inputs, inline code pills |
| md | 0.58 | Buttons |
| lg | 0.78 | Cards |
| xl | 0.95 | Surfaces |
| 2xl | 1.08 | Shell |
| pill | 999px | Badges, Chips |
6.2 Elevation
We use no decorative shadow on cards. Only these three are allowed:
/* Top light on buttons + cards (always) */
box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
/* Drawer / shell (outside) */
--shell-shadow-soft: 0 14px 34px rgba(0, 0, 0, 0.22);
/* Right-side drawer (side shadow) */
box-shadow: -16px 0 36px rgba(0, 0, 0, 0.32);7. Status colors
Four fixed semantic colors + inactive. The meanings are fixed.
| Status | Hex | Meaning |
|---|---|---|
| Active / Done | #79B88E | Active entry, “on”, health: ok |
| Running / Live | #6DA9D8 | Currently active, in progress, streaming |
| Attention | #FBBF24 | Warn, approval pending, quota near |
| Error / Danger | #F87171 | Error, delete, blocking issue |
| Idle / Inactive | #7F8795 | Disabled, archived |
Light-mode versions (stronger text + border):
| Status | Light text | Light border |
|---|---|---|
| Active | #0D5132 | rgba(34,134,73,.32) |
| Running | #075985 | rgba(14,116,144,.28) |
| Attention | #92400E | rgba(180,83,9,.28) |
| Error | #B91C1C | rgba(220,38,38,.32) |
| Inactive | #555A53 | rgba(36,39,35,.14) |
8. Layout
8.1 App shell — 3 columns
┌──────────┬─────────────────────────┬───────────────┐
│ Sidebar │ Workspace │ Side panel │
│ 14 rem │ 1fr (chat/forms/tables) │ 20 rem │
│ threads │ │ files/trace │
└──────────┴─────────────────────────┴───────────────┘8.2 Four layout states
| State | Sidebar | Side panel | Default? |
|---|---|---|---|
| Default | 14 rem | hidden | ✓ |
| Sidebar collapsed | 3.2 rem | hidden | |
| Panel open | 14 rem | 20 rem | |
| Both collapsed | 3.2 rem | 20 rem |
.chat-app { grid-template-columns: 14rem 1fr 0; }
.chat-app[data-sidebar-collapsed] { grid-template-columns: 3.2rem 1fr 0; }
.chat-app[data-side-panel-open] { grid-template-columns: 14rem 1fr 20rem; }
.chat-app[data-sidebar-collapsed][data-side-panel-open]
{ grid-template-columns: 3.2rem 1fr 20rem; }Rules:
- The sidebar toggle sits at the top of the sidebar.
- The side panel toggle sits at the top right of the workspace header.
- Both states persist in
localStorage:oe-sidebar-collapsed:"1"/nulloe-side-panel-open:"1"/null
- Sidebar collapse: hide labels, icons + active markers stay.
8.3 Section Header
Every logical block starts with it. Never a bare <h2>.
<div class="admin-panel__section-header">
<span>Knowledge · Engineering Packs</span> <!-- Eyebrow, 0.66rem uppercase muted -->
<div>
<button class="admin-panel__action-btn">Import</button>
<button class="admin-panel__action-btn admin-panel__action-btn--primary">+ Add pack</button>
</div>
</div>Eyebrow + action slot on the right · bottom border · no top padding to the tab bar.
8.4 Surface elevations
Three levels. Shadows only from the drawer/modal level up.
| Variant | Border | Background | Shadow |
|---|---|---|---|
| Flat | border-soft | surface-overlay | — |
| Card | border-soft | surface-overlay-strong | inset 0 1px 0 rgba(255,255,255,0.03) |
| Elevated | border | panel-elevated | 0 8px 22px rgba(0,0,0,0.18) + top light |
9. Components — Catalog
9.1 Buttons
Four variants × two sizes. No fifth variant. No third size (except the icon-only close at 2.3rem).
| Variant | Class | Usage |
|---|---|---|
| Primary | .admin-panel__action-btn--primary | The one most important step. Max 1 per action row. |
| Default | .admin-panel__action-btn | Secondary, cancel, tertiary |
| Danger | .admin-panel__danger-btn | Destructive action. Always with confirm. |
| Ghost | .admin-panel__action-btn + transparent | Tertiary, “View docs ↗” |
| Size | Height | Padding | Font | Usage |
|---|---|---|---|---|
| Default | 1.9 rem | 0.35rem 0.7rem | 0.78rem | Drawer footer, section header, forms |
| Compact | 1.4 rem | 0.2rem 0.5rem | 0.7rem | Table actions only |
| Icon Close | 2.3 rem | 0 (square) | — | Drawer close X |
Compact rule: Compact is a size variant, not a wording. Labels stay full (“Edit”, “Delete”). When space is short → icon-only variant. Forbidden: Del, Ed, Sv, Rmv, etc.
States:
- Hover: brightness +8%
- Focus: 3px accent ring (
box-shadow: 0 0 0 3px var(--accent-soft)), never the native outline - Disabled:
opacity: 0.45; cursor: not-allowed; - Loading: spinner + disabled, the label stays visible (e.g. “Saving…”)
Button group order: Cancel on the left, Primary/Danger on the right. Gap always 0.4rem.
9.2 Form fields
Uniform geometry for every input field:
.form-input {
padding: 0.5rem 0.7rem;
border: 1px solid var(--border-soft);
border-radius: 0.5rem; /* radii.md */
background: rgba(255,255,255,0.04);
font-size: 0.82rem;
outline: none;
transition: border-color 160ms, box-shadow 160ms;
}
.form-input:focus {
border-color: color-mix(in srgb, var(--accent) 50%, transparent);
box-shadow: 0 0 0 3px var(--accent-soft);
}Variants: input[type=text|url|email|password|number], <select>, <textarea> — all share the geometry.
Validation states:
| State | Border | Helper text color |
|---|---|---|
| Default | border-soft | var(--muted) |
| Focus | --accent + 3px ring | var(--muted) |
| Success | --accent + 3px ring (--success-strong) | var(--accent-strong) |
| Error | rgba(248,113,113,.55) + 3px red ring | #FCA5A5 / #B91C1C |
| Disabled | border-soft + opacity 0.5 | var(--muted) |
| Read-only | border-soft + darker BG + mono font | var(--muted) |
- Field labels: sentence case like table headers (0.74rem, weight 600, muted); no uppercase, no letter-spacing — one label style in all forms.
- Required: red-styled
*at the end of the label. Never write out the word “required”. - Helper text sits below the field, 0.7rem, muted.
- Never color alone for errors — always with explanatory helper text.
Form grid:
<div class="admin-form-grid"> <!-- 2-column grid, gap 0.8rem -->
<label class="admin-form-field"> … </label>
<label class="admin-form-field admin-form-grid__full"> … </label> <!-- full width -->
</div>9.3 Search & Filter Bar
Search field — fixed pattern:
<label class="ds-search">
<svg><!-- magnifier --></svg>
<input placeholder="Search threads, files, agents…" />
<kbd>⌘ K</kbd> <!-- optional: keyboard shortcut hint -->
</label>- Icon on the left, optional
⌘Khint on the right. - With content: a clear button (small X circle) appears on the right.
- Keyboard:
⌘Kor/focuses ·ESCclears & blurs.
Filter bar (above tables): search + filter pills + reset on the right.
<div class="ds-filter-bar">
<label class="ds-search"> … </label>
<button class="ds-filter-pill ds-filter-pill--active">Status · Active</button>
<button class="ds-filter-pill">Provider · All</button>
<button class="admin-panel__action-btn" style="margin-left:auto">Reset</button>
</div>An active filter pill uses the accent tint (--accent-soft + --accent-strong text).
9.4 Code & Data display
| Variant | Usage | Container |
|---|---|---|
| Inline code | Tokens, paths, IDs in running text (project.config) | <code class="ds-inline-code"> |
| Code block | Snippet with language + copy button | .ds-code-block with .ds-code-block__toolbar + .ds-code-block__body |
| Plain log | Logs / stack traces without a language | .message-code-block--plain |
| Diff | Approval preview, trace | .ds-diff with .ds-diff__add / .ds-diff__rem |
Code block toolbar: language on the left (uppercase 0.62rem), copy button on the right. Body in mono 0.74rem, overflow-x: auto, never wrap.
Diff rule: + lines green-tinted full width (.ds-diff__add), − lines red full width (.ds-diff__rem). Never color only the word.
9.5 Badges
Pill-shaped (radius 999px), 0.62rem, uppercase, letter-spacing 0.08em.
| Modifier | Dark surface | Dark text | Light surface | Light text |
|---|---|---|---|---|
--active | rgba(74,222,128,.10) | #9AE6B4 | rgba(34,134,73,.12) | #0D5132 |
--info | rgba(125,211,252,.10) | #BAE6FD | rgba(14,116,144,.10) | #075985 |
--warning | rgba(251,146,60,.10) | #FDBA74 | rgba(180,83,9,.10) | #92400E |
--error | rgba(248,113,113,.10) | #FCA5A5 | rgba(248,113,113,.12) | #B91C1C |
--inactive | rgba(255,255,255,.04) | #CBC7BC | rgba(36,39,35,.05) | #555A53 |
--neutral | rgba(255,255,255,.05) | #CBC7BC | rgba(36,39,35,.06) | #475569 |
Rules:
- Max 1 badge per row role.
- Max 3 badges side by side.
- Light + dark values must meet WCAG AA contrast.
9.6 Toggle · Checkbox · Radio
| Component | Usage |
|---|---|
| Toggle | Boolean setting, takes effect immediately |
| Checkbox | Multi-select in lists / forms |
| Radio | Either-or |
- The checked color is accent (cream).
- Keyboard: Space toggles; arrows for radio groups.
- A toggle is never a disguised checkbox look — always the pill track with thumb.
9.7 Sub-Tab Bar
Inside a tab (e.g. Knowledge → Base / Packs / Graph).
- Inactive: muted text
- Active: bright text + 2px accent underline (no pill, no BG fill)
- Hover: change only the text color
9.8 Pills, Chips & Signals
| Variant | Class | Usage |
|---|---|---|
| Composer pill | .composer-pill | Interactive dropdowns in the composer |
| Workspace chip | .workspace__signal-chip | Read-only metadata in the workspace header |
| Route chip | .workspace__signal-chip--route | Routing indicator — accent tint |
9.9 Tables
- Header: sentence case (like
DataTable), 0.74rem (--ds-font-size-small), weight 600, muted; no uppercase, no letter-spacing — one header font in all tables - Body: 0.82rem
- Sortable columns: ↑↓ indicator
- Row click → detail drawer
- Actions: on the right, compact buttons with full labels
- Empty:
.admin-panel__empty-state(centered, 2 lines, no icon)
9.10 Overview / KPI Cards
- Max 4 cards in a row
- Label on top (eyebrow), value large (1.35rem 700), meta below (0.7rem muted)
- Trend:
↑green,↓red. Never a donut or bars here — KPIs are numbers.
9.11 Drawers — the ONLY overlay pattern
Four fixed variants. Modal dialogs are allowed only for confirms.
| Type | Width | Usage | Structure |
|---|---|---|---|
edit-drawer | 28 rem | Create + edit | Header · Form · Footer (Cancel + Primary) |
detail-drawer | 38 rem | Read-only detail view | Header with actions on the right · Sections · no footer |
gate-drawer | 32 rem | Multi-step confirms (publish, destructive) | Header · Gate badges · Notes · Publish/Cancel |
side-panel | 20–24rem | Persistent workspace panel | Toggle from the header, no backdrop |
Shared rules:
- Slides in from the right with a backdrop (side panel excepted).
- Backdrop click → close. With a dirty form → confirm modal.
- ESC closes.
- Side shadow:
-16px 0 36px rgba(0,0,0,0.32).
9.12 Empty States · Hints · Toasts
Three sizes for “nothing here” and “pay attention here”:
| Variant | When | Anatomy |
|---|---|---|
| Inline empty | empty table / card | centered text, max 2 lines, no icon |
| Big empty | empty tab | Icon · Title · 2-line desc · max 2 actions |
| Hint | normal section text | muted 0.8rem, max-width 36rem |
| Inline Success | after a successful action | green-tinted box, in the section |
| Inline Error | validation error | red-tinted box, in the section |
| Toast | Async feedback (background save, reconnect) | bottom-right, max 3 stacked, 4s auto-dismiss |
Rule: Toast only for async feedback. Form validation, save confirmation, permission errors → inline, never as a toast.
10. Light/Dark — Validation Matrix
Every new component must pass in both themes. If even one of the following checks fails → the patch is blocked:
- Primary button is clearly recognizable in both themes (fill + border + text contrast).
- Default button border is visible in light (not white on white).
- Danger button text is dark red in light (
#B91C1C), not light pink. - Inputs have a visible border in light (at least
rgba(36,39,35,.12)). - Search field magnifier icon is dark enough to recognize in light.
- Badges text + border meet WCAG AA contrast in both themes.
- Inline code has dark accent text on light beige in light (not light on light).
- Inline success/error boxes have dark text with a strong border in light.
11. Architecture — Global vs Per-Project
Octryx AI is multi-tenant. The data models and UIs must make the separation visible.
11.1 Global · Infrastructure
What the platform provides. Set up once, applies to all projects. Sits under Platform in the admin sidebar.
- LLM Provider Credentials (
StoredSecret.project_id = NULL) - TTS / STT Provider Credentials
- Agent & Mode Definitions (Catalog)
- MCP Server Definitions
- Runtime Execution Settings (Docker, PIDs, security)
- Branding · OIDC · SSO
11.2 Per-Project · Usage
What a project uses of it. Isolated per project. Lives in the Project Settings Drawer.
- LLM Provider Assignment (
WorkspaceCapability) - TTS / STT Usage Config (
project.config) - Channels (
project_idFK) - Built-in Tool Configs (
project_idFK) - Workspace Policy (routing, runtime)
- Agent / Runtime / Workflow Bindings
11.3 Data schemas
// project.config (per-project, JSON column)
{
"tts": { "enabled": true, "provider": "openai", "default_voice": "nova", "default_speed": 1.0 },
"stt": { "enabled": true, "provider": "openai" }
}
// StoredSecret (global, project_id = NULL)
{ "key": "openai_tts_api_key", "project_id": null, "value": "sk-…" }11.4 UI rule
Global tabs sit under Platform in the admin sidebar. Per-project settings live in the Project Settings Drawer. Never mix them in the same view.
12. Do & Don't
✓ Do
- Use CSS tokens (
var(--accent),var(--border-soft)). - Section header with eyebrow + bottom border.
- Lists as a table, detail in the right drawer.
- Required: red asterisk, not the word.
- Compact buttons with full labels (“Edit”, “Delete”).
- Accent (cream) for focus / route / brand.
- Green only for the “Active” status.
- Inline success/error in the section.
- Toast only for asynchronous feedback.
- Sidebar collapsible, side panel via toggle (closed by default).
- Check light + dark in the matrix (§10).
- Separate global vs per-project visually.
✗ Don't
- No hard-coded hex codes — everything via tokens.
- No centered create/edit modals — always a drawer.
- No shadows on cards (only drawer / modal).
- No colored gradients as content color.
- No two primary buttons in one action row.
- No abbreviated button labels (“Del”, “Ed”, “Sv”).
- No sage green as the visual accent (the brand is cream).
- No cyan-tinted primary buttons (invisible in light).
- Side panel not open by default — only via an explicit toggle.
- No toast for static form validation.
- No emoji as a UI icon.
- No wall of cards instead of a table for > 5 entries.
- Never tint the logo, place it on a colorful surface or shrink it below 24×24 px.
13. Template Checklist
Before a new tab / screen is merged, it must pass all items.
Foundations
- [ ] Tokens from
:rootused - [ ] Font: Inter + IBM Plex Mono, sizes from §4
- [ ] Spacing from the 4 px scale (§5)
- [ ] Light/dark matrix (§10) run through
Brand
- [ ] No sage green as the visual accent
- [ ] Accent is cream/taupe
- [ ] Logo, if used, unchanged & in a permitted environment
Layout
- [ ] Section header with eyebrow + bottom border
- [ ] Sidebar collapse/expand tested
- [ ] Side panel only via toggle, closed by default
- [ ] List as a table, detail as a right drawer
- [ ] Empty state + hint present
Components
- [ ] Max 1 primary per action row
- [ ] Badges pill-shaped, uppercase, light+dark checked
- [ ] Required: red asterisk
- [ ] Compact buttons with full labels
- [ ] Search field with magnifier + ⌘K hint
- [ ] Code blocks with toolbar + copy
Architecture
- [ ] Global vs per-project consistently separated
- [ ] Credentials >
StoredSecret(project_id NULL for global) - [ ] Usage config in
project.config - [ ] Tab registered in the admin sidebar
Quality gates
- [ ] No
console.error/console.warnin the final state - [ ] No inline hex codes
- [ ] Lighthouse contrast checks pass
14. Glossary
| Term | Meaning |
|---|---|
| Token | CSS custom property on :root — the only allowed source of a value |
| Eyebrow | Small uppercase label above a heading, 0.62rem |
| Section Header | Eyebrow + bottom border + optional action buttons on the right |
| Drawer | Right-side slide panel with backdrop |
| Side-Panel | Persistent workspace panel on the right, without backdrop, via toggle |
| Accent | Visual brand accent (cream on dark, taupe on light) |
| Status-Active | Semantic green color — only for the “Active” meaning |
| Compact-Button | Smaller button size, only for table actions |
| Inline alert | Success / error box inside a section (no toast) |
| Toast | Floating notification at the bottom right for async feedback |
15. Versioning
This document follows SemVer on token/component breaking changes:
- Major (v2.0): breaking change in tokens (e.g. renaming
--accent). - Minor (v1.x): new component or new variant, backward compatible.
- Patch (v1.0.x): token value correction, docs fix.
Current version: v1.0.0 — brand re-tokenization (sage green → cream/taupe), light-mode fixes, sidebar/panel toggle pattern documented.
