Skip to content

Latest commit

 

History

History
133 lines (94 loc) · 20.3 KB

DESIGN.md

File metadata and controls

133 lines (94 loc) · 20.3 KB

UI Design Specification

Maka is a desktop, terminal, and iPhone workspace for directing and supervising agents. The layout stays quiet, native, and compact: spacious where users read or make decisions, dense where side-by-side comparison matters. Activity, permissions, failures, and artifacts remain inspectable inline without turning the window into a telemetry dashboard.

The NSH design guide sets the foundation; this document specifies Maka's rules on top of it and holds only rules that span screens—the per-screen motion inventories NSH requires belong in the pull request. ui.tsx is the source of truth for design tokens—when prose and code diverge, update the wrong one in the same change. Terminal mode runs the same workbench on a character grid, gating desktop-only pixel geometry behind platform.idiom === 'terminal'.

Visual hierarchy

  • Every region has one focal point. An element earns its space only if it informs what the user does next.
  • Strip away accent colors and decoration: the primary task, active selection, and next action must still read clearly from layout and contrast alone.

Surfaces and borders

Maka's surface system follows a few generating rules, learned from Google Antigravity's; tokens in ui.tsx encode them, and components read the tokens, never raw steps.

  • Three-layer canvas, content at the extreme. The content panel is the window's lightest surface in light and its darkest in dark; the sidebar and title bar (chrome) sit one step toward the middle (about 2% ink in light, 4% white in dark); sheets and menus step from the panel (a step lighter in dark). The panel floats 8 pt inside the canvas with radius 12 and a lineSoft hairline.
  • One ink, many opacities. Lines and states are the ink (text) at a fixed opacity, so each reads alike on every surface: lineSoft 6% (7% dark) outlines what rests on the panel and divides rows; line 9% (11% dark) frames a field and marks a focused composer. Only surfaces and text levels are solid colors.
  • Containers by line, fills for state. A container on the panel (a tool card, a summary, a settings group) is a sheet (sheetStyle()): the sheet's fill and a lineSoft line, flat. A message is a lifted sheet (sheetStyle(corner, true)). card and cardRaised fill only small inline things: inline code, a track, a badge, a well. A sheet never sits inside another sheet; inside one, divide with a lineSoft rule.
  • States are layers. Hover, press and selection lay the ink over whatever the element rests on (stateLayer, or layered(fill, state) for an element with a fill): 4.2% for a sidebar row's hover, 6% hover, 7.5% selected, 9% pressed, a little stronger in dark. A selected row adds a 1 pt inset ring of ink (selectedRowStyle()). A hover raises a muted label one text level. Keyboard focus never changes a fill: it draws a 2 pt ring in the accent at 55% (focusRingColor()). Disabled is 50% opacity. No surface has a hover color of its own. All workbench, web, and plugin buttons route through Button / ActionButton in ui.tsx (and Button in ios-shell/app/ui/Button.tsx on iOS) so hover, press, focus, and disabled feedback are active by default and opt-out requires an explicit surface="bare" (or bare on iOS).
  • One elevation recipe. Whatever lifts is drawn alike: a 1 pt highlight along its top edge, a ring of ink where it has no border, and two shadows, a large soft one pulled in at its edges and a small contact one; dark shadows are several times stronger. Level 0 is flat (the panel, a card), level 1 lifts a message, the composer and a raised control (sheetElevation(), raisedControlStyle()), level 2 what floats (floatingElevation()), level 3 a modal dialog (dialogElevation()). A look's own shadow replaces the recipe.
  • The composer has two rings (composerTrayStyle, composerFieldStyle): a tray in the sidebar's fill ringed by lineSoft holds what docks above the field (conversation details, warnings) and frames the field 4 pt inside it with concentric corners. The field is a lifted sheet with its own lineSoft ring; focus darkens that ring to line instead of drawing the accent. A user message reuses the field's shape, so what was sent looks like where it was written.
  • Avoid decorative gradients, glowing borders, neon accents, glassmorphism, sparkles, or ornamental "thinking" animations. The one exception is the new-conversation mark (HeroMark), whose strokes fade to transparent toward the greeting below it: single-color, muted, never glowing.

Color

  • The default palette is monochrome-first: cool, nearly colorless neutrals carry the hierarchy, and color is spent only where it means something. The accent appears on focus rings, a current selection, links, a switch that is on and unread dots, and nowhere else.
  • Foreground hierarchy uses text, secondary, and muted, reinforced by size, weight, and spacing. muted and accentText stay at or above 4.5:1 on every surface step, raised included.
  • action (ink: text in each appearance) fills the one action a view leads with—Send, a dialog's or settings page's primary button, an update prompt—with onAction for its label and actionHover for hover and press. Keyboard focus never changes its fill: actionFocusStyle() draws a 2 pt accent ring 2 pt outside it, so focus reads apart from hover and the label keeps its contrast in every look. A view has at most one.
  • accent, derived from the logo's blue, marks focus, current selection, links, switches that are on and unread dots. It does not fill primary buttons.
  • brand is the logo's own blue (#47a3e2) for Maka's mark; looks use their accent.
  • Semantic status colors (warning, danger, success) appear only to communicate actual state. Charts draw categorical series from chartColors(), never from status colors, unless the series means a status.
  • Components read colors from C; literal color values belong only in theme definitions or data-driven content (avatar fills, ANSI output).
  • Display numbers pass number values to tr() (or use numberFormat.ts outside tr()) for locale grouping and decimals; pass identifiers, line numbers, exit codes, revisions, and pixel dimensions as string to keep them ungrouped.

Type

  • The interface uses the platform's system font (SF Pro, Segoe UI Variable, the desktop's sans on Linux) and its system monospace for code; Maka ships no font files.
  • Sizes come from fontSizes: micro 10 (badges, counters), caption 11, small 12 (metadata, menu details), secondary 13 (secondary rows, section headers), body 14 (reading text, inputs), subtitle 15 (third-level headings in replies), title 16 (pane, card and dialog titles), heading 20, display 24 (the one greeting a view may lead with). The interface is a dense 14-point world: rows are about 32 pt everywhere (sidebar, tool steps, menus), icons 16 pt in 24/28 pt targets, and figures that line up are tabular. Components never write a literal size.
  • Text is light by default. Weights come from fontWeights: regular for reading text and section headers, medium for emphasis (a selected row, a button's label, a chip), semibold only for dialog, page and pane titles.
  • Section headers above rows (Conversations, Pinned, Projects, settings groups) use sectionHeaderTextStyle(): small size, medium weight, muted: a label the rows under it outrank.
  • displayTextStyle (24/32, -0.6 tracking, regular) and titleTextStyle (16/24, -0.2 tracking, semibold) tighten tracking as size grows; body sizes keep the font's own spacing.

Icons

  • Desktop icons are Material Symbols Rounded at weight 300 (materialSymbols.ts, generated by products/maka/workbench/scripts/material-symbols.mjs): thin outlines drawn as filled shapes, 16 pt in rows and 18 pt in toolbars. Terminal mode keeps its glyphs.
  • Selected and open states switch an icon to its filled variant (<Icon filled>) rather than only recoloring it: a selected navigation row, a panel's toggle while the panel is open.
  • Provider marks (brandMarks.json) and file-type icons keep their own drawing; only their sizes follow the icon grid.

Motion

  • UI transitions take durations.fast (150 ms: press, hover, small reveals), durations.base (200 ms: something appearing or moving in place) or durations.slow (300 ms: something crossing the window), on the one easeOut curve (cubic-bezier(0.16, 1, 0.3, 1), ease-out-expo). Color changes fast; space changes slower: a color or opacity takes fast, what moves or resizes base or slow. Under Reduce Motion only opacity changes.
  • Ambient loops (shimmer, the thinking mark, room breathing) keep their own periods. Every motion honors Reduce Motion.

Geometry and alignment

  • Spacing scale: 2, 4, 8, 12, 16, 24, 32. Tighter spacing binds related parts: parts inside a control sit closer than sibling controls, and sibling controls closer than distinct groups.
  • Corner radii: anything pressed is a pill (PILL: buttons, chips, pickers, fields; controlStyle() is one); rows are 8; containers step 12 (the panel, menus, cards) → 16/20 (large cards, messages) → 24 (the composer's field, dialogs); 4 inline. Nested corners stay concentric (inner_radius = outer_radius - inset).
  • Control heights: 24, 28, or 32 (default 32). Containers own their padding; parents own the gap between children—never patch alignment drift with ad-hoc local margins.
  • Shared axes: Sibling elements snap to shared edges and centerlines; a 1 px misalignment between intended shared edges is a bug. In the composer (radius 24, inset 8, 32 pt round buttons), the + icon aligns with the first character of the input, the send button sits equidistant from the right and bottom edges, toolbar items share one centerline, and the composer's tray aligns flush with both edges of the reading column, its field 4 pt inside. Icon buttons and disclosure rows extend 8 pt outside the reading column so their glyphs land directly on the text edge.

Interactive states

  • Every interactive control implements hover, active/press, keyboard focus, disabled, and (where applicable) selected states via ui.tsx.
  • Hover-revealed actions must also appear on keyboard focus, reserve their layout slot while hidden, and remain reachable from the context menu.
  • Loading states match the exact bounding box of their ready state so transitions cause zero layout shift.

Window shell

The desktop shell forms an inverted L: the sidebar and top strip share the chrome base fill, framing a rounded panel (radius 12, inset 8 on top, right, and bottom) drawn with a 1 px lineSoft hairline; side-by-side split panes inside the panel separate with a 1 px line.

Window chrome occupies a single 32 pt top row: window controls and the sidebar toggle sit above the sidebar (moving into the panel header when the sidebar collapses), while each pane header aligns on the same vertical center—showing title, workspace badge, and a trailing segmented view switcher without repeating the title elsewhere.

Sidebar navigation keeps core actions (New conversation with squarePen, Search conversations) alongside user-pinned optional features (Maka Bot, Automations, Rooms) managed from a More features popover, and omits redundant filter entries such as Waiting for you. Navigation rows use secondary text and muted icons so conversation titles (text) stand out; hovered rows take the quiet layer and raise their label to text; selected rows use selectedRowStyle() and 500 weight. New conversation is a raised control (raisedControlStyle()): a step out of the sidebar. A Conversations section header pairs a compact two-option segmented control (Project | Time) to switch between project grouping (Projects with a trailing + add-project action) and chronological order (Recent), separated from the scrolling list by a full-width 1 px lineSoft hairline. Rail section headers (Conversations, Pinned, Projects, Recent) use sectionHeaderTextStyle() (12 pt, medium, muted), while 32 pt project rows use 14 pt 500 text with a leading folderOpen icon, trailing collapse chevron, and trailing squarePen new-conversation action; conversations under a project keep full-width hover/selected pills while insetting their titles by 32 pt to align with the project name. Full-width Show N more rows use the 13 pt caption scale, and a fixed trailing slot (inset 8 pt from the right edge, aligned with the 32 pt hover More button, with proportional trailing clearance on the title button) holds the active spinner, unread dot, compact relative timestamp, or hover More button so titles never shift horizontally.

Conversation stream

  • A new conversation leads with HeroMark (56 pt, 36 pt when compact) stacked above the greeting in displayTextStyle, centered over the composer. The composer's Send is a round action button.
  • Assistant prose renders directly on the reading column without avatars.
  • Inter-agent messages render inside tool activity rows rather than user speech bubbles, collapsed by default with expandable source links and payloads.
  • Each turn renders a single summary header from start to finish: Working for 22s while running, updating in place to Worked for 37s · 2 thoughts · 3 tools and auto-collapsing to the final answer on clean completion (unless the user manually toggled it). Turns that fail, stop, or pause for user input lead with their terminal status (Stopped after 12s) and stay expanded.
  • Consecutive internal steps between assistant messages fold into an activity group (Read files, ran commands). On desktop, turns use two unindented lanes: a 24 pt leading icon lane aligned with the reading column's left edge, and a content lane to its right. Expanded steps sit one lane inward behind a vertical guide line under the group icon.
  • Step status occupies a fixed trailing slot and surfaces only errors, rejections, stops, or active spinners. Shell tool cards show the working directory once, prefix commands with $, label output only for stderr, and display exit codes only when non-zero.
  • Loading older history keeps the reader's position; live output follows the end only while the reader is there.

Floating overlays

Menus, selects, context menus, popovers, and modal dialogs float: a lineSoft ring (radius 12; dialogs 24) with a level-2 or level-3 shadow (floatingStyle, menuRowStyle, ModalDialog.tsx).

  • Menus and popovers — floating surface with 4 pt inset and 32 pt concentric rows (radius 8, hover and keyboard focus the hover layer). Rows use three lanes: 16 pt icon at 12 pt, label at 36 pt, and trailing check/switch/shortcut/chevron. Every command in a menu uses a distinct icon; destructive actions sit last in danger; commands that open a prompt end with …. Active choices show an accent checkmark (never radio buttons). Press outside or Escape dismisses; menus carry neither title bars nor close buttons.
  • Dialogs — ModalDialog centers over a scrim on the floating fill (radius 24, inset 16). Titles state the concrete action and target (Delete “Roadmap”?, weight 600); body text adds only scope or consequence. Primary actions sit bottom-right (Cancel followed by a specific verb like Delete or Save—never generic OK/Confirm), with initial focus on Cancel for destructive prompts. Escape cancels; clicking the scrim dismisses lightweight launchers (command palette, search) but never discards form edits or active work.
  • Tooltips — tooltipStyle / richTooltipStyle in floating tokens without shadow or color inversion, the narrowest floating surface at 280 pt and four lines of text at most: a hint folds, and what a longer one cannot say belongs inline. A hovered image is the one preview that sets its own width, up to 480 pt. Menu rows never carry tooltips.

Settings pages

All settings screens compose primitives from SettingsPage.tsx without custom per-page layouts:

  • Settings occupies the window's inverted-L shell as a peer workspace surface alongside Conversations and Rooms (keeping them mounted so drafts and streaming turns survive). The left rail leads with Back to app followed by category destinations (folding above the panel on narrow viewports); the panel header shows the category title (with Back navigation when nested) and at most one primary page action, without a modal close button. Escape steps back through nested subpages and unsaved-draft prompts before returning to the app.
  • Grouped rows sit on a sheet over panel with aligned left text edges: label on the left, control on the right, and helper copy only when the label alone would be ambiguous.
  • Switches and discrete pickers apply immediately; text inputs (names, keys, URLs, prompts) and coupled multi-field forms (server/model/proxy configs) commit via a sticky footer Save bar that appears once dirty. Navigating away with unsaved edits prompts for confirmation.
  • Pages load on mount and window focus without manual Refresh buttons; failed loads surface an inline Retry action and error reason. Healthy rows stay quiet; actionable issues highlight in warning.

iOS

The iPhone app keeps the same hierarchy and restraint, translated to touch.

  • Native first — Navigation pushes, back gestures, menus, sheets, alerts, segmented controls, and keyboard transitions use system presentation and dismissal; never reimplement them. Custom motion offers a Reduce Motion equivalent: continuous marks and shimmers turn static, transitions become immediate.
  • Touch — Every target is at least 44 pt, even when the visible control is smaller, and nothing depends on hover. Primary actions (send, approve, submit) stay in thumb reach above the keyboard; a held press never changes its command.
  • Glass and legibility — Liquid Glass is the one exception to the no-glassmorphism rule, and only for system chrome: bars, the composer field, toolbars. Cards and actions over transcript media stay opaque so contrast never depends on what scrolls beneath. Pressing changes a control's fill without dimming its label; status over glass animates the text, not the surface.
  • State in place — Streamed status, counts, meters, and upload progress update in place without movement; no spinner or progress bar guesses at completion. Loading, error, and content share one frame. Placeholders wait 150 ms before appearing, give way the moment content is ready, and never cover cached content. A failed change restores the last confirmed value.
  • Focus and reach — The composer reflows with its content and follows the keyboard, carrying the transcript only when pinned to the end. Revealing content never moves focus. On short viewports, secondary chrome folds into a menu or sheet so everything stays reachable without crowding the screen.

Visual verification

Inspect UI changes in the native desktop renderer across both light and dark themes at narrow and wide viewport widths. Shared-edge invariants belong in automated layout-bound assertions (such as shell_shares_its_lines in the desktop integration suite) rather than eyeball checks alone. On macOS, the offscreen test backend rasterizes Helvetica rather than SF Pro, so check optical text-to-icon centering in a real desktop window. Check iOS changes on a device or simulator with Reduce Motion both off and on.