From e9ae5d5e236a9b01115582470859d319625ac6b6 Mon Sep 17 00:00:00 2001
From: adarshsm <24850536+adarshsm@users.noreply.github.com>
Date: Tue, 29 Sep 2026 11:42:01 +0530
Subject: [PATCH] fix(react): give comment action buttons an accessible name
The add reaction, resolve, re-open and more actions buttons in a comment
contain only an icon and passed their text as mainTooltip but not as
label, which is what the Mantine, Ariakit and ShadCN toolbar buttons use
for aria-label. Screen readers announced each one as a bare "button".
Part of #2824
---
.../src/components/Comments/Comment.test.tsx | 121 ++++++++++++++++++
.../react/src/components/Comments/Comment.tsx | 4 +
2 files changed, 125 insertions(+)
create mode 100644 packages/react/src/components/Comments/Comment.test.tsx
diff --git a/packages/react/src/components/Comments/Comment.test.tsx b/packages/react/src/components/Comments/Comment.test.tsx
new file mode 100644
index 0000000000..c82205eaca
--- /dev/null
+++ b/packages/react/src/components/Comments/Comment.test.tsx
@@ -0,0 +1,121 @@
+import { en } from "@blocknote/core/locales";
+import type { CommentData, ThreadData } from "@blocknote/core/comments";
+import type { ReactNode } from "react";
+import { renderToStaticMarkup } from "react-dom/server";
+import { describe, expect, it, vi } from "vite-plus/test";
+
+import { Comment } from "./Comment.js";
+
+const { passThrough, components, allow } = vi.hoisted(() => {
+ const passThrough = ({ children }: { children?: ReactNode }) => (
+ <>{children}>
+ );
+
+ // Stand-ins for the UI library components. Like the real Mantine, Ariakit
+ // and ShadCN toolbar buttons, this one uses `label` as its `aria-label`.
+ const components = {
+ Comments: {
+ Comment: ({ actions }: { actions?: ReactNode }) =>