Skip to content

feat(rc-gateway): open a tool call to read its call and result (#64) - #41

Merged
InfiniteInsight merged 1 commit into
mainfrom
rc-gateway/64-tool-call-expand
Oct 16, 2026
Merged

InfiniteInsight merged 1 commit into
mainfrom
rc-gateway/64-tool-call-expand

Conversation

@InfiniteInsight

Copy link
Copy Markdown
Owner

Closes InfiniteInsight/Qwen-Code-Remote#64

A tool row showed a label and a status and nothing else. The arguments the call went out with and whatever came back were dropped by the model, so a call that failed could not be read without leaving the viewer.

What changes

  • model - upsertTool keeps rawInput and the result on the item. toolResult() reads content when it is non-empty, else rawOutput. A status-only frame carries neither and must not clear what is already there. An empty content is deliberately not a result: reading it as one would leave every pending call showing an empty output.
  • view - the head becomes a tap target with a chevron, opening one bounded text block (call / result, clipped at 4000 chars). Only a row whose frames actually carried something gets a chevron, so a call with nothing behind it does not look like it is hiding something. The text is memoised per item because estimate() re-runs over every unmeasured row on each layout rebuild.
  • css - no display rule on .tool-detail, on purpose (see the second probe below).

Two things the virtualizer makes non-free

  1. estimate() has to count the expanded height, or the row jumps when it opens while still unmeasured - the rc-gateway: the to-do strip takes the bottom of the conversation window #58 class of bug.
  2. The tap has to hold the tapped line, or opening a call at the end of the transcript pulls it up by the height of the detail.

Point 2 is worth calling out: keepHeld() looks the clicked line up as hold.row ? m.row : m.head, and tool rows never set m.head, so the hold I first wrote was inert - the mutation probe caught it (tapping at the end moved the head 512 -> 214). m.head is now wired to the head span.

Evidence

Each claim watched red with its guard removed, then green with it in:

probe result
hold removed red: tapping at the end moved the head 512 -> 214
chevron shown unconditionally red: a call with no detail got an affordance: "🔧 Bare [pending] ▸"
if (x !== undefined) guards removed in the model red: 2 model tests
display: block on .tool-detail red: detail after closing: display "block", height 145

The last one is why the CSS carries no display rule. A display on the class outranks the UA [hidden] rule, so a closed call stays on screen; a div is block by default, so the rule was only ever a liability. Note the view section builds its own container, so index.html CSS does not reach it - the first version of that assertion passed with the rule deleted, which is why the real-page check lives in page.

  • V5c tool expand (new): collapsed by default, no affordance on a payload-less call, opens without moving the head, survives unmount/remount, closes on the second tap.
  • P16 tool detail on the real page (new): drives /ui/ and reads computed display and pixel height.
  • view section 15/15, non-heavy page scenarios 15/15, transcriptModel 35/35, rc-gateway suite 2816 passed / 2 skipped, prettier + eslint + tsc --noEmit clean.

Deliberately not done

  • The detail is one bounded text block, not structured DOM. It is read once, and a bounded block cannot grow an unbounded row.
  • resetTurn() on every tool frame is kept as is: it is what keeps text after a tool row in its own bubble. rc-gateway: loopback-only second front for a same-host browser #63 pinned that.
  • No build step or restart is involved: webRoot serves public/ straight from the tree.

A tool row showed a label and a status and nothing else: the arguments it
went out with and whatever came back were dropped on the floor by the model,
so a call that failed could not be read without leaving the viewer.

The model now keeps rawInput and the result on the item, and a status-only
frame leaves both alone. An empty content is deliberately not a result:
reading it as one would leave every pending call showing an empty output.
The row renders the pair as one bounded text block when opened, and only a
row whose frames actually carried something gets a chevron, so a call with
nothing behind it does not look like it is hiding something.

Two things the virtualizer makes non-free:
  - estimate() has to count the expanded height, or the row jumps when it
    opens while still unmeasured (the #58 class of bug).
  - the tap has to hold the tapped line, or opening a call at the end pulls
    it up by the height of the detail. keepHeld() looks the line up as
    m.head, which tool rows never had, so the hold was inert until that was
    wired up; V5c taps the tail row to pin both.

The detail carries no display rule on purpose: naming one would outrank the
UA [hidden] rule and leave a closed call on screen, which P16 checks on the
real page (the view section builds its own container, so index.html CSS does
not reach it).
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