diff --git a/apps/web/src/components/chat/ThreadLineageWorkflowRow.tsx b/apps/web/src/components/chat/ThreadLineageWorkflowRow.tsx index 227aa4b95d1c9..d2e4934380e73 100644 --- a/apps/web/src/components/chat/ThreadLineageWorkflowRow.tsx +++ b/apps/web/src/components/chat/ThreadLineageWorkflowRow.tsx @@ -90,8 +90,8 @@ function WorkflowMemberRow({ render={ onOpen(threadId, intent)) : {})} /> } diff --git a/apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx b/apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx index 7e0b18969c252..69f9a8f935d27 100644 --- a/apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx +++ b/apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx @@ -483,6 +483,133 @@ it("explains why Merge back is unavailable before the fork completes a run", asy expect(screen.router?.state.location.pathname).toBe("/environment/fork"); }); +it("shows a non-openable workflow member's hover card on hover and keyboard focus without opening on activation", async () => { + setup(); + const now = DateTime.makeUnsafe("2026-10-31T20:00:00.000Z"); + const workflowThreadId = ThreadId.make("workflow-thread"); + const openableThreadId = ThreadId.make("workflow-member-thread"); + state.relatedShells = [ + { + ...(state.projection as { thread: Record }).thread, + id: workflowThreadId, + title: "Review workflow", + lineage: { + parentThreadId: threadId, + rootThreadId: threadId, + relationshipToParent: "subagent", + sideChat: false, + }, + }, + ]; + state.projection = { + ...(state.projection as Record), + subagents: [ + { + id: NodeId.make("workflow-parent"), + threadId, + runId: null, + parentNodeId: NodeId.make("parent"), + origin: "provider_native", + createdBy: "agent", + driver: "claudeAgent", + providerInstanceId: "provider", + providerThreadId: null, + childThreadId: workflowThreadId, + nativeTaskRef: null, + prompt: "Run review workflow", + title: "Review workflow", + model: null, + status: "running", + result: null, + startedAt: now, + completedAt: null, + updatedAt: now, + workflow: { + name: "Review workflow", + phases: [{ index: 0, title: "Audit" }], + agents: [ + { + index: 0, + label: "Security auditor", + state: "completed", + phaseIndex: 0, + phaseTitle: "Audit", + model: "claude-sonnet-4-6", + result: "No security issues found in parser", + startedAt: 1793476800000, + completedAt: 1793476812000, + }, + { + index: 1, + label: "Test runner", + childThreadId: openableThreadId, + state: "running", + phaseIndex: 0, + phaseTitle: "Audit", + model: "claude-sonnet-4-6", + startedAt: 1793476800000, + }, + ], + }, + }, + ], + }; + await using screen = await render( +
+ +
, + { router: "/environment/fork" }, + ); + + await screen.getByRole("button", { name: "Expand Review workflow" }).click(); + + const nonOpenable = screen.getByRole("button", { name: "Security auditor" }); + expect(nonOpenable.element().getAttribute("aria-disabled")).toBe("true"); + expect(nonOpenable.element().hasAttribute("disabled")).toBe(false); + + await userEvent.hover(nonOpenable); + await vi.waitFor(() => + expect(document.querySelector('[data-slot="tooltip-popup"]')?.textContent).toContain( + "No security issues found in parser", + ), + ); + + const phaseHeader = screen.getByRole("button", { name: /Collapse Audit phase/ }); + await userEvent.hover(phaseHeader); + await vi.waitFor(() => expect(document.querySelector('[data-slot="tooltip-popup"]')).toBeNull()); + + (phaseHeader.element() as HTMLElement).focus(); + await userEvent.tab(); + expect(document.activeElement).toBe(nonOpenable.element()); + await vi.waitFor(() => + expect(document.querySelector('[data-slot="tooltip-popup"]')?.textContent).toContain( + "No security issues found in parser", + ), + ); + + await userEvent.keyboard("{Enter}"); + await userEvent.keyboard(" "); + await nonOpenable.click({ force: true }); + const parentRef = scopeThreadRef(environmentId, threadId); + const panel = () => + selectThreadRightPanelState(useRightPanelStore.getState().byThreadKey, parentRef); + expect(screen.router?.state.location.pathname).toBe("/environment/fork"); + expect(panel().surfaces).toEqual([]); + + const openable = screen.getByRole("button", { name: "Open Test runner chat" }); + expect(openable.element().getAttribute("aria-disabled")).toBeNull(); + await openable.click(); + expect(panel()).toMatchObject({ + isOpen: true, + surfaces: [{ kind: "thread", threadId: openableThreadId }], + }); +}); + it("shows a delegated-from thread's full title in its tooltip even when its environment is unavailable", async () => { setup(); const longTitle = "Parent task delegated from another machine that has a long description";