From f6958ddb381f94450b7f7c1c9fad3aa17c226ca9 Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" <219766164+opencode-agent[bot]@users.noreply.github.com> Date: Thu, 22 Oct 2026 10:20:57 +0800 Subject: [PATCH] fix(session-ui): reveal the execute View code action while hovering the whole tool (#57984) --- .../session-tool-projection.spec.ts | 15 +++++++++++++++ packages/session-ui/src/components/basic-tool.css | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/session-ui/component-tests/session-tool-projection.spec.ts b/packages/session-ui/component-tests/session-tool-projection.spec.ts index eb6f469524f..142002221a6 100644 --- a/packages/session-ui/component-tests/session-tool-projection.spec.ts +++ b/packages/session-ui/component-tests/session-tool-projection.spec.ts @@ -179,6 +179,21 @@ story("opens an execution's code and output from its View code action", async ({ await expect(dialog.getByRole("button", { name: "Copy output" })).toBeVisible() }) +story("reveals the View code action while hovering anywhere over the execution", async ({ mount }) => { + const timeline = await mount("current-session-terminal-work--execute-code") + const tool = timeline.locator('[data-timeline-part-id="tool_execute_long_call"]') + const action = tool.locator('[data-slot="basic-tool-action"]') + await timeline.page().mouse.move(0, 0) + await expect(action).toHaveCSS("opacity", "0") + + // The calls sit below the header, so hovering them proves the whole tool reveals the action. + await tool.locator('[data-slot="execute-tool-call"]').first().hover() + await expect(action).toHaveCSS("opacity", "1") + + await timeline.page().mouse.move(0, 0) + await expect(action).toHaveCSS("opacity", "0") +}) + story("keeps long execute calls inside the tool and shows the script output", async ({ mount }) => { const timeline = await mount("current-session-terminal-work--execute-code") const tool = timeline.locator('[data-timeline-part-id="tool_execute_long_call"]') diff --git a/packages/session-ui/src/components/basic-tool.css b/packages/session-ui/src/components/basic-tool.css index 0c5a98afd26..6b96327fdf6 100644 --- a/packages/session-ui/src/components/basic-tool.css +++ b/packages/session-ui/src/components/basic-tool.css @@ -205,7 +205,8 @@ transition: opacity 0.15s ease; } -[data-slot="collapsible-trigger"]:hover + [data-slot="basic-tool-action"], +/* Reveal the action while the pointer is anywhere over the tool, including its expanded content. */ +[data-component="collapsible"].tool-collapsible:hover > [data-slot="basic-tool-action"], [data-slot="collapsible-trigger"]:focus-visible + [data-slot="basic-tool-action"], [data-slot="basic-tool-action"]:hover, [data-slot="basic-tool-action"]:focus-within {