Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Shared fixture library

Linear: AUT-142

Every storybook component reads its sample data from one of the per-surface fixture modules under crates/ui-storybook/src/fixtures/. This page is the index of what each fixture provides and why stable, deterministic fixture data matters.

Why fixtures matter

The component stories double as our SSR snapshot suite. If a story were to invent its own mock data inline, each story would drift into its own dialect of "what a recording looks like" and the snapshot diff between PRs would become noise — every component change would touch every story body.

Centralizing the canonical samples per surface means:

  • Fixtures never use randomness, Instant::now, the local filesystem, or any OS state.
  • Stable IDs (rec-01, ws-northwind, space-team) so snapshot diffs are reviewable.
  • Fixtures map 1:1 to real DTOs — when the runtime crate lands a real Recording struct, the fixtures can be replaced (not rewritten) by mappers.

Module index

ModuleProvides
fixtures::workspacesWorkspaceView rows + selected-id helpers
fixtures::devicesCapture sources, displays, device pickers
fixtures::audio_appsSystem-audio app rows
fixtures::recorderTray-popover composition + on-screen options
fixtures::libraryRecording cards + grid + sidebar
fixtures::editorDope-sheet + editor-shell + drop-zone + inspector + timeline
fixtures::cursorCursor styles + appearance presets

Contact sheet

The fixture-gallery story renders one tile per surface so designers can review the canonical data shape at a glance:

Fixtures must be deterministic

Builders cannot use randomness, the current time, or local-machine state. If a fixture pulls in non-determinism the snapshot test flakes on different machines (and just snapshots-check cannot catch byte differences across machines — only missing files).

Adding a new fixture

  1. Decide which per-surface module owns it (or create one).
  2. Add the builder as pub fn sample_<thing>() -> Vec<...>.
  3. If the new fixture should appear on the contact sheet, extend contact_sheet::default_ui_fixtures() and the fixtures-contact-sheet story.
  4. Add a test asserting non-empty + stable IDs.