Skip to content

fix(threads): load full tool output when it is expanded - #556

Merged
nixuuu merged 3 commits into
devfrom
fix/lazy-item-expand
Nov 12, 2026
Merged

nixuuu merged 3 commits into
devfrom
fix/lazy-item-expand

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Collapsed tool calls currently show a separate “Load full item / Showing a preview.” row, even when their truncated content is hidden. Load each call’s full content automatically when its own details open, with a compact inline spinner and loading status. Keep the preview visible on failure and offer Retry. Visible message previews end with “Show full message · ” and load in place. Truncated background output ends with “Show full output · ”.

Completed reads stay in a client session cache keyed by thread and content hash, outside the timeline reducer. Closing a disclosure aborts its read; web cancellation follows the open state even while the body’s exit animation remains mounted. Mobile follows the same behavior with JS-only changes. Reasoning and compaction retain their own disclosure boundaries. The diff is limited to lazy content and preserves the mobile turn animation changes now on dev.

Fixes: #541

Verification

  • Rebased onto dev, including fix(files): resolve and preview files from remote threads #546 and fix(mobile): expand turn summaries smoothly without scroll jumps #554. bun install and bun run gen:check pass. Focused lint and formatting checks pass; web typecheck reports zero errors and warnings, and mobile typecheck passes.
  • Focused integration: tests/integration/thread-sequence-watch.test.ts — 10 pass, 0 fail. Covers bounded windows, on-demand large content, chunked reads, concurrent cancellation, and owner scoping. Domain and gateway loading semantics are unchanged.
  • Real browser with seeded large command, file-read, background-output and message content: collapsed calls send no content requests; expanding loads full content inline; a 352 KB output loads over 8 chunks; collapse aborts an outstanding request; loaded output survives re-expansion without another request. Simulated failure preserves the preview; Retry loads successfully. Verified “Show full output · 1.4 KB” expands the truncated background output in place.
  • Visually reviewed light/dark at 1280 px desktop and 390 px phone width, with short and long call/file names. Inline states use tool-row meta text (12 px desktop, 13 px phone); no page overflow. No web UI tests added.
  • EAS production fingerprints match dev: iOS 6ddec9ef559ee0095ac33e94ff9418a942053b17, Android 5f6eae3ab278f1cd543e9ed763f923a319b65ec9. No native config or dependencies changed. Full check:tmp was not rerun locally, as requested; the full suite and web build run in CI.

Browser review found and fixed a missing reactive Retry dependency in the Svelte effect, and moved the existing truncated-background-output action after its output with the requested copy and size. The original Static checks failure was formatting in mobile LazyItemContent; that formatting fix is included.

Copy audit (§8)

Before After Reason
Load full item Automatic loading inside expanded details; Show full message · for visible message previews Removes internal “item” terminology and attaches the action to visible content.
Showing a preview. Loading output… / Loading thought… / Loading summary… / Loading message… only during a read States the ongoing action at work-row meta size; no redundant explanation.
Could not load the full item. Try again. Could not load the full output/message/thought/summary. + Retry Names the affected content and provides one concrete recovery action.
Show all output Show full output · after the truncated output Names the content and shows its size where the preview ends. Streaming output omits the size.

Audit items 1–10 pass: short sentence-case copy, verb-first actions, existing vocabulary, concrete error recovery, no duplicate facts or new empty states, no humor, and text alongside status cues. Short, typical and long names were checked at desktop and phone width in light and dark.

@nixuuu
nixuuu force-pushed the fix/lazy-item-expand branch 2 times, most recently from 0831cca to f72b509 Compare November 12, 2026 12:23
Load large content inside the expanded call, with compact loading and retry states. Keep completed reads in the client session cache and abort reads on collapse.

Fixes: #541
@nixuuu
nixuuu force-pushed the fix/lazy-item-expand branch from f72b509 to cf9b557 Compare November 12, 2026 12:25
@nixuuu
nixuuu marked this pull request as ready for review November 12, 2026 12:26
@nixuuu
nixuuu merged commit a79d316 into dev Nov 12, 2026
12 checks passed
@nixuuu
nixuuu deleted the fix/lazy-item-expand branch November 12, 2026 12:35
nixuuu added a commit that referenced this pull request Nov 20, 2026
## Change

- Web and desktop show the loaded timeline immediately. Scrolling up to
a gap reads one older page. “Show earlier work” loads the selected turn,
including turns that span several pages. On mobile, a gesture toward the
history edge loads at most one page.
- Web, desktop and mobile keep the live stream open when an older page
covers the changes already received. If the stream advanced past the
page, the client replays from the page checkpoint to recover concurrent
edits and deletions.
- Desktop persists a bounded history tail. Web and desktop limit
inactive expanded content to 32 items and 8 MiB and cancel obsolete
reads on reset. An oversized result stays available while in use.
Clients reuse the measured size of an unchanged snapshot when leaving a
conversation.
- Header-only updates preserve the timeline rows. Unchanged controls and
heartbeats still run validation and connection diagnostics while
avoiding redundant view updates.

## Verification

- Chromium on Linux, 2,160 items and 19 subagents. Opening the thread
issued 0 older-page requests, down from 16 (453,590 response bytes).
Checked scroll restoration, a multi-page turn, a quote, retry after a
failed read and a timeline that fits on screen. Tested wide and narrow
viewports in both themes.
- Android emulator. A layout change after scrolling issued 0 history
reads, down from 16. A gesture fetched one page on the existing stream.
Twelve pairs of unchanged controls and heartbeats produced 0 React
commits, down from 21. Sending a message and resuming from the
background advanced and restored the live checkpoint.
- With 4,608 synthetic items, 32 exits from an unchanged cached thread
required 0 full encodings, down from 32. In a 10,000-item renderer
probe, median header-update processing fell from 3.10 ms to 0.007 ms.
Forty-eight expanded outputs of 512 KiB retained 7.5 MiB of inactive
content, down from 24 MiB.
- Targeted domain, history cache, gRPC replay, continuity, work-window
and mobile synchronization checks passed, along with web, mobile and
domain typechecks and repository lint on the edited files. The
concurrent-deletion test compares a paged-and-resumed client with a
continuously connected client.
- Copy audit (§8) passed. The former idle “Loading earlier work…” label
now reads “Show earlier work” and acts as a button. “Loading earlier
work…” appears during a read and “Retry” after failure. The native
equivalent uses the existing “Show earlier messages” button.
- The Windows Electron and day-long Windows session remain unmeasured.
Native testing used Android. Additional Expo ESLint reported
pre-existing hook findings.

Fixes: #300
Fixes: #302
Fixes: #541
Fixes: #556
Fixes: #672
Fixes: #687
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant