Skip to content

Timeline: Dependabot stories use shared internal helpers (UserActor, EventSubRow)#8142

Open
janmaarten-a11y wants to merge 1 commit into
janmaarten-a11y-license-compliance-timeline-storiesfrom
janmaarten-a11y-janmaarten-a11y-timeline-dependabot-shar
Open

Timeline: Dependabot stories use shared internal helpers (UserActor, EventSubRow)#8142
janmaarten-a11y wants to merge 1 commit into
janmaarten-a11y-license-compliance-timeline-storiesfrom
janmaarten-a11y-janmaarten-a11y-timeline-dependabot-shar

Conversation

@janmaarten-a11y

@janmaarten-a11y janmaarten-a11y commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Part of Phase 2 of the Timeline events work (github/primer#6663), and a follow-up to #8071 (merged). It adopts the shared internal story helpers added in #8140 so the Dependabot event stories stop duplicating scaffolding. Storybook-only, no consumer-facing change.

Swaps the Dependabot story's local helpers for the shared ones in ./internal/timelineStoryHelpers:

  • Local UserActor (avatar + bold muted link) → shared <UserActor href="#" muted />.
  • Local NoteComment (a NoteIcon sub-row) → shared <EventSubRow icon={NoteIcon}>…</EventSubRow>.

Kept local on purpose:

  • DependabotActor — the square-avatar + linked bot + bot label shape is Dependabot-specific, so it stays a thin local helper built from the shared primitives.
  • PushPill — the SHA pill needs its own live-parity check, so it's left exactly as-is for now.

Changelog

New

  • None.

Changed

  • Dependabot Timeline event stories now use the shared UserActor and EventSubRow helpers instead of local duplicates. UserActor is pixel-identical. The note sub-rows have an intentional minor spacing normalization — the shared EventSubRow is the new canonical layout (margin-top: base-size-4, no left indent) vs. the old local .NoteComment (margin-top: base-size-8 + padding-left: base-size-4), a small consistency shift on the 3 note rows, matching how Timeline: add Code Scanning event stories (Phase 2) #8074 (Code) flagged the same delta.

Removed

  • The unused local UserActor/NoteComment helpers, their .NoteComment/.NoteIcon CSS, and the unused MONALISA_AVATAR constant.

Rollout strategy

  • None; Storybook-only refactor with no runtime/API impact (stories don't ship).

Testing & Reviewing

Pure refactor, zero consumer-facing change.

  • Headless render: all 5 Dependabot stories render in real Chromium; axe-core reports 0 violations.
  • Real axe AAT (Axe.test.ts against a served storybook-static, scoped to Dependabot): 45/45 passed (5 stories × 9 themes), unchanged.
  • prettier / eslint / stylelint clean; no new type errors. Grep-swept for dangling refs — none.

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 janmaarten-a11y added skip changeset This change does not need a changelog integration-tests: skipped manually Changes in this PR do not require an integration test component: Timeline labels Jul 8, 2026
@github-actions github-actions Bot temporarily deployed to storybook-preview-8142 July 8, 2026 20:23 Inactive
@janmaarten-a11y janmaarten-a11y marked this pull request as ready for review July 8, 2026 20:25
@janmaarten-a11y janmaarten-a11y requested a review from a team as a code owner July 8, 2026 20:25

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

Refactors the Dependabot Timeline Storybook feature stories to use the shared internal helpers introduced for Phase 2 Timeline event stories, reducing duplicated scaffolding and aligning with the internal helper suite (./internal/timelineStoryHelpers). This is Storybook-only and does not affect the published @primer/react runtime API.

Changes:

  • Replace local UserActor usage with shared UserActor helper instances.
  • Replace local dismissal-note sub-row helper (NoteComment) with the shared EventSubRow helper.
  • Remove now-unused local constants/helpers and associated CSS.
Show a summary per file
File Description
packages/react/src/Timeline/Timeline.dependabot.features.stories.tsx Swaps Dependabot stories from local actor/sub-row helpers to shared UserActor/EventSubRow; removes the local duplicates.
packages/react/src/Timeline/Timeline.dependabot.features.stories.module.css Removes CSS that was only used by the deleted local NoteComment helper.

Review details

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

Comment on lines +289 to +294
<UserActor href="#" muted />
{'dismissed this as risk is tolerable '}
<MutedTime date={new Date('2022-08-02T14:10:00Z')} />
<NoteComment>This dependency is only used in our test tooling, so the risk is acceptable.</NoteComment>
<EventSubRow icon={NoteIcon}>
This dependency is only used in our test tooling, so the risk is acceptable.
</EventSubRow>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch — you're right, and I've corrected the description + the nearby inline comment. To be explicit: UserActor is pixel-identical, but the note sub-rows DO shift slightly. That's intentional — EventSubRow normalizes to one canonical layout (margin-top: base-size-4, no indent) rather than carrying forward each surface's incidental .NoteComment spacing (margin-top: base-size-8 + padding-left: base-size-4). This is the same consolidation #8074 (Code) called out. The shared helper is meant to be the new canonical sub-row, so I'm updating the docs to match rather than adding indent/spacing props to preserve the old per-surface drift.

@janmaarten-a11y janmaarten-a11y changed the base branch from main to janmaarten-a11y-license-compliance-timeline-stories July 8, 2026 20:35
@janmaarten-a11y janmaarten-a11y requested review from adierkens and removed request for TylerJDev July 8, 2026 20:42
…EventSubRow)

Swap the Dependabot Timeline story's local UserActor and NoteComment helpers
for the shared ones from ./internal/timelineStoryHelpers (added in #8140).
Storybook-only, no consumer-facing change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@janmaarten-a11y janmaarten-a11y force-pushed the janmaarten-a11y-janmaarten-a11y-timeline-dependabot-shar branch from fb7879d to 532c088 Compare July 8, 2026 21:21
@changeset-bot

changeset-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 532c088

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: Timeline 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.

2 participants