Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: add accessible names to icon-only buttons (#11448)

Kiran Gadhave6cb953fc47de
diff --git a/frontend/src/components/app-config/ai-config.tsx b/frontend/src/components/app-config/ai-config.tsx
index 56240a1bc5..aff60268f7 100644
--- a/frontend/src/components/app-config/ai-config.tsx
+++ b/frontend/src/components/app-config/ai-config.tsx
@@ -502,6 +502,7 @@ const ModelListItem: React.FC<ModelListItemProps> = ({
<ModelInfoCard model={model} />
{model.custom && (
<Button
+ aria-label={`Delete model ${model.name}`}
variant="ghost"
size="icon"
onClick={handleDelete}
diff --git a/frontend/src/components/chat/chat-components.tsx b/frontend/src/components/chat/chat-components.tsx
index 965f6608e9..4087b52236 100644
--- a/frontend/src/components/chat/chat-components.tsx
+++ b/frontend/src/components/chat/chat-components.tsx
@@ -124,6 +124,7 @@ export const AddContextButton = ({
return (
<Tooltip content="Add context">
<Button
+ aria-label="Add context"
variant="text"
size="icon"
onClick={handleAddContext}
@@ -148,6 +149,7 @@ export const AttachFileButton = ({
<>
<Tooltip content="Attach a file">
<Button
+ aria-label="Attach a file"
variant="text"
size="icon"
onClick={() => fileInputRef.current?.click()}
diff --git a/frontend/src/components/chat/chat-panel.tsx b/frontend/src/components/chat/chat-panel.tsx
index 45b7ae2d1d..39d74eda28 100644
--- a/frontend/src/components/chat/chat-panel.tsx
+++ b/frontend/src/components/chat/chat-panel.tsx
@@ -166,7 +166,12 @@ const ChatHeader: React.FC<ChatHeaderProps> = ({
return (
<div className="flex border-b px-2 py-1 justify-between shrink-0 items-center">
<Tooltip content="New chat">
- <Button variant="text" size="icon" onClick={onNewChat}>
+ <Button
+ aria-label="New chat"
+ variant="text"
+ size="icon"
+ onClick={onNewChat}
+ >
<PlusIcon className="h-4 w-4" />
</Button>
</Tooltip>
diff --git a/frontend/src/components/data-table/__tests__/column-explorer.test.tsx b/frontend/src/components/data-table/__tests__/column-explorer.test.tsx
index 3adda65d73..6089c05cb0 100644
--- a/frontend/src/components/data-table/__tests__/column-explorer.test.tsx
+++ b/frontend/src/components/data-table/__tests__/column-explorer.test.tsx
@@ -8,6 +8,7 @@ import {
import { fireEvent, render, screen, within } from "@testing-library/react";
import { beforeAll, describe, expect, it, vi } from "vitest";
import { TooltipProvider } from "@/components/ui/tooltip";
+import type { PreviewColumn } from "@/plugins/impl/DataTablePlugin";
import { ColumnExplorerPanel } from "../column-explorer-panel/column-explorer";
import type { FieldTypesWithExternalType } from "../types";
@@ -36,11 +37,13 @@ const TEST_COLUMNS: ColumnDef<Row>[] = [
interface HarnessProps {
totalColumns?: number;
initiallyHidden?: readonly string[];
+ previewColumn?: PreviewColumn;
}
function PanelHarness({
totalColumns = 3,
initiallyHidden = EMPTY_HIDDEN_COLUMNS,
+ previewColumn = vi.fn().mockResolvedValue({}),
}: HarnessProps) {
const table = useReactTable<Row>({
data: [],
@@ -55,7 +58,7 @@ function PanelHarness({
});
return (
<ColumnExplorerPanel
- previewColumn={vi.fn().mockResolvedValue({})}
+ previewColumn={previewColumn}
fieldTypes={FIELD_TYPES}
totalRows={3}
totalColumns={totalColumns}
@@ -124,6 +127,29 @@ describe("ColumnExplorerPanel search", () => {
});
});
+describe("ColumnExplorerPanel chart actions", () => {
+ it("names chart actions for each expanded column", async () => {
+ const previewColumn = vi.fn<PreviewColumn>().mockResolvedValue({
+ chart_code: "chart_code",
+ chart_spec: null,
+ error: null,
+ missing_packages: null,
+ stats: null,
+ });
+ renderPanel({ previewColumn });
+ fireEvent.click(screen.getByText("cust_age"));
+
+ for (const column of ["customer_name", "cust_age"]) {
+ expect(
+ await screen.findByRole("button", {
+ name: `Add chart to notebook for ${column}`,
+ }),
+ ).toBeInTheDocument();
+ expect(previewColumn).toHaveBeenCalledWith({ column });
+ }
+ });
+});
+
describe("ColumnExplorerPanel header counts", () => {
it("uses rendered-subset total when a clipped column is hidden", () => {
// Dataset has 100 columns server-side; only 3 are rendered into the
diff --git a/frontend/src/components/data-table/column-explorer-panel/column-explorer.tsx b/frontend/src/components/data-table/column-explorer-panel/column-explorer.tsx
index ec918d6d32..1fecd54856 100644
--- a/frontend/src/components/data-table/column-explorer-panel/column-explorer.tsx
+++ b/frontend/src/components/data-table/column-explorer-panel/column-explorer.tsx
@@ -345,7 +345,7 @@ const ColumnPreview = ({
const chart = chart_spec && renderChart(chart_spec, theme);
const addDataframeChart = chart_code && (
- <AddDataframeChart chartCode={chart_code} />
+ <AddDataframeChart chartCode={chart_code} columnName={columnName} />
);
return (
diff --git a/frontend/src/components/datasources/__tests__/column-actions.test.tsx b/frontend/src/components/datasources/__tests__/column-actions.test.tsx
new file mode 100644
index 0000000000..1db2737aa1
--- /dev/null
+++ b/frontend/src/components/datasources/__tests__/column-actions.test.tsx
@@ -0,0 +1,97 @@
+/* Copyright 2026 Marimo. All rights reserved. */
+
+import {
+ fireEvent,
+ render,
+ screen,
+ waitFor,
+ within,
+} from "@testing-library/react";
+import { createStore, Provider } from "jotai";
+import { beforeAll, describe, expect, it, vi } from "vitest";
+import { MockRequestClient } from "@/__mocks__/requests";
+import { Command, CommandList } from "@/components/ui/command";
+import { TooltipProvider } from "@/components/ui/tooltip";
+import type { DataTable } from "@/core/kernel/messages";
+import { requestClientAtom } from "@/core/network/requests";
+import { copyToClipboard } from "@/utils/copy";
+import { TableList } from "../datasources";
+
+vi.mock("@/utils/copy", () => ({
+ copyToClipboard: vi.fn().mockResolvedValue(undefined),
+}));
+
+beforeAll(() => {
+ HTMLElement.prototype.scrollIntoView = vi.fn();
+});
+
+const table: DataTable = {
+ name: "users",
+ columns: [
+ {
+ name: "email",
+ type: "string",
+ external_type: "VARCHAR",
+ sample_values: [],
+ },
+ {
+ name: "name",
+ type: "string",
+ external_type: "VARCHAR",
+ sample_values: [],
+ },
+ ],
+ source: "memory",
+ source_type: "local",
+ type: "table",
+ engine: null,
+ indexes: null,
+ num_columns: 2,
+ num_rows: null,
+ variable_name: null,
+ primary_keys: null,
+};
+
+describe("Column actions", () => {
+ it("copies each column through one named button without expanding its preview", async () => {
+ const store = createStore();
+ const client = MockRequestClient.create();
+ store.set(requestClientAtom, client);
+ render(
+ <Provider store={store}>
+ <TooltipProvider>
+ <Command>
+ <CommandList>
+ <TableList tables={[table]} />
+ </CommandList>
+ </Command>
+ </TooltipProvider>
+ </Provider>,
+ );
+
+ fireEvent.click(await screen.findByText("users"));
+
+ for (const column of table.columns) {
+ const copyButton = await screen.findByRole("button", {
+ name: `Copy column name ${column.name}`,
+ });
+ const row = screen.getByRole("option", {
+ name: `${column.name} ${column.external_type}`,
+ });
+ expect(within(row).getAllByRole("button")).toEqual([copyButton]);
+ expect(copyButton.querySelector("button")).toBeNull();
+
+ fireEvent.focus(copyButton);
+ expect(
+ await screen.findByRole("tooltip", { name: "Copy column name" }),
+ ).toBeInTheDocument();
+
+ fireEvent.click(copyButton);
+ await waitFor(() => {
+ expect(copyToClipboard).toHaveBeenLastCalledWith(column.name);
+ });
+ expect(client.previewDatasetColumn).not.toHaveBeenCalled();
+ }
+ expect(copyToClipboard).toHaveBeenCalledTimes(2);
+ });
+});
diff --git a/frontend/src/components/datasources/__tests__/column-preview.test.tsx b/frontend/src/components/datasources/__tests__/column-preview.test.tsx
index 16d62871c6..c6f0784339 100644
--- a/frontend/src/components/datasources/__tests__/column-preview.test.tsx
+++ b/frontend/src/components/datasources/__tests__/column-preview.test.tsx
@@ -1,16 +1,24 @@
/* Copyright 2026 Marimo. All rights reserved. */
-import { render } from "@testing-library/react";
-import { Provider } from "jotai";
+import { fireEvent, render, screen } from "@testing-library/react";
+import { createStore, Provider } from "jotai";
import type React from "react";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { MockRequestClient } from "@/__mocks__/requests";
+import { TooltipProvider } from "@/components/ui/tooltip";
import type { SQLTableContext } from "@/core/datasets/data-source-connections";
import type { DataTable, DataTableColumn } from "@/core/kernel/messages";
import { requestClientAtom } from "@/core/network/requests";
import { store } from "@/core/state/jotai";
import { DatasetColumnPreview } from "../column-preview";
+const { createNewCell } = vi.hoisted(() => ({ createNewCell: vi.fn() }));
+
+vi.mock("@/core/cells/cells", async (importOriginal) => ({
+ ...(await importOriginal<typeof import("@/core/cells/cells")>()),
+ useCellActions: () => ({ createNewCell }),
+}));
+
const wrapper = ({ children }: { children: React.ReactNode }) => (
<Provider store={store}>{children}</Provider>
);
@@ -95,3 +103,56 @@ describe("DatasetColumnPreview fullyQualifiedTableName", () => {
);
});
});
+
+describe("DatasetColumnPreview chart actions", () => {
+ it("identifies each column and inserts its corresponding chart", () => {
+ const store = createStore();
+ store.set(requestClientAtom, MockRequestClient.create());
+ const columns: DataTableColumn[] = [
+ {
+ name: "email",
+ type: "string",
+ external_type: "str",
+ sample_values: [],
+ },
+ { name: "age", type: "integer", external_type: "int", sample_values: [] },
+ ];
+ render(
+ <Provider store={store}>
+ <TooltipProvider>
+ {columns.map((column) => (
+ <DatasetColumnPreview
+ key={column.name}
+ table={{ ...table, source_type: "local", engine: null }}
+ column={column}
+ onAddColumnChart={vi.fn()}
+ preview={{
+ table_name: table.name,
+ column_name: column.name,
+ chart_code: `chart_${column.name}`,
+ chart_spec: null,
+ error: null,
+ missing_packages: null,
+ stats: {},
+ }}
+ />
+ ))}
+ </TooltipProvider>
+ </Provider>,
+ );
+
+ for (const column of columns) {
+ fireEvent.click(
+ screen.getByRole("button", {
+ name: `Add chart to notebook for ${column.name}`,
+ }),
+ );
+ expect(createNewCell).toHaveBeenLastCalledWith({
+ code: `chart_${column.name}`,
+ before: false,
+ cellId: "__end__",
+ });
+ }
+ expect(createNewCell).toHaveBeenCalledTimes(2);
+ });
+});
diff --git a/frontend/src/components/datasources/column-preview.tsx b/frontend/src/components/datasources/column-preview.tsx
index 34176faf16..d68fd24302 100644
--- a/frontend/src/components/datasources/column-preview.tsx
+++ b/frontend/src/components/datasources/column-preview.tsx
@@ -112,12 +112,16 @@ export const DatasetColumnPreview: React.FC<{
const addDataframeChart = preview.chart_code &&
table.source_type === "local" && (
- <AddDataframeChart chartCode={preview.chart_code} />
+ <AddDataframeChart
+ chartCode={preview.chart_code}
+ columnName={column.name}
+ />
);
const addSQLChart = table.source_type === "duckdb" && (
<Tooltip content="Add SQL cell" delayDuration={400}>
<Button
+ aria-label={`Add SQL cell for ${column.name}`}
variant="outline"
size="icon"
className="z-10 bg-background absolute right-1 -top-1"
@@ -238,7 +242,8 @@ export function renderChart(chartSpec: string, theme: Theme) {
export const AddDataframeChart: React.FC<{
chartCode: string;
-}> = ({ chartCode }) => {
+ columnName: string;
+}> = ({ chartCode, columnName }) => {
const autoInstantiate = useAtomValue(autoInstantiateAtom);
const lastFocusedCellId = useLastFocusedCellId();
const { createNewCell } = useCellActions();
@@ -261,6 +266,7 @@ export const AddDataframeChart: React.FC<{
return (
<Tooltip content="Add chart to notebook" delayDuration={400}>
<Button
+ aria-label={`Add chart to notebook for ${columnName}`}
variant="outline"
size="icon"
className="z-10 bg-background absolute right-1 -top-0.5"
diff --git a/frontend/src/components/datasources/datasources.tsx b/frontend/src/components/datasources/datasources.tsx
index dc6312a6e9..dd41299172 100644
--- a/frontend/src/components/datasources/datasources.tsx
+++ b/frontend/src/components/datasources/datasources.tsx
@@ -13,7 +13,7 @@ import {
VisibilityToggleButton,
} from "@/components/editor/file-tree/tree-actions";
import { CopyClipboardIcon } from "@/components/icons/copy-icon";
-import { Button } from "@/components/ui/button";
+import { Button, buttonVariants } from "@/components/ui/button";
import { Command, CommandInput, CommandItem } from "@/components/ui/command";
import { Tooltip } from "@/components/ui/tooltip";
import { maybeAddMarimoImport } from "@/core/cells/add-missing-import";
@@ -978,6 +978,7 @@ const DatasetTableItem: React.FC<{
{renderRowsByColumns()}
<Tooltip content="Add table to notebook" delayDuration={400}>
<Button
+ aria-label={`Add table ${table.name} to notebook`}
className="group-hover:inline-flex hidden"
variant="text"
size="icon"
@@ -1068,19 +1069,16 @@ const DatasetColumnItem: React.FC<{
{isIndexed &&
renderItemSubtext({ tooltipContent: "Indexed", content: "IDX" })}
</div>
- <Tooltip content="Copy column name" delayDuration={400}>
- <Button
- variant="text"
- size="icon"
- className="group-hover:opacity-100 opacity-0 hover:bg-muted text-muted-foreground hover:text-foreground"
- >
- <CopyClipboardIcon
- tooltip={false}
- value={column.name}
- className="h-3 w-3"
- />
- </Button>
- </Tooltip>
+ <CopyClipboardIcon
+ tooltip="Copy column name"
+ value={column.name}
+ ariaLabel={`Copy column name ${column.name}`}
+ className="h-3 w-3"
+ buttonClassName={cn(
+ buttonVariants({ variant: "text", size: "icon" }),
+ "group-hover:opacity-100 opacity-0 hover:bg-muted text-muted-foreground hover:text-foreground",
+ )}
+ />
<span className="text-xs text-muted-foreground">
{column.external_type}
</span>
diff --git a/frontend/src/components/debugger/debugger-code.tsx b/frontend/src/components/debugger/debugger-code.tsx
index 4a90864d3d..d6ab1c7c0b 100644
--- a/frontend/src/components/debugger/debugger-code.tsx
+++ b/frontend/src/components/debugger/debugger-code.tsx
@@ -162,6 +162,7 @@ export const DebuggerControls: React.FC<{
<div className="flex">
<Tooltip content="Next line">
<Button
+ aria-label="Next line"
variant="text"
size="icon"
data-testid="debugger-next-button"
@@ -173,6 +174,7 @@ export const DebuggerControls: React.FC<{
</Tooltip>
<Tooltip content="Continue execution">
<Button
+ aria-label="Continue execution"
variant="text"
size="icon"
data-testid="debugger-continue-button"
@@ -187,6 +189,7 @@ export const DebuggerControls: React.FC<{
</Tooltip>
<Tooltip content="Print stack trace">
<Button
+ aria-label="Print stack trace"
variant="text"
size="icon"
data-testid="debugger-stack-button"
@@ -198,6 +201,7 @@ export const DebuggerControls: React.FC<{
</Tooltip>
<Tooltip content="Help">
<Button
+ aria-label="Debugger help"
variant="text"
size="icon"
data-testid="debugger-help-button"
@@ -210,6 +214,7 @@ export const DebuggerControls: React.FC<{
{onClear && (
<Tooltip content="Quit and clear">
<Button
+ aria-label="Quit and clear debugger"
variant="text"
size="icon"
data-testid="debugger-clear-button"
diff --git a/frontend/src/components/dependency-graph/panels.tsx b/frontend/src/components/dependency-graph/panels.tsx
index fca2295fb7..6a543953cb 100644
--- a/frontend/src/components/dependency-graph/panels.tsx
+++ b/frontend/src/components/dependency-graph/panels.tsx
@@ -216,11 +216,12 @@ export const GraphSelectionPanel: React.FC<{
</Button>
</Tooltip>
<ConnectionCellActionsDropdown cellId={selection.id}>
- <Button variant="ghost" size="icon">
+ <Button aria-label="Cell actions" variant="ghost" size="icon">
<MoreVerticalIcon className="w-4 h-4" />
</Button>
</ConnectionCellActionsDropdown>
<Button
+ aria-label="Close cell details"
variant="text"
size="icon"
onClick={() => {
diff --git a/frontend/src/components/editor/ai/ai-completion-editor.tsx b/frontend/src/components/editor/ai/ai-completion-editor.tsx
index 313a8f6453..41e7ecf815 100644
--- a/frontend/src/components/editor/ai/ai-completion-editor.tsx
+++ b/frontend/src/components/editor/ai/ai-completion-editor.tsx
@@ -408,6 +408,7 @@ export const AiCompletionEditor: React.FC<Props> = ({
</div>
</Tooltip>
<Button
+ aria-label="Discard AI completion"
data-testid="decline-completion-button"
variant="text"
size="icon"
diff --git a/frontend/src/components/editor/alerts/startup-logs-alert.tsx b/frontend/src/components/editor/alerts/startup-logs-alert.tsx
index 0ab019633f..46f776af7c 100644
--- a/frontend/src/components/editor/alerts/startup-logs-alert.tsx
+++ b/frontend/src/components/editor/alerts/startup-logs-alert.tsx
@@ -51,6 +51,7 @@ export const StartupLogsAlert: React.FC = () => {
{isRunning ? "Initializing..." : "Initialized"}
</span>
<Button
+ aria-label="Dismiss startup logs"
variant="text"
data-testid="remove-startup-logs-button"
size="icon"
diff --git a/frontend/src/components/editor/cell/DeleteButton.tsx b/frontend/src/components/editor/cell/DeleteButton.tsx
index b6c3412339..4950702159 100644
--- a/frontend/src/components/editor/cell/DeleteButton.tsx
+++ b/frontend/src/components/editor/cell/DeleteButton.tsx
@@ -37,6 +37,7 @@ export const DeleteButton = (props: {
return (
<Tooltip content={tooltipMsg} usePortal={false}>
<Button
+ aria-label="Delete cell"
variant="ghost"
size="icon"
onClick={onClick}
diff --git a/frontend/src/components/editor/chrome/panels/cache-panel.tsx b/frontend/src/components/editor/chrome/panels/cache-panel.tsx
index 90b70ced4e..cccd7f924e 100644
--- a/frontend/src/components/editor/chrome/panels/cache-panel.tsx
+++ b/frontend/src/components/editor/chrome/panels/cache-panel.tsx
@@ -104,6 +104,7 @@ const CachePanel = () => {
{/* Header with Refresh Button */}
<div className="flex items-center justify-end">
<Button
+ aria-label="Refresh cache"
variant="ghost"
size="icon"
className="h-6 w-6"
diff --git a/frontend/src/components/editor/chrome/wrapper/__tests__/pending-ai-cells.test.tsx b/frontend/src/components/editor/chrome/wrapper/__tests__/pending-ai-cells.test.tsx
index 55ab71ee25..ca7f46a822 100644
--- a/frontend/src/components/editor/chrome/wrapper/__tests__/pending-ai-cells.test.tsx
+++ b/frontend/src/components/editor/chrome/wrapper/__tests__/pending-ai-cells.test.tsx
@@ -1,11 +1,12 @@
/* Copyright 2026 Marimo. All rights reserved. */
-import { act, render, screen, within } from "@testing-library/react";
+import { act, fireEvent, render, screen, within } from "@testing-library/react";
import { createStore, Provider } from "jotai";
import { describe, expect, it, vi } from "vitest";
import { cellId } from "@/__tests__/branded";
import { TooltipProvider } from "@/components/ui/tooltip";
import { stagedAICellsAtom, visibleForTesting } from "@/core/ai/staged-cells";
+import { scrollAndHighlightCell } from "../../../links/cell-link";
import { PendingAICells } from "../pending-ai-cells";
vi.mock("@/components/editor/cell/useDeleteCell", () => ({
@@ -29,6 +30,62 @@ vi.mock("@/components/editor/links/cell-link", () => ({
}));
describe("PendingAICells", () => {
+ it("navigates between pending cells through named controls", () => {
+ const store = createStore();
+ const first = cellId("first-pending-cell");
+ const second = cellId("second-pending-cell");
+ const third = cellId("third-pending-cell");
+ store.set(
+ stagedAICellsAtom,
+ new Map([
+ [first, { type: "add_cell" }],
+ [second, { type: "add_cell" }],
+ [third, { type: "add_cell" }],
+ ]),
+ );
+
+ render(
+ <Provider store={store}>
+ <TooltipProvider>
+ <PendingAICells />
+ </TooltipProvider>
+ </Provider>,
+ );
+
+ const next = screen.getByRole("button", { name: "Next pending AI cell" });
+ const previous = screen.getByRole("button", {
+ name: "Previous pending AI cell",
+ });
+
+ fireEvent.click(next);
+ expect(scrollAndHighlightCell).toHaveBeenLastCalledWith(first, "focus");
+ expect(screen.getByText("1 / 3")).toBeInTheDocument();
+
+ fireEvent.click(next);
+ expect(scrollAndHighlightCell).toHaveBeenLastCalledWith(second, "focus");
+ expect(screen.getByText("2 / 3")).toBeInTheDocument();
+
+ fireEvent.click(previous);
+ expect(scrollAndHighlightCell).toHaveBeenLastCalledWith(first, "focus");
+ expect(screen.getByText("1 / 3")).toBeInTheDocument();
+
+ fireEvent.click(next);
+ expect(scrollAndHighlightCell).toHaveBeenLastCalledWith(second, "focus");
+ expect(screen.getByText("2 / 3")).toBeInTheDocument();
+
+ fireEvent.click(next);
+ expect(scrollAndHighlightCell).toHaveBeenLastCalledWith(third, "focus");
+ expect(screen.getByText("3 / 3")).toBeInTheDocument();
+
+ fireEvent.click(next);
+ expect(scrollAndHighlightCell).toHaveBeenLastCalledWith(first, "focus");
+ expect(screen.getByText("1 / 3")).toBeInTheDocument();
+
+ fireEvent.click(previous);
+ expect(scrollAndHighlightCell).toHaveBeenLastCalledWith(third, "focus");
+ expect(screen.getByText("3 / 3")).toBeInTheDocument();
+ });
+
it("disables bulk actions while cells are still generating", () => {
const store = createStore();
const generationId = Symbol("staged-cell-generation");
diff --git a/frontend/src/components/editor/chrome/wrapper/pending-ai-cells.tsx b/frontend/src/components/editor/chrome/wrapper/pending-ai-cells.tsx
index ecca98b97a..ce73ce3981 100644
--- a/frontend/src/components/editor/chrome/wrapper/pending-ai-cells.tsx
+++ b/frontend/src/components/editor/chrome/wrapper/pending-ai-cells.tsx
@@ -79,7 +79,12 @@ export const PendingAICells: React.FC = () => {
<SparklesIcon className="h-4 w-4 text-primary" />
<div className="flex items-center">
- <Button variant="ghost" size="icon" onClick={() => clickNext("up")}>
+ <Button
+ aria-label="Previous pending AI cell"
+ variant="ghost"
+ size="icon"
+ onClick={() => clickNext("down")}
+ >
<ChevronUp className="h-3.5 w-3.5" />
</Button>
<span className="text-xs font-mono min-w-14 text-center">
@@ -87,7 +92,12 @@ export const PendingAICells: React.FC = () => {
? `${listStagedCells.length} pending`
: `${currentIndex + 1} / ${listStagedCells.length}`}
</span>
- <Button variant="ghost" size="icon" onClick={() => clickNext("down")}>
+ <Button
+ aria-label="Next pending AI cell"
+ variant="ghost"
+ size="icon"
+ onClick={() => clickNext("up")}
+ >
<ChevronDown className="h-3.5 w-3.5" />
</Button>
</div>
diff --git a/frontend/src/components/editor/notebook-banner.tsx b/frontend/src/components/editor/notebook-banner.tsx
index 7d07382193..6d83ec4568 100644
--- a/frontend/src/components/editor/notebook-banner.tsx
+++ b/frontend/src/components/editor/notebook-banner.tsx
@@ -41,6 +41,7 @@ export const NotebookBanner: React.FC<Props> = ({ width }) => {
{banner.title}
</span>
<Button
+ aria-label={`Dismiss ${banner.title}`}
data-testid="remove-banner-button"
variant="text"
size="icon"
diff --git a/frontend/src/components/editor/package-alert.tsx b/frontend/src/components/editor/package-alert.tsx
index f2b9f8983c..bd447ba408 100644
--- a/frontend/src/components/editor/package-alert.tsx
+++ b/frontend/src/components/editor/package-alert.tsx
@@ -158,6 +158,7 @@ export const PackageAlert: React.FC = () => {
<SourceBadge source={packageAlert.source} />
</span>
<Button
+ aria-label="Dismiss missing packages alert"
variant="text"
data-testid="remove-banner-button"
size="icon"
@@ -270,6 +271,7 @@ export const PackageAlert: React.FC = () => {
<SourceBadge source={packageAlert.source} />
</span>
<Button
+ aria-label={`Dismiss ${title}`}
variant="text"
data-testid="remove-banner-button"
size="icon"
diff --git a/frontend/src/components/editor/renderers/vertical-layout/sidebar/toggle.tsx b/frontend/src/components/editor/renderers/vertical-layout/sidebar/toggle.tsx
index 7bd6d0d6c4..500dab4931 100644
--- a/frontend/src/components/editor/renderers/vertical-layout/sidebar/toggle.tsx
+++ b/frontend/src/components/editor/renderers/vertical-layout/sidebar/toggle.tsx
@@ -12,7 +12,13 @@ interface SidebarToggleProps {
export const SidebarToggle = ({ isOpen, toggle }: SidebarToggleProps) => {
return (
<div className="invisible lg:visible absolute top-[12px] right-[16px] z-20">
- <Button onClick={toggle} className="w-10 h-8" variant="ghost" size="icon">
+ <Button
+ aria-label={isOpen ? "Collapse sidebar" : "Expand sidebar"}
+ onClick={toggle}
+ className="w-10 h-8"
+ variant="ghost"
+ size="icon"
+ >
<ChevronLeft
className={cn(
"h-5 w-5 transition-transform ease-in-out duration-700",
diff --git a/frontend/src/components/mcp/mcp-status-indicator.tsx b/frontend/src/components/mcp/mcp-status-indicator.tsx
index aa550d264c..b16e5ca0b4 100644
--- a/frontend/src/components/mcp/mcp-status-indicator.tsx
+++ b/frontend/src/components/mcp/mcp-status-indicator.tsx
@@ -41,7 +41,7 @@ export const MCPStatusIndicator: React.FC = () => {
<Popover>
<Tooltip content="MCP Status">
<PopoverTrigger asChild={true}>
- <Button variant="text" size="icon">
+ <Button aria-label="MCP status" variant="text" size="icon">
<PlugIcon
className={cn(
"h-4 w-4",
diff --git a/frontend/src/components/slides/slide-form.tsx b/frontend/src/components/slides/slide-form.tsx
index 26acb5637b..fd8ef14427 100644
--- a/frontend/src/components/slides/slide-form.tsx
+++ b/frontend/src/components/slides/slide-form.tsx
@@ -450,6 +450,7 @@ export const SlideSidebar = ({
)}
<Tooltip content={isConfigOpen ? "Collapse panel" : "Expand panel"}>
<Button
+ aria-label={isConfigOpen ? "Collapse panel" : "Expand panel"}
variant="ghost"
size="icon"
className="h-7 w-7 text-muted-foreground hover:text-foreground"
diff --git a/frontend/src/core/codemirror/language/panel/panel.tsx b/frontend/src/core/codemirror/language/panel/panel.tsx
index 992d1df9ce..3d4f352fd9 100644
--- a/frontend/src/core/codemirror/language/panel/panel.tsx
+++ b/frontend/src/core/codemirror/language/panel/panel.tsx
@@ -101,6 +101,7 @@ export const LanguagePanelComponent: React.FC<{
{metadata.engine === DUCKDB_ENGINE && <SQLModeSelect />}
<Tooltip content="Format SQL">
<Button
+ aria-label="Format SQL"
variant="text"
size="icon"
onClick={async () => {
diff --git a/frontend/src/plugins/impl/RefreshPlugin.tsx b/frontend/src/plugins/impl/RefreshPlugin.tsx
index 9f7051447e..d222f6da86 100644
--- a/frontend/src/plugins/impl/RefreshPlugin.tsx
+++ b/frontend/src/plugins/impl/RefreshPlugin.tsx
@@ -119,6 +119,7 @@ const RefreshComponent = ({ setValue, data }: IPluginProps<Value, Data>) => {
<Labeled label={data.label}>
<span className="inline-flex items-center text-secondary-foreground rounded shadow-sm-solid">
<Button
+ aria-label="Refresh"
data-testid="marimo-plugin-refresh-button"
variant="secondary"
size="icon"
diff --git a/frontend/src/plugins/impl/chat/chat-ui.tsx b/frontend/src/plugins/impl/chat/chat-ui.tsx
index d78b1a689d..d6c27cb603 100644
--- a/frontend/src/plugins/impl/chat/chat-ui.tsx
+++ b/frontend/src/plugins/impl/chat/chat-ui.tsx
@@ -441,6 +441,7 @@ export const Chatbot: React.FC<Props> = (props) => {
>
<div className="absolute top-0 right-0 flex justify-end z-10 border border-(--slate-6) bg-inherit rounded-bl-lg">
<Button
+ aria-label="Reset chat"
variant="text"
size="icon"
disabled={messages.length === 0}
diff --git a/frontend/src/stories/button.stories.tsx b/frontend/src/stories/button.stories.tsx
index 3d5c9a44e2..146e675ea3 100644
--- a/frontend/src/stories/button.stories.tsx
+++ b/frontend/src/stories/button.stories.tsx
@@ -78,6 +78,7 @@ export const Loading = {
export const TrashIcon = {
render: () => (
<Button
+ aria-label="Delete"
variant="ghost"
size="icon"
className="hover:bg-transparent hover:border-input"