Skip to content

fix(transcript): allow scrolling up while agent is busy, add scroll-to-bottom button - #127

Merged
edenreich merged 5 commits into
mainfrom
fix/issue-126
Aug 18, 2026
Merged

edenreich merged 5 commits into
mainfrom
fix/issue-126

Conversation

@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

Resolves #126

Summary

The message transcript previously forced scrollTop = scrollHeight unconditionally on every content change, which prevented users from scrolling up to read earlier messages while the agent was busy streaming a response. This change tracks whether the user is at the bottom of the scroll container and only auto-scrolls when they are; when scrolled away from the bottom, a floating scroll-to-bottom button appears.

Changes

  • Transcript.tsx: Replaced unconditional auto-scroll with scroll-position-aware logic. A ref tracks whether the user is near the bottom (within 60px threshold). The auto-scroll effect only fires when the user is already at the bottom, letting them freely scroll up to review earlier messages while the agent streams.
  • Scroll-to-bottom button: A floating ChevronDown button (circular, shadow, bottom-right) appears when the user scrolls up away from the latest content. Clicking it jumps back to the bottom and hides the button.
  • The transcript container is now wrapped in a relative div so the absolute-positioned button overlays the scroll area properly.

@inference-gateway-maintainer
inference-gateway-maintainer Bot marked this pull request as ready for review August 18, 2026 20:23
Comment thread frontend/components/Transcript.tsx Resolved
Comment thread frontend/components/Transcript.tsx Resolved
Comment thread frontend/components/Transcript.tsx Resolved
@edenreich
edenreich merged commit 917ddee into main Aug 18, 2026
@edenreich
edenreich deleted the fix/issue-126 branch August 18, 2026 22:55
edenreich added a commit that referenced this pull request Aug 19, 2026
…s inside the chat area

The scroll-to-bottom change (#127) wrapped #chat-transcript in a plain block div, which made its flex-1 and overflow-y-auto inert: the transcript grew with its content and long conversations floated over the composer instead of scrolling. Make the wrapper a flex column and bound the transcript's height again.

The e2e harness gains an assert_above_composer step that checks real AX geometry (a button's bottom edge must sit above the composer textarea), plus a transcript-overflow test that fills the chat and asserts the pending approval card stays inside the conversation area. The assertion was verified to fail on the broken layout and pass on the fixed one.

The harness also stops testing a stale CLI: unless INFER_BIN overrides it, the runner downloads the latest released infer once per suite (falling back to the dev environment's PATH offline), so e2e exercises the version users actually run instead of the flox pin.
edenreich added a commit that referenced this pull request Aug 21, 2026
* chore: update infer CLI to v0.175.0

* feat(computer-use): render sessions in transcript, add always-on-top monitor window

Implements #70 on top of CLI v0.175.0: computer-use tool calls render through the existing tool path, a second always-on-top Tauri window (docked bottom-right) shows per-session status, latest action, approve/deny, pause/resume, and stop controls, approval requests raise a system notification when the main window is unfocused, and the desktop exports INFER_COMPUTER_USE_APPROVAL=destructive so risky actions are gated out of the box.

* fix(e2e): isolate HOME per run, pin CLI via INFER_BIN, repair project-grouping test

The harness previously spawned the app against the real ~/.infer, so every run polluted the user's conversation store and silently tested whatever stale CLI was installed. Each mock run now gets a scratch HOME under e2e/artifacts and INFER_BIN points at the dev environment's pinned infer. Also fixes the project-grouping test, which could never pass: its prompt had no matching mock scenario and the driver rejected letter keypresses.

* feat(computer-use): visualize agent actions with a click-through screen overlay

A third transparent, always-on-top, click-through Tauri window covers the screen while computer-use actions stream: a cursor dot glides to each MouseMove/MouseScroll target, a ring ripples on MouseClick, and a key-cast pill at the bottom shows the text or key combo the agent is typing. All animation is CSS inside the webview, so there is no per-frame IPC, and the same approach works on macOS, Windows, and Linux (macOS additionally needs the macos-private-api flag for transparency). Also corrects the computer-use tool names to the CLI's actual PascalCase identifiers (MouseClick, KeyboardType, ...) - the snake_case names from the issue text never matched.

* feat(computer-use): screen-edge glow while agent controls the screen, overlay and e2e driver fixes

The overlay now shows a rounded breathing border at the screen edges for the whole computer-use session, not just around individual actions, so it is always clear the agent is in control. Overlay sizing uses primaryMonitor with a retry at wake time (currentMonitor returns null for a hidden window, which left the overlay at its 200x200 default and clipped every effect). The e2e driver addresses the main window by title for AX and screenshots - window 1 and largest-window heuristics both break once the fullscreen overlay is visible. The computer-use scenario now exercises MouseMove, MouseClick behind the destructive approval gate, and KeyboardType, and the Taskfile documents single-file filtering: task e2e -- tests/computer-use.yaml

* fix(computer-use): single frontend entry keyed by window label

The monitor and overlay windows loaded their own HTML entries, and when multi-page asset resolution fell back to index.html the overlay rendered the full app - transparently, fullscreen, on top of everything (the white screen and the ghost UI over the composer). All windows now load the single index.html entry and main.tsx picks the component by Tauri window label, so the wrong-page failure mode no longer exists. The overlay forces a transparent body since the shared stylesheet paints one.

* fix(transcript): attach orphan tool results, expire stale approvals, report user stop as cancelled

A ToolResult whose tool_call_id does not match any tool card (the CLI sometimes emits an empty id) now attaches to the newest unresolved tool card instead of appending a duplicate. Pending approval cards flip to an inert "Session ended" state when the run finishes, instead of keeping live Approve/Deny buttons that can only fail with "No running agent". Stopping the agent (Stop button, monitor, shutdown) now emits Cancelled instead of a synthetic "Process exited with code -1" error banner; a real signal death still reports the error.

* fix(transcript): restore transcript scrolling, keep long conversations inside the chat area

The scroll-to-bottom change (#127) wrapped #chat-transcript in a plain block div, which made its flex-1 and overflow-y-auto inert: the transcript grew with its content and long conversations floated over the composer instead of scrolling. Make the wrapper a flex column and bound the transcript's height again.

The e2e harness gains an assert_above_composer step that checks real AX geometry (a button's bottom edge must sit above the composer textarea), plus a transcript-overflow test that fills the chat and asserts the pending approval card stays inside the conversation area. The assertion was verified to fail on the broken layout and pass on the fixed one.

The harness also stops testing a stale CLI: unless INFER_BIN overrides it, the runner downloads the latest released infer once per suite (falling back to the dev environment's PATH offline), so e2e exercises the version users actually run instead of the flox pin.

* refactor(computer-use): broadcast agent events from the backend, drop the main-window re-broadcast

Agent events reached the monitor and overlay windows by the main webview re-emitting every Channel message as a global "agent-event" - an extra IPC hop that also tied the secondary windows to the main window being alive. The backend now emits the same payload to all windows itself (tauri Emitter alongside the ordered per-run Channel that feeds the transcript), and the frontend re-broadcast is gone. Monitor and overlay are unchanged consumers.

* fix(overlay): draw cursor in real screen position, keep the glow frame visible

Tool-call coordinates arrive in the CLI's 1024x768 screenshot space; the overlay now scales them to its own CSS pixels instead of drawing them raw, so the dot and ripple land where the click actually happens.

The overlay window now covers the monitor work area instead of the full bounds, so the glow frame's top edge is no longer hidden under the macOS menu bar.

* fix(computer-use): hide overlay and monitor windows from screen capture

contentProtected maps to NSWindowSharingNone, so the agent's full-display captures no longer show the monitor - it kept trying to click the Approve button it saw there, deadlocking behind its own approval gate.

* feat(monitor): expandable companion window with log, frame thumbnail, composer, and A/R approvals

The monitor now keeps a capped action/text log with the latest captured frame (base64 from the tool result, since frame files are short-lived), expands to reveal a composer that round-trips follow-up prompts through the main window via monitor-send so the transcript stays in sync, and stays open after a run ends.

Approvals sync both directions (main window now emits approval-resolved), and while one is pending the global shortcuts A/R approve or deny without touching the mouse - a hand still on the mouse was dragging the pointer off the agent's synthetic click target.

* fix(overlay): cover the Dock without tripping macOS window constraining

Extend the overlay from the work-area top (macOS shifts any window overlapping the menu bar) down over the Dock; the backend raises the window to NSStatusWindowLevel so it draws above the Dock.

* fix(overlay): map tool coordinates with a single uniform scale factor

The CLI now fits frames inside the 1024x768 box with one scale factor (aspect preserved), so the overlay's inverse mapping uses the same single factor for both axes.

* feat(transcript): render base64 tool-result frames as thumbnails

Computer-use frames and region crops arrive base64 in the tool result with no file path; the transcript now renders them (download button hidden when there is no on-disk file), so the user can see exactly what the model saw.

* chore(deps): update claude-code and infer

* fix(computer-use): track the CLI's 2-tool computer-use surface

infer v0.178.0 collapsed MouseMove/MouseClick/MouseScroll/KeyboardType/
GetFocusedApp/ActivateApp into a single action-based Computer tool, leaving
Computer and GetLatestFrame. The overlay and monitor matched on the removed
names, so against a current CLI the overlay never lit up and the monitor
never auto-opened.

overlayAction now switches on args.action rather than the tool name, picking
up the arg renames (key_combo -> combo, scroll's dy -> direction/amount).
Observation carries no json tags, so parseToolResult falls back to Message
before stringifying data - otherwise every Computer result rendered as a JSON
dump containing the base64 frame. The monitor's approval prompt shows the
args, since "Allow Computer?" no longer says what is about to happen.

Under INFER_COMPUTER_USE_APPROVAL=destructive the CLI now gates every action
except screenshot and cursor, so the e2e scenario pairs an ungated cursor
turn with a gated click turn.
@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 0.19.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@inference-gateway-maintainer inference-gateway-maintainer Bot added the released Shipped in a release label Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Cannot scroll up while the agent is busy; no jump-to-latest affordance when scrolled up

1 participant