Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
fix(views): give the issue views' icon-only Mark done, Archive, Pin and Add issue buttons accessible names (#10167)
Jiayuan Zhang6eea1426b9c6
diff --git a/packages/views/issues/components/issue-detail.test.tsx b/packages/views/issues/components/issue-detail.test.tsxindex 3334357369..15de96e45d 100644--- a/packages/views/issues/components/issue-detail.test.tsx+++ b/packages/views/issues/components/issue-detail.test.tsx@@ -352,6 +352,7 @@ const mockApiObj = vi.hoisted(() => ({listRuntimes: vi.fn().mockResolvedValue([]),getProject: vi.fn(),listProjects: vi.fn().mockResolvedValue({ projects: [] }),+ listPins: vi.fn().mockResolvedValue([]),}));vi.mock("@multica/core/api", () => ({@@ -732,6 +733,7 @@ describe("IssueDetail (shared)", () => {mockViewport.isMobile = false;// Default: issue loads successfullymockApiObj.getIssue.mockResolvedValue(mockIssue);+ mockApiObj.listPins.mockResolvedValue([]);// /timeline returns the entries flat in chronological order (oldest first).mockApiObj.listTimeline.mockResolvedValue(mockTimeline);mockApiObj.listIssueReactions.mockResolvedValue([]);@@ -1294,6 +1296,65 @@ describe("IssueDetail (shared)", () => {expect(screen.getByRole("link", { name: mockIssue.identifier })).toBeInTheDocument();});+ describe("header icon buttons", () => {+ function renderWithDone() {+ const queryClient = createTestQueryClient();+ return render(+ <I18nProvider locale="en" resources={TEST_RESOURCES}>+ <QueryClientProvider client={queryClient}>+ <IssueDetail issueId="issue-1" onDone={() => {}} />+ </QueryClientProvider>+ </I18nProvider>,+ );+ }++ it("names Mark as done and Pin after their tooltips on an open issue", async () => {+ renderWithDone();++ expect(+ await screen.findByRole("button", { name: enIssues.detail.mark_done_tooltip }),+ ).toBeInTheDocument();+ expect(screen.getByRole("button", { name: enIssues.detail.pin_tooltip })).toBeInTheDocument();+ expect(+ screen.queryByRole("button", { name: enIssues.detail.archive_tooltip }),+ ).not.toBeInTheDocument();+ });++ it("names Archive after its tooltip once the issue is done", async () => {+ mockApiObj.getIssue.mockResolvedValue({ ...mockIssue, status: "done" });+ renderWithDone();++ expect(+ await screen.findByRole("button", { name: enIssues.detail.archive_tooltip }),+ ).toBeInTheDocument();+ expect(+ screen.queryByRole("button", { name: enIssues.detail.mark_done_tooltip }),+ ).not.toBeInTheDocument();+ });++ it("names the pin toggle Unpin while the issue is pinned", async () => {+ mockApiObj.listPins.mockResolvedValue([+ {+ id: "pin-1",+ workspace_id: "ws-1",+ user_id: "user-1",+ item_type: "issue",+ item_id: "issue-1",+ position: 0,+ created_at: "2026-01-15T00:00:00Z",+ },+ ]);+ renderIssueDetail();++ expect(+ await screen.findByRole("button", { name: enIssues.detail.unpin_tooltip }),+ ).toBeInTheDocument();+ expect(+ screen.queryByRole("button", { name: enIssues.detail.pin_tooltip }),+ ).not.toBeInTheDocument();+ });+ });+it("pins the comment composer to the scroll viewport on a wide screen", async () => {const { container } = renderIssueDetail();diff --git a/packages/views/issues/components/issue-detail.tsx b/packages/views/issues/components/issue-detail.tsxindex 67dc52b1ee..dccdce64a0 100644--- a/packages/views/issues/components/issue-detail.tsx+++ b/packages/views/issues/components/issue-detail.tsx@@ -3356,54 +3356,33 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr<IssueAgentHeaderChip issueId={id} onJumpToRun={jumpToRun} /><IssueWakeupHeaderChip issueId={id} onOpen={openWakeups} />{onDone && !issueBehavesAsAny(issue, ["done", "closed"]) && (- <Tooltip>- <TooltipTrigger- render={- <Button- variant="ghost"- size="icon-sm"- className="text-muted-foreground"- onClick={() => { handleUpdateField({ status: "done" }); onDone?.(); }}- >- <CircleCheck />- </Button>- }- />- <TooltipContent side="bottom">{t(($) => $.detail.mark_done_tooltip)}</TooltipContent>- </Tooltip>+ <IconButton+ label={t(($) => $.detail.mark_done_tooltip)}+ tooltipSide="bottom"+ className="text-muted-foreground"+ onClick={() => { handleUpdateField({ status: "done" }); onDone?.(); }}+ >+ <CircleCheck />+ </IconButton>)}{onDone && issueBehavesAs(issue, "done") && (- <Tooltip>- <TooltipTrigger- render={- <Button- variant="ghost"- size="icon-sm"- className="text-muted-foreground"- onClick={() => { onDone(); }}- >- <Archive />- </Button>- }- />- <TooltipContent side="bottom">{t(($) => $.detail.archive_tooltip)}</TooltipContent>- </Tooltip>+ <IconButton+ label={t(($) => $.detail.archive_tooltip)}+ tooltipSide="bottom"+ className="text-muted-foreground"+ onClick={() => { onDone(); }}+ >+ <Archive />+ </IconButton>)}- <Tooltip>- <TooltipTrigger- render={- <Button- variant="ghost"- size="icon-sm"- className={cn("text-muted-foreground", actions.isPinned && "text-foreground")}- onClick={actions.togglePin}- >- {actions.isPinned ? <PinOff /> : <Pin />}- </Button>- }- />- <TooltipContent side="bottom">{actions.isPinned ? t(($) => $.detail.unpin_tooltip) : t(($) => $.detail.pin_tooltip)}</TooltipContent>- </Tooltip>+ <IconButton+ label={actions.isPinned ? t(($) => $.detail.unpin_tooltip) : t(($) => $.detail.pin_tooltip)}+ tooltipSide="bottom"+ className={cn("text-muted-foreground", actions.isPinned && "text-foreground")}+ onClick={actions.togglePin}+ >+ {actions.isPinned ? <PinOff /> : <Pin />}+ </IconButton><IssueActionsDropdownissue={issue}align="end"diff --git a/packages/views/issues/components/list-view.test.tsx b/packages/views/issues/components/list-view.test.tsxindex 0cb97f39b2..98ef8035d5 100644--- a/packages/views/issues/components/list-view.test.tsx+++ b/packages/views/issues/components/list-view.test.tsx@@ -9,6 +9,7 @@ import { ListView } from "./list-view";import { IssueContextMenuProvider } from "../actions";import { ScrollRestorationProvider, type ScrollRestorationAdapter } from "../../platform";import type { IssueStatusPagination } from "../surface/use-issue-status-branches";+import type { IssueCreateDefaults } from "../surface/types";import enCommon from "../../locales/en/common.json";import enIssues from "../../locales/en/issues.json";@@ -213,6 +214,7 @@ function renderListView(onMoveIssue = vi.fn(),statuses: IssueStatusEntry[] = [],scrollAdapter: ScrollRestorationAdapter = { get: () => undefined },+ onCreateIssue?: (defaults: IssueCreateDefaults) => void,) {const queryClient = new QueryClient({defaultOptions: { queries: { retry: false, gcTime: 0 } },@@ -228,6 +230,7 @@ function renderListView(visibleStatuses={visibleStatuses}statusPagination={PAGINATION}onMoveIssue={onMoveIssue}+ onCreateIssue={onCreateIssue}/></ScrollRestorationProvider></IssueContextMenuProvider>@@ -333,6 +336,16 @@ describe("ListView status header collapse", () => {expect(mockViewState.listCollapsedStatuses).toEqual(["todo"]);});++ it("names the header's add issue button after its tooltip", async () => {+ const user = userEvent.setup();+ const onCreateIssue = vi.fn();+ renderListView(ISSUES, ["todo"], vi.fn(), [], { get: () => undefined }, onCreateIssue);++ await user.click(screen.getByRole("button", { name: enIssues.list.add_issue_tooltip }));++ expect(onCreateIssue).toHaveBeenCalledWith({ status: "todo" });+ });});// Custom statuses remain visible in independent sections.diff --git a/packages/views/issues/components/list-view.tsx b/packages/views/issues/components/list-view.tsxindex 949b9f934c..a90753ead7 100644--- a/packages/views/issues/components/list-view.tsx+++ b/packages/views/issues/components/list-view.tsx@@ -513,6 +513,7 @@ function StatusAccordionItem({const isOver = droppableIsOver && !statusCatalog.entryOf(status)?.archived_at;const disableSorting = !!sortLabel;+ const addIssueLabel = t(($) => $.list.add_issue_tooltip);// The infinite-scroll sentinel rides Virtuoso's Footer so it sits at the true// end of the virtualized rows and still fires loadMore when scrolled to it.@@ -626,12 +627,13 @@ function StatusAccordionItem({<div className="pr-2">{/* Lazy-mounted tooltip machinery — see DeferredTooltip. */}<DeferredTooltip- content={t(($) => $.list.add_issue_tooltip)}+ content={addIssueLabel}trigger={<Buttonvariant="ghost"size="icon-sm"className="text-muted-foreground opacity-0 group-hover/header:opacity-100 transition-opacity"+ aria-label={addIssueLabel}onClick={() => {const defaults = {status: status,