Skip to content

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/chat in 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 here

A 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.

#PrincipleMeaning
P 01Calm surfacesBorders + gentle elevation instead of shadows. Gradients may appear only as atmosphere, never as content color.
P 02Accent is meaningThe cream accent marks focus / route / in flow. Green is exclusively the semantic “Active”. Never swap them.
P 03Drawer instead of modalCreate / edit is always a right side drawer. Modal dialogs only for pure confirms.
P 04Table-first for listsData is tables, not walls of cards. Cards only for elements with icon + hierarchy + > 3 sub-values.
P 05Global ≠ projectCredentials 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 ​

TokenHexUsage
--brand-taupe-deep#1F1C17Dark-mode page background
--brand-taupe#4F4840Logo background, primary button light
--brand-taupe-soft#807769Subtle borders, dividers
--brand-cream#E8DFC5Visual accent, primary button dark
--brand-cream-strong#F3ECD6Highlight, headlines, inline code color

2.3 Accent ≠ Status ​

The strict separation:

TokenValue (Dark)Value (Light)Role
--accent#E8DFC5#4F4840Visual accent — focus, active tabs, primary
--accent-strong#F3ECD6#2B261FHeadlines, accent text, inline code
--accent-softrgba(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 ​

TokenDarkLightRole
--bg#0e100f#f5f1e8Page background
--bg-soft#141715#ede7dbSub-shell
--panel-strong#171918#fcfaf4Cards, drawers, modals
--surface-overlayrgba(255,255,255,.018)rgba(36,39,35,.025)Default card fill
--surface-overlay-strongrgba(255,255,255,.036)rgba(36,39,35,.045)Elevated / hover
--surface-overlay-hoverrgba(255,255,255,.06)rgba(36,39,35,.07)Interactive hover

3.2 Borders ​

TokenDarkRole
--border-softrgba(255,255,255,.04)Card borders, default
--borderrgba(255,255,255,.065)Separator
--border-strongrgba(255,255,255,.095)Hover / focus
--shell-dividerrgba(255,255,255,.055)Shell + header dividers

3.3 Text ​

TokenDarkLightRole
--text#efece4#1a1d1cBody
--highlight#f7f4ec#151816Titles
--muted-strong#cbc7bc#555a53Secondary text
--muted#898f86#7a8076Captions, eyebrows

4. Typography ​

One sans family (Inter) for UI, one mono (IBM Plex Mono) for code, IDs, paths.

css
font-family:      "Inter", "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
font-family-mono: "IBM Plex Mono", Consolas, monospace;
RoleSizeWeightLetter-spacingExample
eyebrow / kbd10 px700+0.14emSECTION · EYEBROW
label / chip10.5 px700+0.11emSTATUS · ACTIVE
caption11.5 px4000Description
body small12.5 px4000Form labels
body13.5 px4000Default body
card name14.7 px700-0.015emChannel · slack-prod
section title16.8 px650-0.02emKnowledge base
page title23 px700-0.03emAdmin Panel
empty-state h224–34 px (clamp)700-0.045emEmpty-state header
mono / id12.5 px4000proj_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.

TokenrempxUsage
xs0.254Icon gap, tight chip padding
sm0.58Default gap, button-gap
md0.7512Section padding, card-gap
lg116Card padding
xl1.524Between sections
2xl232Major gaps, tab-body padding
3xl348Hero space, empty-state offset

6. Radii & elevation ​

6.1 Radii ​

TokenremUsage
sm0.40Small inputs, inline code pills
md0.58Buttons
lg0.78Cards
xl0.95Surfaces
2xl1.08Shell
pill999pxBadges, Chips

6.2 Elevation ​

We use no decorative shadow on cards. Only these three are allowed:

css
/* 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.

StatusHexMeaning
Active / Done#79B88EActive entry, “on”, health: ok
Running / Live#6DA9D8Currently active, in progress, streaming
Attention#FBBF24Warn, approval pending, quota near
Error / Danger#F87171Error, delete, blocking issue
Idle / Inactive#7F8795Disabled, archived

Light-mode versions (stronger text + border):

StatusLight textLight border
Active#0D5132rgba(34,134,73,.32)
Running#075985rgba(14,116,144,.28)
Attention#92400Ergba(180,83,9,.28)
Error#B91C1Crgba(220,38,38,.32)
Inactive#555A53rgba(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 ​

StateSidebarSide panelDefault?
Default14 remhidden✓
Sidebar collapsed3.2 remhidden
Panel open14 rem20 rem
Both collapsed3.2 rem20 rem
css
.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" / null
    • oe-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>.

html
<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.

VariantBorderBackgroundShadow
Flatborder-softsurface-overlay—
Cardborder-softsurface-overlay-stronginset 0 1px 0 rgba(255,255,255,0.03)
Elevatedborderpanel-elevated0 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).

VariantClassUsage
Primary.admin-panel__action-btn--primaryThe one most important step. Max 1 per action row.
Default.admin-panel__action-btnSecondary, cancel, tertiary
Danger.admin-panel__danger-btnDestructive action. Always with confirm.
Ghost.admin-panel__action-btn + transparentTertiary, “View docs ↗”
SizeHeightPaddingFontUsage
Default1.9 rem0.35rem 0.7rem0.78remDrawer footer, section header, forms
Compact1.4 rem0.2rem 0.5rem0.7remTable actions only
Icon Close2.3 rem0 (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:

css
.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:

StateBorderHelper text color
Defaultborder-softvar(--muted)
Focus--accent + 3px ringvar(--muted)
Success--accent + 3px ring (--success-strong)var(--accent-strong)
Errorrgba(248,113,113,.55) + 3px red ring#FCA5A5 / #B91C1C
Disabledborder-soft + opacity 0.5var(--muted)
Read-onlyborder-soft + darker BG + mono fontvar(--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:

html
<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:

html
<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 ⌘K hint on the right.
  • With content: a clear button (small X circle) appears on the right.
  • Keyboard: ⌘K or / focuses · ESC clears & blurs.

Filter bar (above tables): search + filter pills + reset on the right.

html
<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 ​

VariantUsageContainer
Inline codeTokens, paths, IDs in running text (project.config)<code class="ds-inline-code">
Code blockSnippet with language + copy button.ds-code-block with .ds-code-block__toolbar + .ds-code-block__body
Plain logLogs / stack traces without a language.message-code-block--plain
DiffApproval 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.

ModifierDark surfaceDark textLight surfaceLight text
--activergba(74,222,128,.10)#9AE6B4rgba(34,134,73,.12)#0D5132
--inforgba(125,211,252,.10)#BAE6FDrgba(14,116,144,.10)#075985
--warningrgba(251,146,60,.10)#FDBA74rgba(180,83,9,.10)#92400E
--errorrgba(248,113,113,.10)#FCA5A5rgba(248,113,113,.12)#B91C1C
--inactivergba(255,255,255,.04)#CBC7BCrgba(36,39,35,.05)#555A53
--neutralrgba(255,255,255,.05)#CBC7BCrgba(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 ​

ComponentUsage
ToggleBoolean setting, takes effect immediately
CheckboxMulti-select in lists / forms
RadioEither-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 ​

VariantClassUsage
Composer pill.composer-pillInteractive dropdowns in the composer
Workspace chip.workspace__signal-chipRead-only metadata in the workspace header
Route chip.workspace__signal-chip--routeRouting 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.

TypeWidthUsageStructure
edit-drawer28 remCreate + editHeader · Form · Footer (Cancel + Primary)
detail-drawer38 remRead-only detail viewHeader with actions on the right · Sections · no footer
gate-drawer32 remMulti-step confirms (publish, destructive)Header · Gate badges · Notes · Publish/Cancel
side-panel20–24remPersistent workspace panelToggle 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”:

VariantWhenAnatomy
Inline emptyempty table / cardcentered text, max 2 lines, no icon
Big emptyempty tabIcon · Title · 2-line desc · max 2 actions
Hintnormal section textmuted 0.8rem, max-width 36rem
Inline Successafter a successful actiongreen-tinted box, in the section
Inline Errorvalidation errorred-tinted box, in the section
ToastAsync 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:

  1. Primary button is clearly recognizable in both themes (fill + border + text contrast).
  2. Default button border is visible in light (not white on white).
  3. Danger button text is dark red in light (#B91C1C), not light pink.
  4. Inputs have a visible border in light (at least rgba(36,39,35,.12)).
  5. Search field magnifier icon is dark enough to recognize in light.
  6. Badges text + border meet WCAG AA contrast in both themes.
  7. Inline code has dark accent text on light beige in light (not light on light).
  8. 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_id FK)
  • Built-in Tool Configs (project_id FK)
  • Workspace Policy (routing, runtime)
  • Agent / Runtime / Workflow Bindings

11.3 Data schemas ​

jsonc
// 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 :root used
  • [ ] 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.warn in the final state
  • [ ] No inline hex codes
  • [ ] Lighthouse contrast checks pass

14. Glossary ​

TermMeaning
TokenCSS custom property on :root — the only allowed source of a value
EyebrowSmall uppercase label above a heading, 0.62rem
Section HeaderEyebrow + bottom border + optional action buttons on the right
DrawerRight-side slide panel with backdrop
Side-PanelPersistent workspace panel on the right, without backdrop, via toggle
AccentVisual brand accent (cream on dark, taupe on light)
Status-ActiveSemantic green color — only for the “Active” meaning
Compact-ButtonSmaller button size, only for table actions
Inline alertSuccess / error box inside a section (no toast)
ToastFloating 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.

Octryx AI v0.0.1-alpha · Apache 2.0 · octryx.ai