Skip to content

The open-source app everyone uses to manage agents at work

fix(ui): make feed cards fully clickable (#13294)

Dotta30aa3740baba
diff --git a/ui/src/components/FeedCard.test.tsx b/ui/src/components/FeedCard.test.tsx
new file mode 100644
index 0000000000..a63418a835
--- /dev/null
+++ b/ui/src/components/FeedCard.test.tsx
@@ -0,0 +1,73 @@
+// @vitest-environment jsdom
+
+import { act } from "react";
+import { createRoot } from "react-dom/client";
+import type { ActivityEvent } from "@paperclipai/shared";
+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
+import { FeedCard } from "./FeedCard";
+
+const navigate = vi.fn();
+
+vi.mock("@/lib/router", () => ({
+ Link: ({ children, issueQuicklookSide: _, to, ...props }: React.ComponentProps<"a"> & { issueQuicklookSide?: string; to: string }) => (
+ <a {...props} href={to} onClick={navigate}>
+ {children}
+ </a>
+ ),
+}));
+
+const event: ActivityEvent = {
+ id: "event-1",
+ companyId: "company-1",
+ actorType: "user",
+ actorId: "user-1",
+ action: "issue.updated",
+ entityType: "issue",
+ entityId: "issue-1",
+ agentId: null,
+ runId: null,
+ details: null,
+ createdAt: new Date("2026-09-11T12:00:00.000Z"),
+};
+
+describe("FeedCard", () => {
+ let container: HTMLDivElement;
+
+ beforeEach(() => {
+ container = document.createElement("div");
+ document.body.appendChild(container);
+ navigate.mockClear();
+ });
+
+ afterEach(() => {
+ container.remove();
+ });
+
+ it("uses the whole visible card as the entity link", () => {
+ const root = createRoot(container);
+ act(() => {
+ root.render(
+ <FeedCard
+ event={event}
+ agentMap={new Map()}
+ entityNameMap={new Map([["issue:issue-1", "PAP-1"]])}
+ entityTitleMap={new Map([["issue:issue-1", "Clickable card"]])}
+ />,
+ );
+ });
+
+ const link = container.querySelector<HTMLAnchorElement>('[data-fc="link"]');
+ const card = container.querySelector<HTMLElement>('[data-fc="card"]');
+
+ expect(link).not.toBeNull();
+ expect(link?.className).toContain("w-full");
+ expect(card?.className).toContain("w-(--sz-calc-1)");
+ expect(card?.className).toContain("md:w-(--sz-calc-2)");
+ expect(link?.contains(card ?? null)).toBe(true);
+
+ card?.click();
+ expect(navigate).toHaveBeenCalledOnce();
+
+ act(() => root.unmount());
+ });
+});
diff --git a/ui/src/components/FeedCard.tsx b/ui/src/components/FeedCard.tsx
index 614f299b34..e88c0bb9c7 100644
--- a/ui/src/components/FeedCard.tsx
+++ b/ui/src/components/FeedCard.tsx
@@ -437,7 +437,7 @@ export function FeedCard({
<Card
data-fc="card"
className={cn(
- "flex-row group ml-3 mr-3 md:ml-0 my-2 items-center gap-2 p-(--sz-18px) text-xs",
+ "flex-row group ml-3 mr-3 md:ml-0 my-2 w-(--sz-calc-1) md:w-(--sz-calc-2) items-center gap-2 p-(--sz-18px) text-xs",
"transition-(--tp-background-color-border-color) duration-150",
content.link && "cursor-pointer hover:bg-accent hover:border-muted-foreground/30",
className,
@@ -480,7 +480,8 @@ export function FeedCard({
return (
<Link
to={content.link}
- className="block no-underline text-inherit"
+ data-fc="link"
+ className="block w-full no-underline text-inherit"
issueQuicklookSide="left"
>
{card}