app: prevent duplicate context tooltips by restricting tooltip to session header button only

remove-context-tooltip-from-tab
David Hill 2026-03-22 17:50:13 +00:00
parent c529529f84
commit ad68b6195f
2 changed files with 27 additions and 7 deletions

View File

@ -93,3 +93,23 @@ test("context panel can open file picker from context actions", async ({ page, s
await expect(dialog).toHaveCount(0) await expect(dialog).toHaveCount(0)
}) })
}) })
test("context tooltip only appears from the session header trigger", async ({ page, sdk, gotoSession }) => {
await withSession(sdk, `e2e context tooltip ${Date.now()}`, async (session) => {
await seedContextSession({ sessionID: session.id, sdk })
await gotoSession(session.id)
const trigger = contextButton(page)
await expect(trigger).toBeVisible()
await trigger.click()
const tab = page.getByRole("tab", { name: "Context" })
await expect(tab).toBeVisible()
await tab.locator('[data-component="progress-circle"]').hover()
await expect(page.locator('[data-component="tooltip"]')).toHaveCount(0)
await trigger.hover()
await expect(page.locator('[data-component="tooltip"]')).toBeVisible()
})
})

View File

@ -101,10 +101,10 @@ export function SessionContextUsage(props: SessionContextUsageProps) {
return ( return (
<Show when={params.id}> <Show when={params.id}>
<Tooltip value={tooltipValue()} placement={props.placement ?? "top"}> <Switch>
<Switch> <Match when={variant() === "indicator"}>{circle()}</Match>
<Match when={variant() === "indicator"}>{circle()}</Match> <Match when={true}>
<Match when={true}> <Tooltip value={tooltipValue()} placement={props.placement ?? "top"}>
<Button <Button
type="button" type="button"
variant="ghost" variant="ghost"
@ -114,9 +114,9 @@ export function SessionContextUsage(props: SessionContextUsageProps) {
> >
{circle()} {circle()}
</Button> </Button>
</Match> </Tooltip>
</Switch> </Match>
</Tooltip> </Switch>
</Show> </Show>
) )
} }