Timeline: add Dependabot assignment and Copilot work timeline events#8147
Timeline: add Dependabot assignment and Copilot work timeline events#8147janmaarten-a11y wants to merge 2 commits into
Conversation
|
There was a problem hiding this comment.
Pull request overview
This PR extends the Dependabot Timeline Storybook feature stories to cover remaining live event types from the server-rendered Dependabot alert timeline, specifically focusing on assignment and Copilot work lifecycle events.
Changes:
- Added a new
EventAssignmentstory with five variants covering self-assignment, assignment/unassignment of another user, and a combined case. - Added a new
EventCopilotWorkstory with “work started” and “work finished” variants, including a right-aligned “View session” action for the started state. - Introduced two additional public avatar fixtures for use in the new assignment examples.
Show a summary per file
| File | Description |
|---|---|
| packages/react/src/Timeline/Timeline.dependabot.features.stories.tsx | Adds new Dependabot timeline event stories for assignment and Copilot work started/finished, aligning Storybook coverage with live ERB behavior. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Low
Summary
This is a Phase 2 follow-up (github/primer#6663) that fills the remaining gaps in the Dependabot alert Timeline event stories. It adds the three live Dependabot timeline events that our merged stories were missing:
assignment,copilot_work_started, andcopilot_work_finished. The work is Storybook-only and stays surgical: it adds two new exported stories to the existingTimeline.dependabot.features.stories.tsxfile and reuses the shared internal story helpers.What it adds
EventAssignment: mirrors the existing Secret scanning assignment story with five variant sections (self-assigned, assigned another user, removed own assignment, unassigned another user, and a combined assign + unassign). It uses a default (gray)PersonIconbadge and renders both the actor and the assignee with avatars, following this file's own linked, mutedUserActorconvention.EventCopilotWork: one story with two variant sections (work started and work finished). The started row uses a defaultGitBranchIconbadge and a right-aligned small anchorButton("View session"); the finished row uses a defaultRepoPushIconbadge. In both rows "Copilot" renders as bold plain text (a<strong>), matching how this file already renders bold non-link text.Source of truth
Dependabot is server-rendered ERB (ViewComponent), so each event is translated faithfully from the live monolith components in
app/components/dependabot_alerts/timeline_items/:assignment_component.{rb,html.erb}(badgeperson;action_textcollapses self-actions to "self-assigned this" / "removed their assignment", otherwise the bare action word plus the assignee).copilot_work_started_component.{rb,html.erb}(badgegit-branch; optional right-floated "View session" anchor button when a session URL is present).copilot_work_finished_component.{rb,html.erb}(badgerepo-push).Each new story carries a JSDoc doc-comment citing its ViewComponent source, matching the style of the existing stories.
Out of scope
Per the Phase 2 plan, these stories are intentionally not wired into
Timeline.docs.jsonorbuild.ts, and nodata-*filtering attributes are added (deferred to Phase 3). No new CSS was needed.Testing & Reviewing
EventAssignmentandEventCopilotWorkheadlessly in Chromium against the local Storybook build and confirmed: assignment rows show actor and assignee avatars with the correct copy; Copilot rows show bold plain "Copilot" (no avatar), the git-branch and repo-push badges, and the "View session" button only on the started row, all with zero component or React console errors or warnings.Note: primer/react
mainis currently locked for a release, so this will not appear in the public Storybook until the release cuts.Rollout strategy
skip changesetlabel is applied.