Timeline: Dependabot stories use shared internal helpers (UserActor, EventSubRow)#8142
Conversation
There was a problem hiding this comment.
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
UserActorusage with sharedUserActorhelper instances. - Replace local dismissal-note sub-row helper (
NoteComment) with the sharedEventSubRowhelper. - 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
| <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> |
There was a problem hiding this comment.
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.
…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>
fb7879d to
532c088
Compare
|
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:UserActor(avatar + bold muted link) → shared<UserActor href="#" muted />.NoteComment(aNoteIconsub-row) → shared<EventSubRow icon={NoteIcon}>…</EventSubRow>.Kept local on purpose:
DependabotActor— the square-avatar + linked bot +botlabel 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
Changed
UserActorandEventSubRowhelpers instead of local duplicates.UserActoris pixel-identical. The note sub-rows have an intentional minor spacing normalization — the sharedEventSubRowis 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
UserActor/NoteCommenthelpers, their.NoteComment/.NoteIconCSS, and the unusedMONALISA_AVATARconstant.Rollout strategy
Testing & Reviewing
Pure refactor, zero consumer-facing change.
Axe.test.tsagainst a servedstorybook-static, scoped to Dependabot): 45/45 passed (5 stories × 9 themes), unchanged.Merge checklist