Repository navigation
feat(trace): cap row excerpts and count the fold head by tool (#1604) - #1605
Conversation
- fold a success row's result excerpt into the summary expand block as
a second column beside the argument summary, both under the existing
max-h-48 scroll cap, so the row stays one line
- keep the failure excerpt un-folded under the row (the cross-turn
retrospection anchor) and add the same scroll cap, so a multi-KB
error can no longer push the whole screen out of view
- relabel the round step fold from a bare call total to per-tool call
counts in first-appearance order ("explore ×3 · describe ×1") --
the category word alone reads as an undifferentiated 读 ×N on a
single-category round; the category stays on the row's
OperationBadge; tool names are untranslated data, so the head order
is stable across re-renders and locale switches
- swap the catalog key for a count template and drop the dead toggle
key in both locales
Review: 6-agent passSix passes over commit d4f70ab (10 files, +209/−62 — issue #1604, ticket A of the trace-flow plan: a success row's result excerpt folds into the summary fold's expand block as a second capped column beside the argument summary, the failure excerpt keeps its under-row retrospection anchor and gains the thinking fold's scroll cap, and the round step fold's head switches from a bare call total to per-tool call counts in first-appearance order): code-reviewer, comment-analyzer, pr-test-analyzer, silent-failure-hunter, type-design-analyzer, and code-simplifier — all six delivered; the implementing session's dual-axis review (standards and spec, no Critical, no Important) had already folded its rulings into the pushed commit, and the axes below checked the pushed tree without re-litigating the recorded rulings — the on-device recalibration to tool-name counting, the relaxed test anchors (the trace-toggle class selector plus exact label strings), the OPERATION_ORDER dual enumeration dissolving with the live-grouping ticket, the describe placement dispersion, and the leading label word parked for that same ticket. Verification feeding this pass: silent-failure-hunter walked the excerpt gate's success/failure matrix and every fallback chain with concrete inputs and found no swallowed error outside the cap finding; pr-test-analyzer ran ten gate mutants plus a dead-key probe over the five touched suites — seven killed outright, the gate and column-structure survivors feed Importants 2 and 3, and the en-US template survivor is the repo's defaultMessage-pinning convention rather than a defect; comment-analyzer fact-checked every touched comment claim against source and caught the two the rework itself had rotted; type-design-analyzer ruled the excerpt prop's undefined-as-absent seam correct and found zero casts across the touched test factories; code-simplifier audited both directions and found one dead structure; code-reviewer ran the thread suite directory-wide (741/741) and audited all three consumer faces; the main session re-verified all five Importants at source — the four cap precedents grepped attribute by attribute against the bare new span, both stale comments read at HEAD, and both surviving mutants' inference chains re-derived. CI at review time: Frontend and Rust green on ubuntu, windows, and macos. Verdict: no Critical, 5 Important, 1 Advisory. The density core is sound on every axis — the excerpt gate's success/failure matrix, the three consumer faces staying single-column, the first-appearance counting with untranslated tool names, and the exact i18n parity all survived adversarial reading, and the type axis ruled the excerpt prop's seam placement correct. Important 1 is an accessibility backstop the four existing cap regions already carry — three attributes and one catalog id away; Importants 2 and 3 are small test pins closing the two surviving mutants; Importants 4 and 5 are one-line comment fixes in files this PR itself touched. Advisory A is a net-three-line deletion the simplifier verified green by mutation; per the maintainer's take-all ruling every finding lands in this PR rather than follow-up. Important1. The failure excerpt's new scroll cap is the trace's first pointer-only scroll region (silent-failure-hunter, precedents re-verified at source; 2. The success gate has no behavioral pin (pr-test-analyzer, mutation-verified; 3. The two-column layout and its divider are unpinned (pr-test-analyzer, two mutants survived; 4. The sub-trace header comment still counts per kind (comment-analyzer; 5. A test comment still quotes the retired head label (comment-analyzer; AdvisoryA. foldLabel carries a dead order array and a dead fallback (code-simplifier, rewrite verified green by mutation; Confirmed clean
|
- give the failure excerpt's scroll cap the #1363 region posture the other three height-capped regions hold (tabIndex, role, a new thread.trace.excerptAria id), so a multi-KB error's tail stays reachable by keyboard, and pin the three attributes in the failure test - pin the success gate: the failure test now expands the fold and asserts the block carries the summary alone -- dropping the entry.success arm had rendered the failure twice with 188 tests green - pin the two-column face: the excerpt test asserts the divider column carries the excerpt and the no-excerpt test asserts none -- both the discriminant flip and the divider strip had run green - count foldLabel through the Map's insertion order (the append-only trace makes it the first-appearance order), dropping the parallel order array and the unreachable ?? 0 fallback - reword the sub-trace header's per-kind to per-tool and drop the retired "Trace · 0 calls" quote from the zero-call test comment
Review follow-upLanded in 89af974: Importants 1 through 5 and Advisory A. Important — fixed
Advisory — fixed
Local verification: full suite 2896/2896, tsc clean, eslint and design:lint clean, i18n:check aligned at 864 ids; all four mutants (the dropped gate, the bare cap, the flipped discriminant, the stripped divider) each reddened their pin and restored green. |
Summary
Issue #1604 — trace row density closeout. A success row's
result_excerptno longer renders under the row: it folds into theTraceSummaryFoldexpand block as a second column beside the argument summary, both under the existingmax-h-48scroll cap, so the row stays one line. The failure excerpt keeps its place under the row (the cross-turn retrospection anchor, ADR-0078) and gains the same cap, so a multi-KB error can no longer push the whole screen out of view. The round step fold's head switches from a bare call total to per-tool call counts in first-appearance order (explore ×3 · describe ×1) — an earlier cut counted by operation category, but on a single-category round the category word collapses to an undifferentiated 读 ×N, so the tool name (untranslated data, order stable across re-renders and locale switches) carries the head while the category stays on the row'sOperationBadge. ADR-0078's folding discipline is untouched.Changes
TraceRow.tsx): the excerpt render splits on success — success rows pass the excerpt into the summary fold (undefined when empty), failure rows keep the under-row span and addmax-h-48 overflow-y-auto(the thinking fold's cap face).TraceSummaryFold.tsx): a new optionalresultExcerptprop renders the argument summary and the result excerpt as two columns of one capped block, divided by a hairline; absent keeps the single-column block, so the approval card and the running row are unaffected.TraceRow.tsx): the step fold counts calls per tool name in first-appearance order — the trace is append-only within a round, so the order never reshuffles; a single tool keeps the count form; zero-call rounds still mount nothing.zh-CN.json,en-US.json): the deadthread.trace.togglekey drops (the i18n guard rejects dead keys) and athread.trace.toolCountcount template ({tool} ×{count}) replaces it — the only new key.TraceView.test.tsx,TraceSummaryFold.test.tsx,TurnCard.test.tsx,Thread.test.tsx,DelegationSubTraceBody.test.tsx): the excerpt-gate tests rework to the new faces (success folds into the block, failure stays capped, clean stays bare), the fold-label describe covers first-appearance order / single tool / zero-call, and the zh-catalog assertions pin the exact count strings.Files Changed
src/components/thread/TraceRow.tsx-- modified (excerpt gate split by success + per-tool fold-head label)src/components/thread/TraceSummaryFold.tsx-- modified (optional resultExcerpt column in the expand block)src/components/thread/DelegationSubTraceBody.tsx-- modified (comment wording rides the label rename)src/locales/zh-CN.json-- modified (-thread.trace.toggle, +thread.trace.toolCount)src/locales/en-US.json-- modified (same)src/components/thread/__tests__/TraceView.test.tsx-- modified (excerpt-gate rework + fold-label describe)src/components/thread/__tests__/TraceSummaryFold.test.tsx-- modified (+resultExcerpt column coverage)src/components/thread/__tests__/TurnCard.test.tsx-- modified (count-label assertions + tool-order pin)src/components/thread/__tests__/Thread.test.tsx-- modified (count-label assertions)src/components/thread/__tests__/DelegationSubTraceBody.test.tsx-- modified (count-label assertion)Testing
tsc --noEmit, ESLint, andi18n:check(863 ids: source == en-US == zh-CN) clean;design:lintpasses.Related Issues
Closes #1604.
Follow-up (deferred):
工具调用 · explore ×3) is parked until the live process-grouping ticket lands — its verb-prefix vocabulary is the same design space.