Skip to content

Timeline: add Dependabot event stories (Phase 2)#8071

Draft
janmaarten-a11y wants to merge 7 commits into
mainfrom
janmaarten-a11y-timeline-dependabot-stories
Draft

Timeline: add Dependabot event stories (Phase 2)#8071
janmaarten-a11y wants to merge 7 commits into
mainfrom
janmaarten-a11y-timeline-dependabot-stories

Conversation

@janmaarten-a11y

@janmaarten-a11y janmaarten-a11y commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Storybook Features stories that recreate GitHub's live Dependabot alert timeline events using the Primer Timeline component and its compositional slots. This is the Dependabot surface of Phase 2 of the Timeline events effort (github/primer#6663). The Issues surface already landed in #8070; the PR and other surfaces will follow separately.

All examples live in a single new file, Timeline.dependabot.features.stories.tsx (+ a .module.css), exported under the title Components/Timeline/Events/Dependabot — one story export per event group.

The 5 event groups (23 variants total)

Group Variants Badge
EventOpened 3 — Opened / from PR / from push shield on solid success
EventFixed 3 — Fixed / via PR / via push shield-check on solid done
EventDismissed 8 — 5 manual reasons (+ optional note) + 3 auto (rule-based, incl. from PR/push) bare shield-slash (muted icon)
EventReopened 5 — manual reopen + reintroduced ×source + auto-reopened sync on solid success
EventDismissalRequest 4 — Requested / Approved / Denied / Cancelled bare badge + colored icon

Source of truth

These stories were recreated from the live, server-rendered ERB ViewComponents in app/components/dependabot_alerts/timeline_items/ in github/github. Each component's render markup and the Primer component arguments it passes were read directly and translated faithfully into Primer React; the source file is cited inline next to each event.

Notably, Dependabot's alert timeline has no React implementation yet — it is 100% ERB. github/github-ui ships only Catalyst custom-element controllers (dependabot-alert-*-element.ts) for table-row / load-all / dismissal interactions, not the timeline event rows. So beyond documenting the design system, these stories double as a useful reference for that team's eventual ERB→React migration.

We verified the live render path per component rather than trusting the Figma audit blindly. The most important catch: the dismissal request/review events use a newer inline erb_template (include ViewComponent::InlineTemplate), which is the active render — the older sibling *.html.erb sidecars are dormant dead code. The Figma audit reflected the dormant sidecar (no-avatar, person/check-circle badges); the live inline template renders a circle user avatar with status-driven icons. Live won.

We were also careful about the Primer badge mechanic: events whose ERB sets bg: :*_emphasis (Opened/Fixed/Reopened) correctly use a solid Timeline.Badge variant, while events whose ERB sets only color: :* with no bg: (Dismissed, Dismissal Request/Review/Cancelled) render as a bare default badge with a colored icon — not a solid-color badge.

Slots used (Phase 1 slots)

  • Inline actor avatar in Timeline.Body for badge-row events — a square avatar + bold link + (bot) Label for Dependabot-authored events (ActorComponent :dependabot mode), and a circle 20px user avatar + bold link for user-authored events.
  • Timeline.Actions (right-controls slot, added in Add Timeline.Actions sub-component #7886) for the Dismissal Requested "Review request" button — the live inline template renders a float-right DismissalReviewDialogComponent, whose visible control is a single small primary button that opens the approve/deny dialog.
  • Dependabot-specific bits composed from primitives: the square bot avatar, the (bot) tag (Label variant="secondary", mirroring ERB bot_identifier_tag), and the inline push-pill SHA (PushLinkComponent → a <code>-wrapped Link styled as the subtle light-blue GitHub SHA pill). Push-pills are part of the sentence body text in the live PushLinkComponent, so they correctly stay inline in Timeline.Body, not in Timeline.Actions.

Scope & conventions

  • Every story is wrapped in a file-scoped FeatureFlags decorator enabling primer_react_timeline_list_semantics (the future-state <ol>/<li> DOM; refs Timeline: Use list semantics for screen reader navigation #7910).
  • Storybook-only by design. These are intentionally not wired into components-json / the primer.style docs page (not added to Timeline.docs.json or build.ts) — individual timeline events are not consumer-facing components.
  • The future event-category data-* filtering taxonomy (github/primer#6663) is intentionally deferred; the hook location is documented in the file header.

Changelog

New

  • Timeline.dependabot.features.stories.tsx and Timeline.dependabot.features.stories.module.css — Storybook Features stories recreating the Dependabot alert timeline events (5 groups, 23 variants).

Changed

  • None.

Removed

  • None.

Rollout strategy

  • None; if selected, include a brief description as to why

Stories-only change — no consumer-facing package code is added or modified, so no changeset is needed (the skip changeset label is applied).

Testing & Reviewing

  • prettier, eslint, and stylelint all clean; type-check passes with 0 new errors (the pre-existing @primer/doc-gen baseline error in script/components-json/build.ts is unchanged).
  • All 5 groups were visually diffed against the live ERB render and the Figma source. Where Figma was behind live (the dismissal events), the live render won.
  • Browse the stories under Components/Timeline/Events/Dependabot in Storybook to review each group.

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Added/updated previews (Storybook)
  • Changes are SSR compatible
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge
  • (GitHub staff only) Integration tests pass at github/github-ui

janmaarten-a11y and others added 5 commits June 27, 2026 23:13
Storybook-only Dependabot alert timeline event stories under
Components/Timeline/Events/Dependabot, mirroring the Issues stories pattern.
Scoped to the eventOpened group (Opened / OpenedFromPR / OpenedFromPush) as a
reviewable proof-of-pattern. Translated from the live server-rendered ERB
(DependabotAlerts::TimelineItems::OpenedComponent). Not wired into
components-json / primer.style docs by design.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Completes the Dependabot alert timeline event stories (Phase 2): adds eventFixed,
eventDismissed, eventReopened, and eventDismissalRequest alongside the existing
eventOpened group. Adds circle UserActor and no-avatar PlainActor helpers and a
NoteComment sub-content helper, all translated from the live server-rendered ERB
(github/github app/components/dependabot_alerts/timeline_items/).

Corrects the push-pill to the subtle light-blue GitHub SHA pill
(bgColor-accent-muted + fgColor-accent), matching Primer view_components'
bg: :accent mapping rather than the solid emphasis blue.

Storybook-only by design; not wired into components-json / primer.style docs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The dismissal_*_component.rb files use ViewComponent::InlineTemplate, so their
inline erb_template is the active render and the .html.erb sidecars are dead
code. Rebuild Requested/Approved/Denied to the avatar-based inline version:
circle user actor (UserActor), and status-driven badges via named variants —
Requested attention/comment, Approved success/check, Denied danger/x. Cancelled
keeps the plain default (subtle) x badge per its inline template. Optional
review/resolution notes use the shared NoteComment sub-row.

Removes the now-unused PlainActor helper and its CSS, plus the unused Muted,
ResolutionLine, and ReviewCommentBox/Label styles.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The dismissal inline ERB uses with_badge(color: :X, icon: Y) with no bg:, which
tints the icon on the default badge background rather than producing a solid
emphasis badge. Replace the named attention/success/danger Timeline.Badge
variants with a bare Timeline.Badge plus a colored Octicon (icon color via a
.BadgeIcon* class), mirroring the muted Dismissed treatment. Cancelled's :subtle
maps to --fgColor-muted (no --fgColor-subtle token exists).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Dismissal Requested event's live inline template renders a float-right
DismissalReviewDialogComponent when show_dismissal_actions is true — its visible
control is a single small primary "Review request" button that opens the
approve/deny review dialog. Surface it in the Timeline.Actions right-controls
slot (#6678) on the Requested variant only.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Jun 28, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: ebebdf3

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

The bare alert-rule-name links in the auto-dismissed and auto-reopened note
rows had no non-color distinction, failing axe link-in-text-block (WCAG 1.4.1)
in high-contrast themes. Add the inline prop (Primer underlines inline links),
matching the live ERB (the rule name is a plain, non-bold Primer::Beta::Link)
and the convention used by the Issues stories.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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 a new Storybook “Features” story set under Components/Timeline/Events/Dependabot to document/recreate GitHub’s Dependabot alert timeline event rows using Primer React Timeline composition (including Timeline.Actions), plus supporting CSS modules for pixel-faithful styling.

Changes:

  • Added Timeline.dependabot.features.stories.tsx with 5 event-group exports (Opened, Fixed, Dismissed, Reopened, Dismissal Request) and shared helper subcomponents (actor, timestamp, push-pill, note row).
  • Added Timeline.dependabot.features.stories.module.css to style inline avatars, bold links, push-pill appearance, note rows, and badge icon coloring.
Show a summary per file
File Description
packages/react/src/Timeline/Timeline.dependabot.features.stories.tsx New Dependabot timeline event stories, including helper components and Timeline.Actions usage for the review-request control.
packages/react/src/Timeline/Timeline.dependabot.features.stories.module.css Story-only CSS modules to match GitHub’s Dependabot timeline visuals (inline avatars, push-pill, badge icon coloring, timestamps).

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 5
  • Review effort level: Low

Comment thread packages/react/src/Timeline/Timeline.dependabot.features.stories.tsx Outdated
@janmaarten-a11y janmaarten-a11y self-assigned this Jun 28, 2026
Match the live DismissalReviewDialogComponent show-button (scheme: :primary,
size: :small) and the inline comment describing it. Addresses Copilot review.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: Timeline skip changeset This change does not need a changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants