Repository navigation
feat(native): transcript rows and streaming markdown at web fidelity - #17
Merged
Merged
Conversation
Visible turn items become timeline entries and then rows with work groups, turn and attempt folds, live activity, working/thinking rows and assistant meta, ported from MessagesTimeline.logic.ts, session-logic.ts and the client-runtime work-log presentation. Adds the optional turn-item wire fields those rules read, and a dump_thread example for building fixtures.
Entries memoize their failure and tool action, and a streamed token that only grows one assistant message patches the previous rows instead of re-deriving, as the web's replaceStreamingMessageRows does. A captured replay stream checks that incremental derives match a fresh derive at every frame. timeline_sweep derives every thread on a server read-only and reports row kinds and derive time.
Rows from t3_core::timeline render as the web lays them out: grouped work rows that open to command, file-change, search and tool details, live activity and Thinking rows, Worked-for folds, user bubbles with long-message collapse, steer and model-switch markers, assistant prose with hover meta and Copy, proposed plan cards, todo rows, lifecycle dividers, subagent rows and request cards in their waiting and answered states. Markdown uses gpui-component's TextView: streamed text appends with push_str (background reparse of the last block), code blocks get tree-sitter highlighting, a language label and Copy. Lucide icons are vendored at the web's version with its strokes.
This was referenced Nov 2, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The native transcript drew one plain row per turn item: no work groups, no folds, no live activity, and markdown that reparsed the whole message on the UI thread for every streamed token.
Approach
Row model in
t3-core(#7).crates/core/src/timeline/ports the web pipeline as pure Rust:entries.rs: visible turn items to timeline entries (session-logic.tsderiveTimelineEntriesFromVisibleTurnItems/projectedWorkEntry), with attempt resolution through nodes. Entries are cached by itemArc, so an update rebuilds only the items that changed.rows.rs+folds.rs:deriveMessagesTimelineRows: work groups ("Ran 2 commands and changed 1 file"), single-tool rows, Worked-for / You-stopped / Continued-for turn folds, superseded-attempt folds, the shared live activity row, Working and Thinking rows, compaction rows, subagent batches, created-thread summaries, assistant-meta after trailing tool groups, and grouping of consecutive own messages and steers.presentation.rs,tool_activity.rs,user_input.rs:work-log/presentation.ts,toolActivity.ts,commandLabel.ts(common paths),userInput.ts, plusliveThoughtLine, compaction labels and icons.activity.rs: latest/activity run, working state and pending approvals from the projection (threadExecution.ts,threadRequests.ts).Per-token cost: entries memoize their failure scan and tool action, and a token that only grows one streaming assistant message patches the previous rows (
replaceStreamingMessageRows) instead of re-deriving.Rendering (
crates/app/src/transcript/, design system §7.5–§7.8).transcript_row.rsis replaced by a module: work rows with icon slot, hover timestamp and chevron that open to command input/output, file-change path and +/- stats, search patterns/results, dynamic-tool arguments and output, todo steps, question answers; group headers that expand into a bounded scroll list; live and Thinking rows; folds; user bubbles (80% lane, grouped corners, "Show full message" collapse at 176px with fade, steer marker, "Sent by T3 Code", model-switch divider, attachment names, hover timestamp + Copy); assistant prose with hover meta (status pill, Copy, timestamp); proposed plan card (title, badge, Copy, Expand plan); lifecycle dividers (interrupted, handoff, fork); subagent rows/groups that open the child thread; secret and link request cards in waiting and answered states; approval rows showing "Waiting for approval" (the actions stay with the composer).Markdown (#8). I kept gpui-component's
TextViewrather than writing a renderer tonight: it already has block-level selection across a message, tables, lists, blockquotes and links, and itspush_strreparses only the last block on a background task.MarkdownStoreappends withpush_strwhen new text extends the old (fullset_textonly for real replacements), creates states lazily for rows that render, and bounds the cache (LRU halving past 400). Code blocks use the design-system frame with a mono language label and Copy, highlighted by tree-sitter (13 languages enabled); styles are cached per block, so settled blocks never re-highlight. Links useinfo_foreground.Icons. Lucide SVGs vendored from
lucide-react0.564.0 with the web's strokes baked in (1.75; 2 understroke-2/for work rows), served byicons::Assets. The files overlapping with the diff worker's vendored set are byte-identical.Shared files touched minimally:
main.rs(twomodlines,with_assets),core/lib.rs(pub mod timeline),app/Cargo.toml(tree-sitter features,chronofor local timestamps),theme/mod.rs(link color),turn_item.rs(optional wire fields, placed clear of the wire-body work in flight).Ledger
TR-GROUPING, TR-WORK, TR-REASONING (#7); TR-MARKDOWN, TR-ASSISTANT (#8); TR-USER, TR-PLAN, TR-TODO, TR-APPROVAL, TR-INPUT, TR-SECRET, TR-LIFECYCLE. TR-REASONING and TR-TODO are
done; the restpartial.Verification
cargo test -p t3-core -p t3-client: 34 tests, including web cases (terminal-message copy, Worked-for folds, trailing activity folding unless failed or live, live row ownership, group summaries, steer grouping), a synthetic showcase fixture, and a captured devReplay stream checking that incremental derives match a fresh derive at every frame.cargo clippy --workspace --all-targets -D warnings,gen-theme --check,parity/sync.test.tspass.timeline_sweep, counts only): 59 threads, 13,558 visible items, 3,559 rows, 0 empty labels, no decode errors. Cold derive peaks at 6.7 ms (1,855 items); warm derive at 2.6 ms before the streaming fast path, which reduces a token to a pointer comparison over the entries.Known gaps
outputOmitted) shows "Output not loaded." Fetching it needsorchestration.getTurnItemthroughClientHandle::request, which the composer worker is adding. This is the last piece of Transcript work groups and tool rows at web fidelity #7's "expanding a command shows its output", so neither issue is closed here.t3McpToolPresentation.ts), deferred-work loading for collapsed history, HTML/MCP-app frames, worktree setup rows, revert targets and per-turn diff cards, idle-resume compaction titles, images and file previews in bubbles, Edit/Fork buttons, provider icons in handoffs, mermaid/math/alerts, the 600ms block fade and the running shimmer (rows render static, which §9 allows).