fix(session-ui): reveal the execute View code action while hovering the whole tool (#57984)

This commit is contained in:
opencode-agent[bot]
2026-10-22 10:20:57 +08:00
committed by GitHub
Unverified
parent 7ea9e178ac
commit f6958ddb38
2 changed files with 17 additions and 1 deletions
@@ -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"]')
@@ -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 {