app: prevent duplicate context tooltips by restricting tooltip to session header button only
parent
c529529f84
commit
ad68b6195f
|
|
@ -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()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue