test(web-cards): update card specs and snapshots for collapsed ToolRow

Rewrite the read/search/web/diff card spec suites for the collapsed-by-default
ToolRow composition: each row now needs the conversation `t`, and the card is
absent from the DOM until the row's [data-expandable] toggle is clicked. Refresh
the built-boot and search-card assembled snapshots (they expand the row before
shaping the card) and the code-mode-round golden. Fix a fixture turn-number
collision the 985/986 merge introduced (grep reused turn 67, already the
multi-hunk edit's, so both shared one callId) by renumbering search/web/todo to
68-72. Document the refactor's behavior in the ui-conversation README (both
languages) and add the Agent Note.
This commit is contained in:
Chinesezjc
2026-07-31 16:34:16 +08:00
parent 01d450f819
commit b2e01e5ba9
16 changed files with 289 additions and 94 deletions
@@ -8,4 +8,20 @@ line=141: const [collapsed, setCollapsed] = useState<ReadonlySet<number>>(() =
line=73: const search = searchCardModel(block)
line=90: <SearchBlock {...search.card} maxLines={CHAT_SEARCH_MAX_LINES} className={css.search} />
line=113: ctx.slots.register({ name: 'conversation.chat.toolview', key: 'grep' }, SearchRow)
expand=… 其余 4 行
expand=… 其余 4 行
recovery=Found 9 of 42 matches
packages/client/ui-primitives/src/SearchBlock.tsx
Line 16: export const DEFAULT_SEARCH_MAX_LINES = 16
Line 138: export function SearchBlock(props: SearchBlockProps) {
Line 141: const [collapsed, setCollapsed] = useState<ReadonlySet<number>>(() => new Set())
packages/client/ui-conversation/src/client/contract/search-card-model.ts
Line 24: export const CHAT_SEARCH_MAX_LINES = 8
Line 60: export function searchCardModel(block: ToolCallBlock): SearchCardModel | null {
packages/client/ui-conversation/src/client/toolviews/search-row.tsx
Line 71: export function SearchRow({ toolName, block }: ToolRowProps) {
Line 73: const search = searchCardModel(block)
Line 90: <SearchBlock {...search.card} maxLines={CHAT_SEARCH_MAX_LINES} className={css.search} />
Line 113: ctx.slots.register({ name: 'conversation.chat.toolview', key: 'grep' }, SearchRow)
(Full grep result stored at: fixture://spill/grep-68. Read it to see every match.)