mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-17 23:24:00 +03:00
fix(session-ui): show token speed with the response footer (#62020)
This commit is contained in:
committed by
GitHub
Unverified
parent
3698a9b43f
commit
e99b6c5ddd
@@ -1,6 +1,6 @@
|
||||
import { expect, story } from "../../stories/playwright/story"
|
||||
|
||||
story("reveals turn speed only while hovering the response metadata", async ({ mount, page }) => {
|
||||
story("reveals turn speed with the response footer", async ({ mount, page }) => {
|
||||
const timeline = await mount("current-session-timeline-rows--response-speed", { args: { steered: true } })
|
||||
|
||||
const footer = timeline.locator('[data-slot="text-part-copy-wrapper"]').last()
|
||||
@@ -14,12 +14,11 @@ story("reveals turn speed only while hovering the response metadata", async ({ m
|
||||
await expect(speed).toHaveText("·60.0 tok/s")
|
||||
await timeline.getByText("The timeline checks passed.", { exact: false }).hover()
|
||||
await expect(footer).toHaveCSS("opacity", "1")
|
||||
await expect(speed).toBeHidden()
|
||||
await expect(speed).toBeVisible()
|
||||
|
||||
for (const width of [1000, 390]) {
|
||||
await page.setViewportSize({ width, height: 844 })
|
||||
await timeline.getByText("The timeline checks passed.", { exact: false }).hover()
|
||||
await meta.hover()
|
||||
await expect(speed).toBeVisible()
|
||||
expect(
|
||||
await speed.evaluate((element) => {
|
||||
@@ -31,7 +30,7 @@ story("reveals turn speed only while hovering the response metadata", async ({ m
|
||||
}),
|
||||
).toBe(true)
|
||||
await footer.getByRole("button", { name: "Copy response", exact: true }).hover()
|
||||
await expect(speed).toBeHidden()
|
||||
await expect(speed).toBeVisible()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -556,7 +556,7 @@
|
||||
}
|
||||
|
||||
@media (hover: hover) {
|
||||
[data-slot="text-part-meta"]:hover [data-slot="text-part-meta-speed"] {
|
||||
[data-slot="text-part-meta-speed"] {
|
||||
display: inline-flex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ export const ResponseSpeed = {
|
||||
render: (args: { measured: boolean; steered: boolean }) => (
|
||||
<CurrentSessionTimelineStory
|
||||
title="Response speed"
|
||||
description="Hover the response, then its metadata line to reveal tokens per second across both model steps."
|
||||
description="Hover the response to reveal tokens per second across both model steps."
|
||||
width="720px"
|
||||
document={{
|
||||
sessionID: CURRENT_SESSION_ID,
|
||||
|
||||
Reference in New Issue
Block a user