Design System & Accessibility
The visual language of the Astronaut Health Intelligence Platform (AHI) is a dark "mission control" look: deep navy space backgrounds, glass panels, a teal accent and five status colors that always come with words and an icon. This page documents what is in the code (src/index.css, src/lib/status.ts, src/components/), not a wish list.
Status language
Defined once in src/lib/status.ts and used by the UI and the 3D viewer. Plain words first, technical label second.
| Status | Crew wording | Technical label | Color | Icon (lucide) | Dot |
|---|---|---|---|---|---|
LOW | All good | Nominal | #34d399 green | CircleCheck | filled |
MODERATE | Keep an eye | Watch | #fbbf24 amber | Eye | filled |
HIGH | Act soon | Warning | #fb923c orange | TriangleAlert | filled, slow pulse |
CRITICAL | Act now | Critical | #f43f5e red | OctagonAlert | filled, fast pulse |
NO_DATA | Signal lost | No data | #94a3b8 slate | WifiOff | hollow and dashed, never filled |
NO_DATA deliberately looks different from LOW (hollow dashed dot, grey, no animation in 3D) so missing data never reads as normal.
3D body
The body is a realistic anatomical atlas, so color has two separate jobs. Tissue colors (bone, muscle, vessels, organs) are reference anatomy and carry no meaning about health. Status colors are the same five STATUS_META colors as everywhere else and appear only as highlights on top of the anatomy.
| State of a structure | Visual | Meaning |
|---|---|---|
| Normal | Natural tissue color | Nominal, or context only |
| Hovered | Cyan tint and tooltip | Under the pointer |
| Selected | Cyan rim; everything else becomes a faint see-through ghost | Focus. Ghosting is a viewing aid, not a status |
| Related to alert | Pulsing rim in the status color (amber, orange, red), with a floating label | Its body system is not nominal |
| Data unavailable | Grey, desaturated, no motion | NO_DATA |
- A nominal body shows no status color at all, so any amber, orange or red reads as attention.
- Cyan is selection, never status. It is the viewer accent (
#5ee7f5), close to the app accent. - Monitored vs context only. A structure that no device or metric relates to never gets a status color or a status word. Its panel shows a neutral "Context only" badge and says that no status is shown because nothing is measured.
- Related indicators. The structure panel always says that the numbers describe the body system as a whole, not the selected structure.
- Reference anatomy caption. "Reference anatomy: Z-Anatomy atlas (CC BY-SA 4.0)" stays visible under the body, with an info button for the credits and the "one reference model for every crew member" statement.
- Controls follow the same glass style: Layers (one switch per anatomical system with a tissue colored swatch), a skin opacity slider, layer presets, the preset views Front, Back, Left and Right, and reset.
Full list of states and how they are drawn: 3D anatomy. How users meet them: Product tour.
Color tokens
| Token | Value | Use |
|---|---|---|
space-950 to space-600 | #04070d to #22324f | Backgrounds and surfaces (darkest to lightest) |
ink-100, ink-300, ink-500 | #e8eefc, #a9b6cf, #7d8ba6 | Primary, secondary and muted text |
accent, accent-strong | #5eead4, #2dd4bf | Focus rings, links, guided tour spotlight |
| Status colors | see above | Status only, never decoration |
Data origin badges reuse a consistent scheme (for example a violet SIMULATED chip in the top bar). This documentation portal uses the same accent (#5eead4 in dark mode, a deeper cyan in light mode for contrast).
Typography
| Role | Font |
|---|---|
| Interface | Inter (400 to 700), with cv11 and ss01 features |
| Numbers and codes | JetBrains Mono; tabular figures (.tabular) so live values do not jitter |
| Minimum size in presentation mode | 13 px for every text style, including chart ticks |
Surfaces and layout
- Glass panels (
glass,glass-strongutilities): translucent gradients with a blur and a soft shadow, over a radial "space" background. - One spacing scale: 12 px between panels, 16 px inside panels.
- Reading order of the Ground view: crew (who), body and headline (what), attention panel (why and what to do), timeline (when), vitals (live values).
- Screen modes in pure CSS: short (viewport height up to 820 px), default, roomy (1680x1000 and up), presentation (Frontend and state).
Components
| Component | Where | Notes |
|---|---|---|
| Status pill, icon and dot | components/Status.tsx | Icon plus words plus color |
| Metric value | components/MetricValue.tsx | Tweened numbers, snapped when reduced motion is on or the page is hidden |
| Trend chart | components/TrendChart.tsx | Personal band ("Your normal"), gaps for missing data, forecast cone, event markers |
| Sparkline | components/Sparkline.tsx | 6 h history in crew cards and vitals |
| Risk gauge | components/RiskGauge.tsx | 0 to 100 score with level |
| Baseline info | components/BaselineInfo.tsx | "Why is this my normal?" |
| Autonomy badge | features/attention/AutonomyBadge.tsx | "Can act on board now", "Needs flight surgeon", "Earth reply in N min+" |
| Origin badge | features/datasources/shared.tsx | REAL_PUBLIC, DERIVED, SIMULATED, MANUAL |
| Structure detail | features/attention/StructureDetail.tsx | Selected structure card, "Reference anatomy" badge, "Monitored with" block or "Context only" card |
| Alerts and flags | features/attention/RegionEvents.tsx | Open alerts with the triggering metric, observed value against the personal normal, origin badge and rule id |
| Anatomy controls and caption | features/anatomy/viewer/SystemControls.tsx, Attribution.tsx | Layers, skin opacity, presets, views, reset; source caption |
| Feed label | features/attention/FeedStatus.tsx | "Paused by operator", "Waiting for data" or "Signal lost" with its icon, in a neutral color; inline Resume for a paused device |
Visual first panels
The attention panel, the body system and structure details, the exam history and the mission context show a picture first and keep the full sentence behind a Details toggle. The visuals live in components/viz/; their scaling is pure and unit tested (scale.test.ts).
| Visual | Component | What it draws |
|---|---|---|
| Band gauge | BandGauge.tsx | The personal normal band as a soft stripe and the current value as a marker in the status color. The band sits in the middle of the track; a value far outside widens the track so the marker stays on it. No value: the band only, never a marker |
| Change bar | ChangeBar.tsx | A change from baseline as a bar that grows right (higher) or left (lower) from a center tick, used in the exam history |
| Delay clock | DelayClock.tsx | A one way message delay as an arc that fills the dial over one hour: a light second is a sliver, Mars most of the dial |
| Details | Details.tsx | A disclosure for the sentence. Closed, the text is only visually hidden (sr-only), so screen readers and audio description still read it |
| Icons and time hints | features/attention/visual.ts | One icon per signal (its body system) and per action kind; action time hint Now, Within 1 h or Today from the priority (a UI convention of the demo, not a clinical rule) |
Decorative visuals are aria-hidden and the words stay next to them; a gauge with meaning carries an accessible label with the value, the band and the status in words.
Feed states (features/attention/feedState.ts): a metric is LIVE (a current reading), PAUSED (an operator paused the device that feeds it), WAITING (the device is online, for example just resumed, but no reading arrived yet) or LOST (no reading and no healthy device). Only LIVE carries a value. A body system is PAUSED or WAITING only when every metric without data is in that state.
Layers (z-index scale)
Every fixed or portaled layer uses one scale, defined as CSS variables in src/index.css and used through Tailwind as z-(--z-dialog). A raw z-[NN] is not allowed for an overlay.
| Token | Value | Used by |
|---|---|---|
--z-page | 0 | Normal content |
--z-sticky | 40 | Top bar and the expanded timeline ribbon |
--z-tooltip, --z-popover | 50 | Hover tooltips and page popovers, always below an open drawer or dialog |
--z-drawer | 60 | Side drawers (alerts, comms, assistant) |
--z-dialog | 70 | Centered modal dialogs (Data and model, report, settings) |
--z-raised | 75 | A popover opened from inside a drawer or dialog |
--z-toast | 80 | Small notices that must stay visible (sound blocked, screen description) |
--z-tour | 90 | Guided demo overlay |
--z-command | 95 | Keyboard shortcuts sheet |
--z-skip | 100 | Skip links, when focused |
UX decisions
| Decision | Reason |
|---|---|
| Plain language first ("Act soon"), technical term second ("Warning") | Crew readability under stress; international judging |
| Two views over the same state (Ground and Crew) | Different needs, one source of truth |
| At most two actions in the Crew view | Reduce load; the rest is in the Ground view |
| Every recommendation says who can act | Communication delay makes autonomy part of the answer |
| Always visible SIMULATED badge | Honesty about data origin |
| Gaps in charts stay gaps | Missing data is never filled or smoothed over |
| Critical banner floats over the stage header | The 3D body keeps its size during alerts (247 to 359 px tall at 1280x720, measured with the earlier procedural body) |
| Realistic anatomy with status as a highlight | Tissue color shows what a structure is; status color shows only what needs attention |
| Context only structures show no status | "Nothing is measured" must never look like "normal" |
| Top bar priority collapse | Labels go first on narrow widths; Start demo and the alerts bell are never clipped |
| Alert sound on by default for critical alerts | A health monitor must be heard; one sound at a time, repeat until acknowledged, escalate after 2 min, warnings opt in (Accessibility) |
| Monitor mode by default in the 3D viewer | What is measured reacts; context only anatomy steps back. Explore mode is one click away |
| Picture first, sentence behind Details | A glance must be enough; the sentence stays one click away and is always read by assistive technology |
| A paused device is not a lost signal | An operator decision gets its own neutral words and a Resume button; neither state is ever shown as normal |
| Red dot on the browser tab for an open critical alert | A hidden tab still shows that someone must look |
Accessibility measures in the code
| Measure | Implementation |
|---|---|
| Color is never the only cue | Status always pairs color with an icon and words; NO_DATA also changes shape (hollow, dashed) |
| Keyboard operation | Global shortcuts (1 to 4, V, P, A, Space, Esc, ?, arrows in the tour); timeline markers navigable with arrow keys and Enter; shortcuts ignored while typing |
| Visible focus | focus-ring utility (2 px accent outline) on interactive elements |
| Skip links | "Skip to main content" and "Skip to what needs attention" as the first focusable elements |
| 3D body by keyboard | The body navigator: arrow keys over regions and structures, Enter, Esc, with spoken announcements (3D anatomy) |
| Sound and speech | Alert earcons with escalation; audio description with D and Shift + D (Accessibility) |
| Accessible names | About 90 aria-label attributes; short vital labels keep the full name in the title and accessible name |
| Live regions | aria-live in alerts, 3D labels, Crew view, center stage, data dialog and guided tour |
| ARIA roles | Dialogs, menus (menuitem, menuitemradio, menuitemcheckbox), tabs, radio groups, switch, progress bar, status and alert roles |
| Screen reader only text | sr-only text where icons stand alone |
| Reduced motion | prefers-reduced-motion: reduce disables animations and transitions globally and snaps tweened numbers |
| Readable sizes | Presentation mode enforces a 13 px floor and scales 3D labels by 1.3 |
Not audited
These measures exist in the code, but no formal WCAG audit or screen reader test has been done. The 3D body is reachable by keyboard through the body navigator and announced through live regions, but the picture itself is not described beyond its labels and the equivalent text panels. This is listed in Limitations and known issues.