Timeline: CommentCard uses shared MutedTime permalink helper#8141
Conversation
Swap CommentCard's inline permalink timestamp for the shared MutedTime helper (with href) from timelineStoryHelpers. Pure Storybook-only refactor, zero visual change. Follow-up to #8072 adopting the shared permalink-time helper introduced in #8140. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
There was a problem hiding this comment.
Pull request overview
Refactors the internal Timeline CommentCard helper to render its permalink timestamp via the shared MutedTime helper (introduced in prior Timeline internal helpers work), removing the now-redundant inline Link + RelativeTime composition and its local CSS underline class.
Changes:
- Replace
Link+RelativeTimetimestamp rendering with<MutedTime date={...} href="#" />. - Remove the now-unused local
.TimestampCSS class and theRelativeTimeimport.
Show a summary per file
| File | Description |
|---|---|
| packages/react/src/Timeline/internal/CommentCard.tsx | Switches permalink timestamp rendering to the shared MutedTime helper and drops the direct RelativeTime dependency. |
| packages/react/src/Timeline/internal/CommentCard.module.css | Removes the local .Timestamp underline rule now covered by MutedTime’s shared styling. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Low
fb7879d to
532c088
Compare
Summary
Part of Phase 2 of the Timeline events work (github/primer#6663), and a follow-up to #8072 (merged). It adopts the shared permalink-time helper added in #8140.
The
CommentCardinternal helper had the muted, underlined permalink timestamp baked inline. This swaps it for the sharedMutedTimehelper called withhref, which renders that exact pattern. Storybook-only, nothing ships in the package.Changelog
New
Changed
CommentCardnow renders its permalink timestamp via the sharedMutedTimehelper (<MutedTime date={…} href="#" />) instead of an inline<Link muted><RelativeTime/></Link>. Pure refactor, zero visual change.Removed
.TimestampCSS class and theRelativeTimeimport fromCommentCard.Rollout strategy
Testing & Reviewing
Storybook-only. Verified the
Components/Timeline/Internal→Comment cardsstory headlessly: all comment timestamps still render as underlined muted permalinks at both ≥768px and <768px (the responsive collapsed comment form), with zero console errors. prettier / eslint / stylelint / tsc report no new errors.Merge checklist