Skip to content

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

Merged
janmaarten-a11y merged 5 commits into
mainfrom
janmaarten-a11y-timeline-playground-story
Aug 19, 2026
Merged

Add an interactive Timeline Playground story and rename Playground to Event Playground#8322
janmaarten-a11y merged 5 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: 8f2b399

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.
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8322 August 19, 2026 06:48 Inactive
@janmaarten-a11y
janmaarten-a11y marked this pull request as ready for review August 19, 2026 18:13
Copilot AI lite review requested due to automatic review settings August 19, 2026 18:13
@janmaarten-a11y
janmaarten-a11y requested a review from a team as a code owner August 19, 2026 18:13
@janmaarten-a11y janmaarten-a11y added the integration-tests: skipped manually Changes in this PR do not require an integration test label Aug 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Storybook coverage for the Phase 3 Timeline redesign by introducing a new, interactive Timeline Playground story that demonstrates filtering via data-* attributes, and renames the existing single-item playground to Event Playground to clarify intent.

Changes:

  • Renames the existing Playground story export to EventPlayground (updating its Storybook URL/id).
  • Adds a new TimelinePlayground story with surface/category/type controls that filter representative timeline rows and emit data-event-* attributes per row.
  • Adds story-local CSS module styles used by the new playground (empty state + strong text styling).
Show a summary per file
File Description
packages/react/src/Timeline/Timeline.stories.tsx Renames the existing story and adds the new interactive TimelinePlayground story + representative data/control wiring.
packages/react/src/Timeline/Timeline.stories.module.css Adds PlaygroundEmpty and Strong styles used by TimelinePlayground.

Review details

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Suppressed comments (2)

packages/react/src/Timeline/Timeline.stories.tsx:739

  • actorType: 'system' will flow through to data-actor-type and produce a value that’s outside the repo’s current taxonomy contract ('user' | 'bot'). If this is meant to represent GitHub automation, map it to 'bot' (or omit actorType to omit the attribute).
            label: 'Created',
            visibility: 'primary',
            actorType: 'system',
            badge: {icon: ShieldIcon, variant: 'success'},

packages/react/src/Timeline/Timeline.stories.tsx:754

  • Same as above: 'system' isn’t a valid data-actor-type value per the repo’s current taxonomy. Use 'bot' for first-party automation (or omit the actor type entirely).
            label: 'Validity: active',
            visibility: 'primary',
            actorType: 'system',
            badge: {icon: AlertIcon, variant: 'danger'},
  • Files reviewed: 2/2 changed files
  • Comments generated: 4
  • Review effort level: Lite

Comment thread packages/react/src/Timeline/Timeline.stories.tsx Outdated
Comment thread packages/react/src/Timeline/Timeline.stories.tsx Outdated
Comment thread packages/react/src/Timeline/Timeline.stories.tsx Outdated
Comment thread packages/react/src/Timeline/Timeline.stories.tsx Outdated
Align the playground data-* values with the real event contract: use the authoritative primary/auditOnly-adjacent actor value space (data-actor-type is user or bot, so the GitHub secret-scanning system actor is bot), emit the singular issue scope to match the surface identifier, render badge icons directly instead of the deprecated Octicon component, and clarify the canon note that Primer hosts no authoritative taxonomy.

@liuliu-dev liuliu-dev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Narrow the Event Playground's data-actor-type to user or bot: the four actor presets stay as a visual convenience, but the app and Copilot presets serialize to bot, matching the authoritative actor value space. Narrow data-event-scope to the real surface set (pull, issue, dependabot, code-scanning, secret-scanning, license-compliance), dropping the invented shared, pr, and custom values, and default the scope to issue.
@janmaarten-a11y
janmaarten-a11y added this pull request to the merge queue Aug 19, 2026
Merged via the queue into main with commit 9ba3394 Aug 19, 2026
54 checks passed
@janmaarten-a11y
janmaarten-a11y deleted the janmaarten-a11y-timeline-playground-story branch August 19, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: skipped manually Changes in this PR do not require an integration test skip changeset This change does not need a changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants