Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
511cdc4
feat(TL-P01): add real-player design review fixture surface
christophersesugh Nov 16, 2026
86b44f1
feat(TL-P01): style responsive player review and compact anatomy prop…
christophersesugh Nov 16, 2026
d018dfb
feat(TL-P01): expose player design review from public playground
christophersesugh Nov 16, 2026
130712c
build(TL-P01): typecheck player design fixtures alongside playground
christophersesugh Nov 16, 2026
83f448d
docs(TL-P01): explain design lab review workflow
christophersesugh Nov 16, 2026
616d77d
docs(TL-P01): specify compact player anatomy, tokens and visual revie…
christophersesugh Nov 16, 2026
3d8ba38
test(TL-P01): capture real browser player design fixtures and manifest
christophersesugh Nov 16, 2026
54bba11
build(TL-P01): register real-browser player design audit
christophersesugh Nov 16, 2026
dc72b20
ci(TL-P01): attach exact-source player visual fixture screenshots
christophersesugh Nov 16, 2026
fbe9808
test(TL-P01): verify review fixture semantics and state immutability
christophersesugh Nov 16, 2026
a125c26
build(TL-P01): include design fixture unit tests in preview typecheck
christophersesugh Nov 16, 2026
55ddf37
docs(TL-P01): point to live player design review
christophersesugh Nov 16, 2026
2f1e3aa
docs(TL-P01): record source-only player design review fixtures
christophersesugh Nov 16, 2026
72f238f
fix(TL-P01): exercise real schema validator for intentionally invalid…
christophersesugh Nov 16, 2026
ae7b306
fix(TL-P01): compare canonical artifact identity instead of catalog key
christophersesugh Nov 16, 2026
d49eca7
fix(TL-P01): honor standalone package publication boundary in design …
christophersesugh Nov 16, 2026
d71268c
fix(TL-P01): link design guidance in package repository
christophersesugh Nov 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ jobs:
run: pnpm exec playwright install --with-deps chromium
- name: Audit built public authoring playground
run: pnpm audit:playground
- name: Capture proposed TL-P01 real-browser review baseline
env:
THL_SOURCE_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
run: pnpm audit:player-design
- name: Upload TL-P01 unapproved player visual review images
uses: actions/upload-artifact@v7
with:
name: throughline-player-design-${{ github.run_id }}
path: .release-evidence/player-design/
if-no-files-found: error
retention-days: 30
- name: Browser tests
run: pnpm test:browser:run
- name: Record verified Chromium browser evidence
Expand Down Expand Up @@ -138,6 +149,7 @@ jobs:
pnpm test:run
node scripts/verify-release-evidence.mjs
pnpm audit:playground
pnpm audit:player-design
pnpm test:browser:run
pnpm build
pnpm audit:licenses
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ All notable changes to Throughline are recorded here. Package versions follow

### Added

- TL-P01 adds a source-only, browser-rendered player design review lab inside the authoring Playground, with four validated references, five host widths, light/dark modes, no-title and long-label fixtures, a static compact-anatomy proposal and automated screenshot/manifest collection. This is a design foundation **not** the released player redesign or evidence of human accessibility acceptance.

- Replaced the fixed-reference Vite development preview with a public-facing,
static schema-2 authoring playground. It now supports editable JSON with
syntax highlighting, exact semantic/compiler diagnostics, debounced native
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ The Graph and Sequence views only render declared facts.
A sequence request without message events falls back to a state table
instead of inventing messages.

## Compact player design review (TL-P01)

The source Playground now includes a [Player design review](playground/README.md#player-design-review-tl-p01) at `/?player-lab=1`. It compares the **existing real schema-2 player** at five fixed embed widths and light/dark themes with a **separately labeled static proposed layout**. The source [player design system](docs/player-design-system.md) documents the component boundaries, token inventory, four-reference fixture matrix, real-browser screenshot capture and review checklist. This work does **not** claim that the production shell or graph renderer is redesigned: those changes belong to TL-P02–TL-P04; TL-P05 owns final quality verification.

## Interactive authoring playground

[The Throughline Playground](playground) is a public-facing, static authoring
Expand Down
118 changes: 118 additions & 0 deletions docs/player-design-system.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Throughline player design system — TL-P01

**Status:** Proposed source design and browser-review fixtures; implementation of the new player shell is TL-P02, graph TL-P03, and sequence/Inspect TL-P04. A reviewed design is not evidence that the code or release is finished.

**Authority:** Throughline ADR-0010 and Throughline Specification 0008 (requirements PLR-001–PLR-015). The schema-2 model and query projections remain owned by Throughline Specification 0004.

## Design objective

The player explains one **modeled transition** at a time. A reader should see the actual system visualization, understand the current step, move backward or forward and inspect what is known without studying the authored JSON or opening multiple settings panels.

The player belongs to arbitrary host applications: no required logo, brand color, remote font, animation, network call, or host-level CSS reset. The Playground may have its own branding around it, but that branding is not part of the package.

The first release is **not** a general-purpose matrix/stack/canvas visualizer. The accepted schema-2 foundation supports graph, sequence and state-table projections; specialized visual grammar remains TL-U21–TL-U24. An unavailable view uses an honest state/table fallback.

## The five composition regions

| Region | Default content | Interaction and owner | Why |
| --- | --- | --- | --- |
| 01 Orientation | Optional meaningful title, compatible view, visible Inspect action | Host title + presentation selection | Establish context without taking over the scene |
| 02 Scene | Largest available area, source-linked graph/sequence/state | Pure projection/geometry + reader camera, grouping, entity selection | Explain the modeled state and evidence visually |
| 03 Explanation | Current step title, concise note, **one** step counter | Compiler-owned frame + authored text | Answer “what happened?” without menu navigation |
| 04 Transport | Previous, play/pause, next, discrete seek | Timeline state only | Predictable media-like interaction |
| 05 Evidence | Contextual Inspect with exact values, source events and epistemic limits | Read-only query, presentation focus | Answer “what do we know?” without abandoning scene |

At 260–375 CSS px, transport may use two lines but the essential actions remain visible. Inspect is a stacked region or controlled overlay with a dismiss/focus-return mechanism. At 768–1280px, Inspect may sit beside the graph, but must never mutate or replace the canonical frame.

### Information priority

**Always visible:** modeled scene, step title and count, previous/play-pause/next, timeline, view identification, and Inspect entry. **Discoverable secondary controls:** speed, jump-to-step, fullscreen, camera fit/zoom, group selection and optional narration. **Only when relevant:** exact JSON, source-event references, claim provenance, advanced history and selected-entity details.

The design avoids duplicated step counts, a compulsory branded banner, a permanent settings sidebar and decorative algorithm panels. It explicitly avoids tiny controls at narrow widths: the recommended primary touch target is at least 40×40 CSS px (WCAG 2.2 AA target-size minimum is different; see the specification).

## Player-scoped token proposal

The current `src/styles/throughline.css` declares local `--thl-bg`, `--thl-panel`, `--thl-surface`, `--thl-text`, `--thl-muted`, `--thl-line`, `--thl-focus`, `--thl-focus-bg`, `--thl-change`, `--thl-change-bg`, `--thl-control-bg`, `--thl-control-hover`, `--thl-radius`, `--thl-active`, `--thl-trail`, `--thl-trail-bg` and motion durations. Several v2 selectors append directly to the earlier player stylesheet. **TL-P01 does not replace these runtime tokens:** TL-P02 must consolidate them while preserving documented host overrides.

The following are design candidates, not implemented package variables:

| Intent | Light default candidate | Dark default candidate | Semantics |
| --- | --- | --- | --- |
| Canvas `--thl-bg` | `#fafafa` | `#121821` | Subdued scene workspace |
| Surface `--thl-surface` | `#ffffff` | `#1b212c` | Legible frame or contextual panel |
| Main text `--thl-text` | `#171717` | `#f4f5f6` | Control, step and value text |
| Secondary text `--thl-muted` | `#626b78` | `#aeb7c7` | Descriptive text; contrast must be measured |
| Line `--thl-line` | `#e4e7eb` | `#394557` | Light separations, never sole status cue |
| Focus `--thl-focus` | `#2563eb` | `#a6c5ff` | Keyboard and selection focus, non-color ring |
| Active evidence `--thl-active` | `#0f766e` | `#77d0be` | Explicit modeled *current* fact only |
| Changed state `--thl-change` | `#b45309` | `#f7bb73` | Actual explicit write, not inferred persistence |

Rounded panels around 8–12px are suitable for surfaces; graph nodes should use consistent but restrained shapes. A 4px-based spacing scale (`4/8/12/16/24px`) is the default. Proposed text scale: main controls/caption 14–16px, supporting text 12–14px, with text zoom preserving access; code-like values use system monospace. The player must **not** load fonts remotely.

Semantic coloring **never** substitutes for text or structure. `Unknown`, `Absent`, `Known: null`, `Not modeled`, and actual event types must be readable as text. Selection and focus need independent rings/borders; changed facts can use a label/badge and explicit evidence links. These token values are a starting point for measured contrast review, not self-certified WCAG compliance.

### Component boundary for TL-P02

```text
ThroughlinePlayer (React shell; presentation state only)
├─ Header: meaningful title? + view + Inspect entry
├─ SceneViewport: compatible pure ViewDescriptor, camera and selection
│ ├─ GraphRenderer (TL-P03)
│ ├─ SequenceRenderer / StateTableRenderer (TL-P04)
│ └─ ContextualInspector (TL-P04)
├─ StepExplanation: label + note + source-backed count
└─ TimelineControls: previous + play/pause + next + discrete seek
└─ SecondaryOptions: speed, zoom/fit, fullscreen, optional speech
```

**Source of truth:** `VisualArtifact` → `compileArtifact` → immutable `CompiledTrace` → `inspectTrace` / `projectView` → presentation. Only the source-backed projection determines the meaning of nodes, edges, message phases and values. The shell may select, seek or focus; it may not produce additional semantic events.

## Review fixture matrix

The [Playground player design lab](../playground/README.md#player-design-review-tl-p01) runs the **real current** player using the four checked reference artifacts, at reproducible host widths and themes. The static anatomy study is visibly labeled as proposed and **must never be counted as a source player screenshot**.

| Dimension | Coverage |
| --- | --- |
| Reference | Factorial, matrix, binary, hypothetical distributed checkout |
| Container width | 260, 320, 375, 768, 1280 CSS px |
| Theme | Light, dark; manually inspect system/host conflicts |
| View | Graph, sequence, state table where compatible; incompatible selection must not invent facts |
| Frame | Initial, middle, last (using real native transport/keyboard) |
| Detailed state | Graph entity selected, Inspect open, long entity/step labels, no explicit title, invalid input refused |
| Other manual conditions | 200% text, browser zoom up to 400%, reduced motion, keyboard-only, host style conflicts, forced colors, unsupported fullscreen/narration |

The fixture variants are constructed from each validated reference by adding **presentation labels only**, or deliberately avoiding compilation for an invalid case. They do not add synthetic state transitions, acknowledgements, causal links or derived arithmetic. Each source is compiled with the same `compileArtifact` function used by production consumers. The design lab allows actual selection/step navigation through the native player.

## Visual review and reproducible fixtures

1. Check out the dedicated TL-P01 source branch **after** the foundational Playground branch. Install with `pnpm install --frozen-lockfile`.
2. Run `pnpm preview:typecheck`, `pnpm test:run` and `pnpm preview:build`. Open `http://localhost:5173/?player-lab=1` after `pnpm dev`.
3. Run `pnpm audit:player-design` after the build. It launches a real Chromium browser against the built Vite host and writes exact fixture PNGs and a JSON manifest to `.release-evidence/player-design/`. These are not fake images, normalized SVG files or guessed layouts.
4. Review both the **Live player** and clearly labeled **Layout study** at each target width. An image from the Layout study is design evidence only. Check controls, step counts, long labels, scene legibility, evidence status, view switching, focus and horizontal overflow.
5. Manually exercise the current player, including graph selection, middle/final seek, Inspect and keyboard focus; record shortcomings as TL-P02–TL-P04 issues. Run the narrow embed with browser text zoom and screen readers separately. A green automated run does not establish manual accessibility.
6. Review the real screenshots attached as CI artifacts. Record accepted baseline hash, any rejected states and visual approval in the P01 source PR. Do not silently bless new image differences. This ticket only establishes the baseline; production visual regression enforcement belongs to TL-P05.

### Review questions

- Can an unfamiliar learner locate the modeled change without scrolling through developer settings?
- At 260px, are the minimum controls and explanation genuinely visible? Is horizontal scrolling confined to a diagram, not the whole player?
- Is there exactly one authoritative counter and a predictable place for the current explanation?
- Can a reader open Inspect while retaining frame, entity and visual context?
- Can every arrow or highlighted state be traced back to a declared source event rather than an inferred message?
- Does the player remain neutral and legible in hosts with a different light/dark palette?
- Which layout or interaction problems are confirmed by **real screenshots**, and which remain untested?

## Design research and accepted constraints

- [Nielsen Norman Group, Progressive Disclosure](https://www.nngroup.com/articles/progressive-disclosure/) and [10 usability heuristics](https://www.nngroup.com/articles/ten-usability-heuristics/): visible system status, reader control, consistent navigation and minimal primary chrome.
- [W3C WCAG 2.2](https://www.w3.org/TR/WCAG22/): keyboard access, reflow, text resize, status, non-text contrast and target-size minimum with exceptions.
- [WAI-ARIA slider pattern](https://www.w3.org/WAI/ARIA/apg/patterns/slider/): discrete seek, Home/End and meaningful value text.
- Accepted Throughline ADR-0006 and Specification 0004: model, timeline and presentation remain separate; the state table is the truthful fallback.

## Implementation and release boundaries

TL-P01 contains **design decisions, a token study, a real-source review surface and screenshot capture machinery**. It is deliberately not a new player, not the public `ThroughlinePlayer` component, not a new graph renderer, and not an npm release.

TL-P02 reworks the shell and transport and adopts the reviewed tokens. TL-P03 changes the graph scene; TL-P04 changes sequence/state/Inspect; TL-P05 adds approved visual regression and final packaged-player QA. After these merge, the final candidate requires a fresh TL-U18 actual screen-reader check before the held TL-U19 publication PR can be merged and any signed release/publishing action authorized.

This work depends on the new public authoring Playground PR. The TL-P01 implementation PR is stacked on that branch to avoid independently duplicating its changes; merge the Playground parent first and retarget/rebase this PR before inclusion in main.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"dev": "vite --config playground/vite.config.ts",
"preview:build": "vite build --config playground/vite.config.ts",
"audit:playground": "node scripts/audit-playground.mjs",
"audit:player-design": "node scripts/capture-player-design.mjs",
"preview:typecheck": "tsc -p tsconfig.preview.json",
"build": "tsdown && node scripts/verify-dist.mjs",
"typecheck": "tsc --noEmit",
Expand Down
34 changes: 34 additions & 0 deletions playground/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,40 @@ as the source library does. Any other nonempty body is descriptive intent:
it needs independently reviewed materialization and a trusted host's approved
sidecar. The public playground deliberately does not fabricate that step.

## Player design review (TL-P01)

Open [the Player design review](http://localhost:5173/?player-lab=1) from the
Playground header, or add `?player-lab=1` to the same deployed Playground URL.

This **review surface is not the new production player**. Its **Live player** mode
uses the real schema-2 compiler and unchanged native React player, so it exposes
the current rendering at 260, 320, 375, 768 and 1280 CSS-pixel host widths.
Select the four verified references, initial graph/sequence/state-table view,
light/dark/system theme, long-label/no-title cases, or an intentionally
non-rendered invalid case. Use native transport to inspect initial, middle and
final steps, select a node and open Inspect. The player may still look cramped:
that is precisely what TL-P02–TL-P04 are intended to fix.

**Layout study** is an explicitly static anatomy proposal, not a functioning
renderer, fabricated artifact, working transport or screenshot of shipped UI.
It previews the intended hierarchy, token treatment and primary control sizes.
The five regions and design decisions are documented in
[the source design system](../docs/player-design-system.md).

For reproducible *real browser* review images, first build the Playground, then:

```sh
pnpm preview:build
pnpm audit:player-design
```

Images and the environment manifest are written under
`.release-evidence/player-design/` (ignored by Git, available as a CI artifact).
These are **unapproved baseline captures** until manually reviewed. Do not
replace an actual screenshot with the static layout study or claim that
screenshot checks prove accessibility. For the complete fixture/interaction
review, follow [the visual review checklist](../docs/player-design-system.md#visual-review-and-reproducible-fixtures).

## Local development

From the repository root, with Node.js >=24 and the pinned pnpm:
Expand Down
4 changes: 3 additions & 1 deletion playground/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
} from "./workbench.js";
import "../src/styles/throughline.css";
import "./style.css";
import { PlayerDesignLab } from "./player-design.js";

type Theme = "auto" | "light" | "dark";
type Viewport = "wide" | "tablet" | "mobile";
Expand Down Expand Up @@ -204,6 +205,7 @@ function App() {
<span className="brand-section">Playground</span>
</a>
<nav className="header-nav" aria-label="Resources">
<a href="?player-lab=1" className="player-design-nav">Player design <Icon name="arrow" size={15} /></a>
<a href="https://github.com/0xbuffdev/throughline/blob/main/docs/grammar.md"
target="_blank" rel="noopener noreferrer">Authoring guide <Icon name="arrow" size={15} /></a>
<a href="https://github.com/0xbuffdev/throughline"
Expand Down Expand Up @@ -463,4 +465,4 @@ function App() {

const root = document.getElementById("root");
if (!root) throw new Error("Missing playground root.");
createRoot(root).render(<StrictMode><App /></StrictMode>);
createRoot(root).render(<StrictMode>{new URLSearchParams(window.location.search).has("player-lab") ? <PlayerDesignLab /> : <App />}</StrictMode>);
Loading
Loading