Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/web/src/components/chat/ThreadLineageWorkflowRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ function WorkflowMemberRow({
render={
<ThreadDetailsControl
part="row"
aria-label={gt("Open {title} chat", { title: member.title })}
disabled={!canOpen}
aria-label={canOpen ? gt("Open {title} chat", { title: member.title }) : member.title}
aria-disabled={!canOpen || undefined}
{...(canOpen ? trigger((intent) => onOpen(threadId, intent)) : {})}
/>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, unknown> }).thread,
id: workflowThreadId,
title: "Review workflow",
lineage: {
parentThreadId: threadId,
rootThreadId: threadId,
relationshipToParent: "subagent",
sideChat: false,
},
},
];
state.projection = {
...(state.projection as Record<string, unknown>),
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(
<div style={{ width: 320 }}>
<ThreadRelationshipsPanel
environmentId={environmentId}
threadId={threadId}
showLineage
showSideChats={false}
/>
</div>,
{ 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";
Expand Down
Loading