Skip to content

Timeline: CommentCard uses shared MutedTime permalink helper#8141

Open
janmaarten-a11y wants to merge 1 commit into
janmaarten-a11y-janmaarten-a11y-timeline-dependabot-sharfrom
janmaarten-a11y-janmaarten-a11y-timeline-comment-shared
Open

Timeline: CommentCard uses shared MutedTime permalink helper#8141
janmaarten-a11y wants to merge 1 commit into
janmaarten-a11y-janmaarten-a11y-timeline-dependabot-sharfrom
janmaarten-a11y-janmaarten-a11y-timeline-comment-shared

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 #8072 (merged). It adopts the shared permalink-time helper added in #8140.

The CommentCard internal helper had the muted, underlined permalink timestamp baked inline. This swaps it for the shared MutedTime helper called with href, which renders that exact pattern. Storybook-only, nothing ships in the package.

Changelog

New

  • None.

Changed

  • CommentCard now renders its permalink timestamp via the shared MutedTime helper (<MutedTime date={…} href="#" />) instead of an inline <Link muted><RelativeTime/></Link>. Pure refactor, zero visual change.

Removed

  • The now-unused local .Timestamp CSS class and the RelativeTime import from CommentCard.

Rollout strategy

  • None; Storybook-only helper change with no published/runtime impact (stories don't ship).

Testing & Reviewing

Storybook-only. Verified the Components/Timeline/InternalComment cards story 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

  • 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

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>
@changeset-bot

changeset-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e101c56

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

@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-8141 July 8, 2026 20:19 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 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 + RelativeTime timestamp rendering with <MutedTime date={...} href="#" />.
  • Remove the now-unused local .Timestamp CSS class and the RelativeTime import.
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

@janmaarten-a11y janmaarten-a11y changed the base branch from main to janmaarten-a11y-janmaarten-a11y-timeline-dependabot-shar July 8, 2026 20:36
@janmaarten-a11y janmaarten-a11y requested review from adierkens and removed request for liuliu-dev July 8, 2026 20:44
@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
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