Skip to content

Add an interactive Timeline Playground story and rename Playground to Event Playground - #8322

Draft
janmaarten-a11y wants to merge 3 commits into
mainfrom
janmaarten-a11y-timeline-playground-story
Draft

Add an interactive Timeline Playground story and rename Playground to Event Playground#8322
janmaarten-a11y wants to merge 3 commits into
mainfrom
janmaarten-a11y-timeline-playground-story

Conversation

@janmaarten-a11y

@janmaarten-a11y janmaarten-a11y commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Background

This is the Primer side of Phase 3 of the Timeline redesign (github/primer#6664, part of the epic github/primer#6654). Phase 2 shipped the per-surface event examples under Components/Timeline/Events; Phase 3 adds a playground that shows how a timeline is filtered by event category.

The event taxonomy itself (which surfaces exist, which categories each offers, and which event types belong to each) is a GitHub product concern and now lives in github-ui, not Primer. An earlier attempt to host that taxonomy in Primer is being unwound: the module from #8180 is removed in #8321, and the tagging PR #8216 was closed. So this story keeps the GitHub-specific values as inline, illustrative example data and never ships them as a reusable module or public API.

What this does

This adds an interactive Timeline Playground story (components-timeline--timeline-playground) that demonstrates how the filtering data-* attributes (data-event-scope, data-event-type, data-event-category, data-event-visibility, and data-actor-type) are embedded on each Timeline.Item. It renders real Timeline rows with the shared story helpers so they read like the existing per-surface catalog stories.

The story provides its picker as real Storybook controls: a surface selector, a category multi-select, and an event-type multi-select. Because Storybook cannot repopulate one control's option list from another control's value, the story declares each surface's category and event-type controls up front and conditionally shows only the selected surface's controls through conditional argTypes (if: {arg: 'surface', ...}), hiding the others, which fakes the dynamic surface swap the Figma prototype shows. The render then filters the representative rows by the selected surface's categories and event types before mapping to Timeline.Item, so a future Timeline.Filter can drive the same structure.

The surface, category, and event-type map in this story is illustrative representative data, not a catalog. The authoritative per-surface taxonomy lives in github-ui. The map stays inline in the story file, is not exported, and adds no reusable module.

This also renames the existing single-event Playground story to Event Playground, which changes its story URL from components-timeline--playground to components-timeline--event-playground. The rename is intended: that story configures one event, while the new Timeline Playground shows a full, filterable timeline.

Changelog

New

  • A Timeline Playground story (components-timeline--timeline-playground) with Storybook surface, category, and event-type controls that render representative Timeline events carrying the data-* attributes.

Changed

  • Renames the single-event Playground story to Event Playground, so its story URL becomes components-timeline--event-playground.

Removed

  • Nothing.

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

This is a stories-only change. It adds no public API, changes nothing in packages/react/src/index.ts, and needs no changeset, so the skip changeset label is applied.

Testing & Reviewing

Open Storybook and select Components, then Timeline, then Timeline Playground, and open the Controls panel. Change the surface control and confirm that only the selected surface's category and event-type controls appear while the other surfaces' controls are hidden. Then toggle that surface's categories and event types and confirm the rendered rows update and each Timeline.Item carries data-event-scope, data-event-type, data-event-category, data-event-visibility, and data-actor-type, with actor-less rows omitting data-actor-type. Confirm the renamed Event Playground story still renders a single configurable event. Validated locally with tsc --noEmit, eslint --max-warnings=0 on the Timeline directory, prettier --check, npm run build --workspace @primer/react, and the storybook.test.tsx export check, plus a Storybook run confirming the surface-gated controls show and hide and that axe reports no violations.

…ent Playground

Add a Timeline Playground story that demonstrates the data-* event contract on Timeline.Item across surfaces using illustrative github-flavored data, driven by an in-canvas surface, category, and event-type picker. Rename the existing single-event Playground story to Event Playground. Stories only, no public API change.
@changeset-bot

changeset-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: faf71d9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Replace the in-canvas control panel with real Storybook controls. A single surface selector plus per-surface category and event-type multi-selects are declared up front, and each per-surface pair is gated with a conditional argType on the surface value so only the selected surface's controls show. The render filters the representative rows by the selected categories and types. Stories only, no public API change.
… arg defaults

Change the Timeline Playground's data-event-visibility vocabulary from the invented public/private to the authoritative primary/auditOnly value space. Every existing representative row is primary, and a new issues metadata category adds a labeled auditOnly row so the demo shows both values. Generate the per-surface arg defaults from the surface ids instead of hand-listing them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changeset This change does not need a changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant