Skip to content

feat(native): transcript images, zoom viewer, Edit from here, and the remaining status lines - #41

Merged
rynfar merged 5 commits into
nativefrom
nw/w1-media
Nov 2, 2026
Merged

rynfar merged 5 commits into
nativefrom
nw/w1-media

Conversation

@rynfar

@rynfar rynfar commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Problem

The native transcript showed image attachments as bare file names, ignored images authored in markdown, and had no way to rewind a thread ("Edit from here").

Approach

TR-MEDIA (ports TimelineUserMessageRow.tsx, ChatMarkdownMedia.tsx, ExpandedImageDialog.tsx, ZoomableImage.tsx, client-runtime/src/{markdownImages,mediaSource,mediaReference}.ts):

  • t3-core::media: attachment classification (isImageAttachment, preview annotations left out), media placement (alone / above text / in guest and agent bubbles), classifyMarkdownImageSource and resolveMediaSource (host files become media-file assets, never direct reads), AssetCreateUrlResult decoding, data URLs. Tested.
  • t3-client::assets: assets.createUrl, then the signed URL fetched through the shared asset::fetch_asset (size-capped). Direct http(s) and data: images are supported too.
  • app::media: a bounded cache. Fetch and decode run on the tokio blocking pool, at most 6 at a time (ASSET_URL_MAX_IN_FLIGHT). Images are downscaled to the size they draw at (thumbnails 1280px max edge, viewer 3072px). Encoded bytes are kept (64 MB) so scrolling back skips the network. Decoded images (160 MB budget) the transcript has not drawn for 2 frames are evicted oldest first, and drop_image frees their atlas tiles. The viewer pins what it shows. GIF and WebP show their first frame only, so nothing repaints continuously.
  • Layout follows §7.5: lone image 192 tall with radius 16 and an inset ring, corners tightened against the bubble. Collages of 2, 3 and 4+ images are 320 wide with 1px hairlines. Guest and agent bubbles get a 4:3 grid, max 210. Markdown image paragraphs take a gpui-component block parser and renderer, used only for texts with image syntax so other messages are not reparsed. They draw at most 480 square, radius 8, with the web's "Image unavailable · alt" fallback chip.
  • Viewer: black 75% scrim over the whole window, fitted to 92% of it, caption with (i/n), arrows between a message's images. Click toggles 2x at the pointer, scroll zooms up to 8x, drag pans. Keys: Enter, +, -, 0, arrows, Escape. Focus goes back where it was on close.

TV-REWIND (ports useTimelineRewind.ts, deriveRevertTurnCountByUserMessageId / findRevertCheckpoint, deriveAvailableRevertTurnCounts / waitForRevertedMessage, recallableComposerPrompt, RevertConfirmHost):

  • t3-core::timeline::rewind holds the logic and its tests: which messages can rewind, the checkpoint.rollback command, the witness-run wait (including Claude's fresh root session at thread start, and rollbackFailure), and prompt recall.
  • Hover action "Edit from here" (pencil), disabled while a turn runs or a rewind is out. Confirm dialog: Cancel / Revert files too / Revert and keep changes. Then dispatch, wait (120 s timeout), and the server's error goes to the error banner.
  • Composer hook: AppState::restore_composer_prompt plus AppEvent::ComposerRestore. The composer merges the prompt into its draft (current + "\n\n" + restored) and focuses. The composer change is one subscription and one method.
  • Wire additions: AppThread.rollbackFailure (conformance builder and fixtures regenerated) and ServerProvider.supportsConversationRollback.

TV-STATUS: remaining lines (ports ThreadNow.tsx, ThreadActivityBanners.tsx, presentPendingBackgroundWork, childThreadInputsTitle, useForceStopThread.ts, threadSync.ts):

  • t3-core::timeline::now: background-work presentation (titles, kinds, subagent display titles), the child-input line (subagents, side chats and delegated tasks holding a request), and the Force stop request and notices. Tested.
  • The footer follows the web's order. First "attention": an unresponsive Stop, else waiting subagents in the info color, with their titles as links and Open approval / Open question. Then "work": Stopping, else background work with Open (one subagent) and Stop, which reads "Stopping..." for 10 s while the tasks are still listed. Then "Syncing messages..." after a 500 ms hold. Then the goal, then the status line.
  • Force stop appears on "Agent not responding to Stop" when the server reports threadForceStop. It calls orchestration.forceStopThread with the run that ignored Stop and shows the web's toasts (new Info toast kind, §6.6).
  • Wire additions: PendingBackgroundTask.{taskId, description, childThreadId} (conformance shell fixture extended and regenerated) and capabilities.threadForceStop.

Ledger

TR-MEDIA → partial. TV-REWIND → partial. TV-STATUS → partial. TR-HTML / TR-MCPAPP were not started.

Gaps

  • Video attachments and markdown video (shown as a chip), HEIC (shown as "can't be shown"), animated GIF playback, snap-shot details, and media actions (copy, save, open) are not ported.
  • Markdown galleries cover one image at a time.
  • Rewind does not restore the message's attachments into the composer.
  • The background-work line has no elapsed timer or subagent progress detail yet.
  • HTML render and MCP app frames (TR-HTML / TR-MCPAPP) are still unported.

Evidence

  • cargo test --workspace, clippy -D warnings, gen-theme --check, parity/sync.test.ts, conformance --check: all green.
  • Real data (14700), read-only: markdown images resolved to media-file assets and fetched with server dimensions (claude-t3-connected.jpg 32755 bytes, 1516×758, JPEG magic).
  • Smoke (14658), on a scratch git repo project outside every checkout (created, then deleted): a two-turn devReplay thread showed counts {u1: 0, u2: 1} and available {0, 1, 2}. With restore files on, the server rejected the rollback: "File restore requires an isolated worktree…", which the UI shows in its error banner. Keeping changes: dispatch Ok(sequence 2026), progress Done, runs [(1, completed), (2, rolled_back)], restored prompt "second turn".
  • Offscreen snapshot (--features snapshot, read-only, real data): /private/tmp/claude-501/-Volumes-DevSSD-t3code/7a9093f7-05bd-4183-ab15-c4265aa48126/scratchpad/w1c-md-images.png. It shows a markdown screenshot decoded from a media-file asset and drawn at 480 wide with radius 8 and its border. The hover-only Edit button and attachment bubbles had no read-only fixture to capture.
  • Real data decode sweep with the new shell fields: 32 threads, 0 decode errors.

Model: Claude Opus 5.5 · Harness: Claude Code (native-client factory worker W1c)

@rynfar rynfar changed the title feat(native): transcript images, zoom viewer, and Edit from here feat(native): transcript images, zoom viewer, Edit from here, and the remaining status lines Nov 2, 2026
@rynfar
rynfar merged commit 952c008 into native Nov 2, 2026
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