Repository navigation
feat(native): raw item inspector in tool rows - #82
Conversation
|
I've addressed all three review findings in 1. Large outputs did their work on the UI thread (fixed). An inspector's blocks are now prepared without colors and stored in a cache outside render (
2. Answer attachments looked like links but did nothing (fixed).
3. Argument colors survived a theme change (fixed). Prepared text stores what colors each run (argument keys, JSON captures, or the TypeScript syntax tree), not the colors themselves. Colors are looked up when the text is drawn and kept per theme: the palette's
|
cb743b6 to
1b438d4
Compare
|
Both points from the follow-up are fixed in
|
|
Fixed in
All gates pass. One run of the client test |
|
Fixed in
All gates pass. |
… theme, opens answer attachments
5048ce3 to
dda0c10
Compare
|
Fixed in
Rebased on |
Problem
An expanded tool row in the native client showed an approximation of the web's
V2ItemInspector. The rules differed from the web: which rows open, the indent, and output that was never fetched for reads. Copy also differed: "Output is no longer available." was shown on its own, and commands had a$prefix. There was no JSON highlighting and no tool output images, and the text could not be selected. The withheld-detail fetch also decoded the item on the UI thread.Approach
timeline/detail.rsnow ports all ofitemDetail.ts:toolCallLines,formatToolValue(content blocks, resource links,structuredContent, JSON and JSON-lines pretty-printing),turnItemOutputText,turnItemOutputImages(withreadToolOutputImageand the 8-image cap),turnItemHasDetail,turnItemNeedsDetailFetchandturnItemDetailRevision.timeline/inspector.rsports two pieces of web logic. FromTimelineWorkEntryRow:plainOutput,canExpandProjectedItem, and whether a row gets the inspector, a read's or skill's plain output plusFetchedToolOutput, orQuestionAnswerHistory. FromV2ItemInspector:useFetchedTurnItem/ToolOutputstates (pending, error,Couldn't load output: Output is no longer available.,No output.) and the inspector's text lines.json_text.rs:JSON.stringifyas JS prints it (key order including array-index keys first, number formatting, escapes).isJsonText.@pierre/highlightsgives it, so colors come from the same syntax theme.serde_jsonnow haspreserve_orderset explicitly. The app already got it through feature unification, butcargo test -p t3-coredid not, so argument order differed between the two builds.AssetResource::ToolOutputImageadded.FileChangeDetailgainsfileType/mimeType.transcript/inspector.rsis aRenderOnceport ofV2ItemInspector/FetchedToolOutput. It derives its blocks once per (item, fetched item, fetch state, appearance) through keyed state, not on every frame.SelectableTextfrom feat(native): selectable text element, used by command output #72. Long blocks scroll in their own capped scrollers, and a drag past the edge autoscrolls them.codeargument is highlighted as TypeScript. Tool output images come from the media cache and open the viewer.diff_addition/diff_deletion, plus "Open diff".WorkLogDetails kind="panel": flush with the icon,mt-0.5 mb-1.5 pb-2.thread_view.rs::fetch_detailusesAppState::request, so the result decodes on the network runtime.entry_fetches_detail, so reads and skills with withheld output now fetch, asFetchedToolOutputdoes. The inspector of a streamed command still doesn't fetch.fetch_detailchanged in that file.item-detail.jsonland replay intests/conformance.rs. Items are sent as realorchestration.getTurnItemresults through the contracts codec, and everyitemDetail.tsoutput is compared.@pierre/highlights, using a theme that colors each capture differently.--turn-items.Ledger
TR-INSPECT:
todo→partial.crates/app/src/transcript/inspector.rs,crates/core/src/timeline/inspector.rs,crates/core/src/timeline/detail.rs,crates/core/src/json_text.rs.ShellCommandBlock's highlighter, already noted on TR-CMDOUT).Out of this row and not ported here:
QuestionAnswerHistoryattachments show by name, not as thumbnails.docs/design-system.md§7.7's expanded-body row now matches the panel.Screenshots
Offscreen GPUI renderer (
--snapshot, same clicks on both builds). They are in/private/tmp/claude-501/-Volumes-DevSSD-t3code-native/15deb025-b650-4cf9-a1aa-1cc16b006f6d/scratchpad/shots78/:crop-before-command-filechange.png: indented 28px,$ vp test run.crop-after-command-filechange.pngandcrop-after-command-filechange-light.png: flush like the web, no$.crop-.before-mcp-row.png.after-mcp-row.png:url …with the key muted, then the fetched output.after-mcp-select.png: a drag selects across the argument line.key valuelines, as on the web. The conformance fixture pins it per character instead.Probe transcript
cargo run -p t3-client --example probe -- --thread mcp:60fa4373-… --turn-items --seconds 6against the smoke server (item ids shortened):Notes
sidebar/row.rssetshovertwice on a receding working row. GPUI panics with "hover style already set" as soon as one is drawn. It reproduces on the base build against real data. I patched it locally, without committing, only to take the real-data captures.work_entry_is_visible_in_group, which was ported from the web, so the read row isn't reachable there.main.rscallscx.activate(true), which would take focus.Closes #78