# Progressive disclosure and live control in a coding agent workspace

Author: Chris Chabot
Canonical URL: https://chabot.dev/blog/progressive-disclosure-and-live-control-in-a-coding-agent-workspace/
Published: 2026-08-27

How a coding-agent workspace keeps deeper views on the real sandbox, tracks reader scroll intent with hysteresis, and lets voice steer running turns without a copy of task state.

As a coding agent churns through its work, it's not always obvious what it has produced, or whether what it has produced is the right thing. At the same time, coding agents produce at breakneck speed, so the answer isn't to dump all the source code and data on screen all the time.

The answer is careful progressive disclosure: a message stream tells you, at a high level, what's being done, and whenever you want to go deeper you can view and expand diffs, click a file name to open a rich file view in a side pane, explore the project's file tree, and see the live preview of your web app right next to the context where you are building it.

All of this adds up to a UI that is agile in displaying data, with smart panels that can be moved, resized, configured or removed when they aren't useful anymore.

I built this as a React web application where you work with a coding agent through a chat thread, each thread backed by its own hosted sandbox on E2B. Making progressive disclosure and live steering dependable requires three things underneath: deeper views read the real sandbox rather than a copy, the transcript tracks reader intent explicitly instead of guessing from scroll position, and voice control steers running work through the same state. Because the client state and interaction logic live in a headless shared layer beneath the React components, swapping out the rendering layer later kept those behaviors intact.

## Panels backed by the real sandbox

Because an agent touches the same files across turns, panel identity is content-addressed from a file path, diff path, or URL, alongside fixed IDs for workspace-wide views like the file tree and terminal. Reopening a file or diff that is already on screen updates it in place and focuses the existing tab instead of spawning duplicates.

The usual shortcut for a tabbed web terminal is to unmount it when hidden and replay a scrollback buffer on return. Here, the terminal mounts once and stays mounted while inactive, keeping the PTY and its WebSocket tunnel alive until the tab closes or you switch threads. Collapsing a hidden tab makes an auto-resizing terminal report zero dimensions, which would drive a one-row PTY resize and scramble running output, so the resize handler ignores degenerate updates until the tab is visible again. Saving the layout across a reload restores the open tabs, not the shell process itself; a reloaded tab starts a fresh shell in the same sandbox.

Progressive disclosure only works for verification if deeper views read the environment the agent is actually mutating. Both the terminal and the file viewer connect directly to the thread's E2B sandbox through authenticated server endpoints; when a file is unreadable or the sandbox is temporarily unavailable, the viewer reports the failure rather than reconstructing file contents from the transcript.

## Tracking reader intent in a streaming transcript

Pinning a streaming transcript to the bottom whenever the viewport sits within a fixed distance of the end breaks down as soon as the document changes shape mid-read. Distance from the bottom records where the viewport is, not how it got there. Late-mounting blocks such as diffs spike that distance with no gesture and make a following reader look scrolled up, while unmounting status placeholders shrink the list and clamp the scroll offset to the bottom, pulling a reader who had scrolled up back into follow mode.

Modeling reader intent explicitly takes a three-state controller: `idle`, `following`, and `detached`. During a live turn, the controller starts following within 80 pixels of the bottom, but once the reader detaches, it resumes only within 8 pixels. That hysteresis solves an immediate failure of symmetric thresholds: one keyboard scroll step moves the viewport 16 to 32 pixels, so under a single 80-pixel threshold, tapping upward leaves you inside the capture band and the next streamed chunk pulls you straight back down. With an 8-pixel re-engage threshold, that same upward step stays detached while output continues arriving below.

Waiting for a browser `scroll` event to detect detachment fails because scroll events fire asynchronously and conflate user input with programmatic anchoring and layout reflow. Instead, the controller enumerates detaching gestures and transitions synchronously on the input event: upward wheel input, scrollbar drags, touch scrolling, text selection inside the transcript, and upward navigation keys such as `ArrowUp`, `PageUp`, `Home`, and `Shift+Space`.

## Voice control over the same thread state

Bolting a standalone voice assistant onto a coding workspace is the obvious first design, and it fails as soon as the coding agent moves ahead in the background and the voice summary drifts from the real execution state. Instead, the browser holds a direct WebRTC call with OpenAI's Realtime API so audio stays off the application server, while the speech model's tool calls dispatch onto the same thread and turn operations the web UI uses, with no voice-side copy of task state.

Steering a running turn by voice widens a familiar race: the turn you meant to redirect can finish before the tool call reaches the server. Every redirect therefore carries the ID of the turn it expects to be active, acting as an optimistic concurrency check. If that turn has already ended, the server returns HTTP 409, and only on a 409 does the dispatcher fall back to starting a fresh turn with the instruction. Any other failure, such as a timeout or a 5xx response, surfaces as an error instead, because an ambiguous failure can hide a redirect that already succeeded, and falling back anyway would deliver the instruction twice.

Because speech lacks the precision of clicking a specific thread or approval button, ambiguity goes back to the speaker. If a reference like "the auth one" matches several threads, or if multiple approvals are pending at once, the dispatcher returns the candidates to the speech model to ask for clarification rather than guessing. Direct voice confirmation applies only when a single approval is waiting; a misheard "yes" still counts, though restricting it to one pending request limits what a transcription error can approve.
