diff --git a/apps/mobile/src/features/issues/IssueRouteScreen.tsx b/apps/mobile/src/features/issues/IssueRouteScreen.tsx index 874ecfba20b6d..062b46d536df2 100644 --- a/apps/mobile/src/features/issues/IssueRouteScreen.tsx +++ b/apps/mobile/src/features/issues/IssueRouteScreen.tsx @@ -381,7 +381,7 @@ function IssueCommentCard(props: { const { comment } = props; return ( - + {comment.author?.login ?? gt("Unknown author")} diff --git a/apps/mobile/src/features/pull-requests/PullRequestTimeline.tsx b/apps/mobile/src/features/pull-requests/PullRequestTimeline.tsx index c4068636242e5..d90366ca533a9 100644 --- a/apps/mobile/src/features/pull-requests/PullRequestTimeline.tsx +++ b/apps/mobile/src/features/pull-requests/PullRequestTimeline.tsx @@ -105,7 +105,7 @@ function TimelineComment({ icon={approved ? "checkmark" : changes ? "doc.text" : "text.bubble"} tone={approved ? "success" : changes ? "danger" : undefined} > - + @@ -275,7 +275,7 @@ export function pullRequestTimelineRows( date: thread.comments[0]?.createdAt ?? "", content: ( - + diff --git a/apps/web/src/components/issue/IssueDetailPanel.tsx b/apps/web/src/components/issue/IssueDetailPanel.tsx index 6ad7cbd436546..bdee83563a330 100644 --- a/apps/web/src/components/issue/IssueDetailPanel.tsx +++ b/apps/web/src/components/issue/IssueDetailPanel.tsx @@ -828,23 +828,25 @@ export function IssueDetailPanel({ key={`c:${item.comment.id}`} className="flex flex-col gap-2 rounded-lg border border-border/60 p-3" > - - - {item.comment.url ? ( - - } - > - {formatRelativeTimeLabel(item.comment.createdAt, undefined, messages)} - - ) : ( - - {formatRelativeTimeLabel(item.comment.createdAt, undefined, messages)} - - )} - +

+ + + {item.comment.url ? ( + + } + > + {formatRelativeTimeLabel(item.comment.createdAt, undefined, messages)} + + ) : ( + + {formatRelativeTimeLabel(item.comment.createdAt, undefined, messages)} + + )} + +

+

- +

); } diff --git a/apps/web/src/components/pullRequest/PullRequestTimelineTab.browser.test.tsx b/apps/web/src/components/pullRequest/PullRequestTimelineTab.browser.test.tsx index 847cbb60aa650..531e3bc86f4eb 100644 --- a/apps/web/src/components/pullRequest/PullRequestTimelineTab.browser.test.tsx +++ b/apps/web/src/components/pullRequest/PullRequestTimelineTab.browser.test.tsx @@ -5,6 +5,7 @@ import { type PullRequestDetailView, } from "@t3tools/contracts"; import { expect, it, vi } from "vite-plus/test"; +import { userEvent } from "vite-plus/test/browser"; import { render } from "../../../test/render"; import "../../index.css"; @@ -174,3 +175,49 @@ it.each(["review", "issue-comment", "resolved-reply"] as const)( await expect.element(screen.getByText("Linked reply", { exact: true })).toBeVisible(); }, ); + +it("gives each comment and review a heading for screen reader navigation", async () => { + const commented: PullRequestDetailView = { + ...detail, + commits: [], + comments: [ + { + id: "review", + kind: "review", + author: { login: "bob", name: null, avatarUrl: null }, + body: "Looks good", + createdAt: "2026-10-01T00:00:00Z", + url: `${detail.url}#pullrequestreview-1`, + path: null, + reviewState: "APPROVED", + }, + { + id: "comment", + kind: "issue-comment", + author: { login: "alice", name: null, avatarUrl: null }, + body: "One question", + createdAt: "2026-10-01T00:01:00Z", + url: `${detail.url}#issuecomment-2`, + path: null, + reviewState: null, + }, + ], + }; + await using screen = await render( +
+ {}} + detail={commented} + environmentId={EnvironmentId.make("environment")} + reference={detail} + order="oldest" + onOpenCommit={() => {}} + onRefresh={() => {}} + /> +
, + ); + await expect.element(screen.getByRole("heading", { name: /bob approved/i })).toBeVisible(); + await userEvent.click(screen.getByRole("button", { name: /1 comment/ })); + await expect.element(screen.getByText("One question", { exact: true })).toBeVisible(); + await expect.element(screen.getByRole("heading", { name: /alice commented/ })).toBeVisible(); +}); diff --git a/apps/web/src/components/pullRequest/PullRequestTimelineTab.tsx b/apps/web/src/components/pullRequest/PullRequestTimelineTab.tsx index 89a185f2ecf25..d506220187422 100644 --- a/apps/web/src/components/pullRequest/PullRequestTimelineTab.tsx +++ b/apps/web/src/components/pullRequest/PullRequestTimelineTab.tsx @@ -293,7 +293,7 @@ function ConversationCard({
-
+

{event.kind === "review" ? ( @@ -315,7 +315,7 @@ function ConversationCard({ )} {event.reviewState ? : null} -

+ @@ -749,7 +749,7 @@ function ReviewVerdictEvent({ />
-
+

{pullRequestReviewOutcomeStaleLabel(outcome, resolve)} -

+