diff --git a/packages/views/issues/components/issue-mention-card.tsx b/packages/views/issues/components/issue-mention-card.tsx index ff26729b54..3fd88804c7 100644 --- a/packages/views/issues/components/issue-mention-card.tsx +++ b/packages/views/issues/components/issue-mention-card.tsx @@ -27,7 +27,7 @@ export function IssueMentionCard({ issueId, fallbackLabel }: IssueMentionCardPro href={p.issueDetail(issueId)} target={openInNewTab ? "_blank" : undefined} newTabTitle={fallbackLabel} - className="issue-mention not-prose align-middle" + className="issue-mention align-middle" > ` + * looks identical and works for a mouse, which is exactly why that regression + * is easy to miss (see project-mention-a11y.test.tsx). + * + * AppLink owns plain-click, modifier-click and the desktop new-tab adapter, so + * none of that is reimplemented here. Unlike an issue there is no "open in new + * tab" preference to honour — that setting is scoped to issue links. + */ +export function ProjectMentionCard({ + projectId, + fallbackLabel, +}: ProjectMentionCardProps) { + const p = useWorkspacePaths(); + return ( + + + + ); +} diff --git a/packages/views/rich-content/rich-content.tsx b/packages/views/rich-content/rich-content.tsx index c4efe3950f..24441ea523 100644 --- a/packages/views/rich-content/rich-content.tsx +++ b/packages/views/rich-content/rich-content.tsx @@ -39,7 +39,7 @@ import remarkMath from "remark-math"; import rehypeRaw from "rehype-raw"; import rehypeSanitize from "rehype-sanitize"; import { cn } from "@multica/ui/lib/utils"; -import { useWorkspacePaths, useWorkspaceSlug } from "@multica/core/paths"; +import { useWorkspaceSlug } from "@multica/core/paths"; import { useConfigStore } from "@multica/core/config"; import type { Attachment } from "@multica/core/types"; import { @@ -48,10 +48,10 @@ import { markdownSanitizeSchema, markdownUrlTransform, } from "@multica/ui/markdown"; -import { AppLink, useAppOrigin } from "../navigation"; +import { useAppOrigin } from "../navigation"; import { IssueMentionCard } from "../issues/components/issue-mention-card"; import { useResolveIssueIdentifier } from "../issues/hooks"; -import { ProjectChip } from "../projects/components/project-chip"; +import { ProjectMentionCard } from "../projects/components/project-mention-card"; import { useLinkHover, LinkHoverCard } from "../editor/link-hover-card"; import { openLink, @@ -144,34 +144,15 @@ function IdentifierIssueMentionLink({ } /** - * Project mention chip. - * - * Rendered as a real anchor via AppLink, matching IssueMentionCard: a mention is - * a link, so it must be reachable by Tab and activatable by Enter, and expose a - * URL to copy / open in a new tab. A `` looks identical and works - * for a mouse, which is exactly why the regression is easy to miss — the readonly - * renderer used one, and unifying the surfaces would have propagated it to Chat, - * which previously had the accessible version. - * - * AppLink also owns plain-click, modifier-click and the desktop new-tab adapter, - * so none of that is reimplemented here. The wrapper only shields surrounding - * click handlers (e.g. collapsed-comment expanders) from mention clicks. + * Project mention chip. Navigation and accessibility are owned by the AppLink + * inside ProjectMentionCard; the wrapper only shields surrounding click + * handlers (e.g. collapsed-comment expanders) from mention clicks — the same + * shape as IssueMentionLink above. */ function ProjectMentionLink({ projectId, label }: { projectId: string; label?: string }) { - const p = useWorkspacePaths(); return ( e.stopPropagation()}> - - - + ); }