Skip to content
oxidaseSign in

Instruments

Where a protocol runs: styling never changes what a trial measures.

The task area

The stimulus is measured, so a style change never reaches it silently. Every task area renders in the design system, and its presentation belongs to the exercise's recorded interface version.

A change to a task area is a measurement change

Restyling a task area, moving its geometry, or adding marks, texture or motion near a stimulus changes what a trial measures. It ships only as a new interface version of its exercise, recorded on every new trial, not as a design pass.

Chrome around a task area

  • The bench bar, controls and completion around an instrument follow the system: ink actions, tonal secondaries, Mona Sans.
  • Chrome stays quiet at the edges: the protocol name, the trial count and one instruction at a time, in the member's terms.
  • Page transitions do not apply to the Spatial hold route, and nothing animates during a trial unless the protocol defines it.

Measurement owns timing and geometry

Study, hold and response windows, grid sizes and stimulus presentation are owned by the measurement code, and Spatial hold records its presentation details with each trial. The design system styles around them and never inside them.

  • Shared tokens never time a trial; durations live in the measurement code.
  • Reduced motion changes chrome, not stimulus timing.
  • The frozen tokens, such as the old radius keys, keep the values the instruments were measured with and are marked deprecated for everything else.

Recording the ground

A trial records where its stimulus was actually shown. The page preference is not enough: a region can be pinned to another ground, and System follows the device. resolveSurfaceContext(element) reads the stored preference, the scheme that renders at that element, its nearest Ground and the motion setting. useSurfaceContext(ref) keeps that current in a client component, including when an enclosing ground changes tone.

"use client";

import { useRef } from "react";
import { useSurfaceContext } from "@oxidase/ui/use-surface-context";

export function StimulusFrame({ children }: { children: React.ReactNode }) {
  const ref = useRef<HTMLDivElement>(null);
  // { preference, scheme, ground, motion } where the stimulus actually renders
  const surface = useSurfaceContext(ref);
  // ...store `surface` with the trial, beside its own geometry and timing
  return <div ref={ref}>{children}</div>;
}
  • Both live in StyleX-free subpaths, @oxidase/ui/surface-context and @oxidase/ui/use-surface-context, so measurement code can import them without the style compiler.
  • The context is plain data: strings for preference, scheme, ground and motion. Geometry and timing stay in the measurement record.