Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/app/e2e/snap/session-trow.snap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { composeGrid, snapOutputPath, type Shot } from "./_compose"
test.use({ viewport: { width: 900, height: 560 }, deviceScaleFactor: 2 })

const LANGUAGE_KEY = "pawwork.global.dat:language"
const ACTIVE_SHIMMER = '[data-slot="trow-summary-text"] [data-component="text-shimmer"][data-active="true"]'
const fixturePath = fileURLToPath(new URL("./fixtures/trow-snap-fixture.tsx", import.meta.url))
async function captureBlock(name: string, block: Locator): Promise<Shot> {
await expect(block).toBeVisible({ timeout: 30_000 })
Expand Down Expand Up @@ -37,15 +38,18 @@ test("session-trow", async ({ page }) => {
const shots: Shot[] = []
const running = page.locator('[data-snap="running-current"]')
await expect(running).toContainText("执行命令 third command", { timeout: 30_000 })
await expect(running.locator(ACTIVE_SHIMMER)).toBeVisible({ timeout: 30_000 })
shots.push(await captureBlock("running-current", running))

const activitySummary = page.locator('[data-snap="activity-summary-collapsed"]')
await expect(activitySummary).toContainText("读取 1 个文件,运行 1 条命令,搜索文件 1 次", { timeout: 30_000 })
await expect(activitySummary).toContainText("使用 1 个工具", { timeout: 30_000 })
await expect(activitySummary.locator(ACTIVE_SHIMMER)).toHaveCount(0)
shots.push(await captureBlock("activity-summary-collapsed", activitySummary))

const failedSummary = page.locator('[data-snap="failed-summary-collapsed"]')
await expect(failedSummary).toContainText("运行 1 条命令,读取 1 个文件,1 个失败", { timeout: 30_000 })
await expect(failedSummary.locator(ACTIVE_SHIMMER)).toHaveCount(0)
shots.push(await captureBlock("failed-summary-collapsed", failedSummary))

shots.push(await captureBlock("mixed-collapsed", page.locator('[data-snap="mixed-collapsed"]')))
Expand Down
8 changes: 3 additions & 5 deletions packages/ui/src/components/session-turn-trow-block.css
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,10 @@
transform: rotate(0deg);
}

/* Running state — summary shimmer hook. The actual pw-shimmer animation
* is wired by the caller (session-turn.css owns the `.pw-shimmer` class
* application against `[data-running]` after the Phase 2a rewrite); this
* file leaves the data attribute exposed so the shimmer can attach. */
/* Running state marker remains on the block; summary text uses TextShimmer
* directly so the shared reduced-motion and swap behavior stay centralized. */
[data-component="session-turn-trow-block"][data-running] [data-slot="trow-summary-text"] {
/* Hook for shimmer; intentionally no animation rule here. */
/* Marker target for state-specific overrides; no local animation here. */
}

/* Body — the outer wrapper that holds the per-tool sub-rows. AstroHan
Expand Down
7 changes: 6 additions & 1 deletion packages/ui/src/components/session-turn-trow-block.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { For, Show, createMemo, createSignal, type JSX } from "solid-js"
import type { ToolPart } from "@opencode-ai/sdk/v2"
import { patchFiles } from "./apply-patch-file"
import { Icon, type IconName } from "./icon"
import { TextShimmer } from "./text-shimmer"
import "./session-turn-trow-block.css"

// ============================================================================
Expand Down Expand Up @@ -231,7 +232,11 @@
<Icon name={leadingIcon()} />
</span>
<Show keyed when={summaryText()}>
{(text) => <span data-slot="trow-summary-text">{text}</span>}
{(text) => (
<span data-slot="trow-summary-text">
<TextShimmer text={text} active={!!activeTool()} />
</span>
)}
</Show>
Comment thread
Astro-Han marked this conversation as resolved.
Outdated
<Show when={hasExpandableBody()}>
<span data-slot="trow-summary-chev" aria-hidden="true">
Expand Down