5.3 Editor design system
Editor screens use shared tokens and components. The colours, themes and
full component catalogue are in the GUI design guide.
Paths below are relative to gui/web/src/.
Tokens
styles/tokens.css is the only place a raw value appears. A stylesheet
that needs a colour, size, radius or font reads a token.
- Surfaces:
--surface-appbehind everything,--surface-chromefor headers, sidebars and panels,--surface-controlfor inputs and buttons at rest,--surface-hoverunder the pointer. Borders are--border-hair(--border-subtle), and--border-strongon hover. - Ink:
--text-headingfor names and titles,--text-bodyfor values and controls,--text-mutedfor labels, help and counts,--tempo-faintfor disabled or empty values.--state-dangermarks a problem. - Accent: gold marks the selection, the screen’s primary action and keyboard
focus. A pressed view toggle uses the neutral
--toggle-on-*tokens. - Type: a rule sets
fontfrom one of these roles.
| Role | Token | Use |
|---|---|---|
| Title | --text-title-font | the page title in the header bar |
| Heading | --text-heading-font | a section or group heading |
| Label | --text-label-font | a compact heading in a panel, a row’s name |
| Small | --text-small-font | row labels, control text, list cells |
| Meta | --text-meta-font | help lines, counts, units |
| Caps | --text-caps-font | uppercase list-group labels, with --ls-caps |
| Code | --text-code-font | code snippets |
- Space: the
--space-*steps. Panels pad 12 to 16 px, rows 2 to 10 px. - Radii:
--radius-xsfor tags and dots,--radius-smfor inputs,--radius-mdfor buttons and selects,--radius-lgfor groups, cards and panels,--radius-xlfor dialogs. - Heights:
--header-h(56 px) for the top bar,--control-hfor a control,--control-h-compactfor a control in an inspector,--row-hfor a list row,--setting-row-hfor a row of a settings group.
Page shapes
styles/primitives.css holds the shapes screens share. A screen applies the
class and adds only what differs.
The global base in tokens.css and every rule in primitives.css sit in the
tempo-base and tempo-primitives cascade layers, declared in that order at
the top of tokens.css. Screen stylesheets stay unlayered, so a screen’s
override of a primitive wins whatever order the bundle puts the files in.
Write new shared rules inside the layer and screen rules outside it.
npm run build ends with scripts/check-css-layers.mjs, which fails when a
primitive rule escapes its layer, a screen rule enters one, the layer order
is missing, or App Settings’ narrow-dialog row override is not unlayered.
styles/cssLayers.test.ts runs the same check on the source files.
.tempo-page-header: the bar across the top of every screen. PutEditorHeaderinside it, with back, title, then the screen’s actions at the right and the primary action last..tempo-group: an outlined group of rows split by hairlines. App Settings builds every section this way throughSettingsSectionandSettingsRow. A list of links, such as where a command is used, takes the same outline..tempo-empty__title: the title of what a screen shows with nothing in it..tempo-section-label: the uppercase caps label over a group of fields.
Components
Use the shared component before writing a new control.
Check that numbers shown to users are short and round. The units module sets display precision: inches, speeds, accelerations and masses use at most two decimal places, meters and radians three, degrees one, and MOI three. Trim trailing zeros and limit readouts to six significant digits. Fields keep the full canonical value until a different value is entered. Retyping the displayed number must preserve storage. Changed values, including explicit unit suffixes, use five decimal places in canonical storage. If that changes the selected unit’s display, use the fewest additional decimal places that preserve it. Code, exports, sync payloads and copied snippets emit the stored value without further rounding. Planner outputs retain their computed precision. Store each quantity once in its canonical unit. Rotation targets, turn rates and arrival tolerances store radians. Legacy degree fields are consumed during document migration. Every writer and consumer, including canvas drags, history, code and planning, uses that value.
Tutorial targets use clean steps in the selected units. A goal accepts only an entry that displays as the instructed number at the field’s display precision. Both half-step boundaries are excluded, independent of trimmed zeros in the instruction. A visibly different entry must fail.
| Need | Use |
|---|---|
| An action | Button: primary for the screen’s main action, ghost for quiet ones, danger to confirm a delete |
| An icon action | IconButton |
| Text or a number | Field, NumberField, UnitLengthField |
| One of a few choices | SegmentedControl; ChoiceCards when each choice needs a sentence |
| One of many choices | Select |
| A form checkbox | Toggle |
| A setting that applies at once | Switch in a settings row |
| An explanation | InfoHint beside the label it explains |
| Optional depth | Disclosure; pass right to summarise what it holds while closed |
| A list | OutlineRow rows in a listbox, AddButton to add |
| A side panel of settings | InspectorSection and InspectorRow |
| A dialog | Modal, with Tabs in its toolbar for several pages |
Screen layout
Authoring screens put the list on the left, the work in the middle and the selected item’s settings in a resizable panel on the right at the inspector’s density (Paths, Autos, Poses). Library screens with no field, such as Commands & Sensors, give the middle to an overview list, one row per entry with the columns a reader needs to tell entries apart, and keep the same right-hand details panel. Settings use outlined groups. A screen states what its kind of item is in one line under the group heading, so a first-time user can read the screen without opening help.