feat(studio): render structured AI conversations
Test / Tests and coverage
Intrepid/Prometeu/Studio/pipeline/head This commit looks good

Add reusable UI2 conversation balloons, tool cards, native Markdown, copy actions and controlled streaming scroll. Preserve typed ACP tool updates and chat lifecycle, add Alt+Enter sending, update specifications and qualify the UI through desktop tests. Include the Pong asset cache.
This commit is contained in:
2026-11-23 19:12:26 +00:00
parent ae7d01aa99
commit 481c479427
25 changed files with 1080 additions and 40 deletions
@@ -18,6 +18,13 @@ deletion MUST operate on local state. Loading persisted history and asset attach
MUST remain visibly disabled. Sending follows the ACP contract in specification 16.
The compact manager MUST expose a chat selector, New chat and an actions menu.
With the shared prompt focused, Alt+Enter MUST invoke the same Send action in both
the AI tab and the compact panel. It MUST respect Send availability and consume the
combination even when sending is unavailable, preserving the draft without adding
a newline. Enter alone MUST retain normal multiline editing. The shortcut MUST be
identified in the Send tooltip and accessible help in both languages; it MUST NOT
be installed as a window-wide accelerator.
The footer MUST retain the selected tab's information and reserve a fixed slot at
the right for an AI icon. The icon MUST have a localized tooltip, accessible name
and visible keyboard focus. It MUST expose a selected state and an accent
@@ -67,6 +74,60 @@ or opening another MUST start empty. No chat data MAY be saved by Studio in proj
database. Local creation/selection/rename MUST NOT start an ACP session; the first
send creates it lazily. The agent MAY retain its own independent history.
## Structured conversation component
The conversation MUST use a reusable component in the UI2 component set, replacing
its history TextArea while retaining the separate prompt compositor. It MUST consume
presentation data and MUST NOT parse ACP, launch processes or own authentication.
The same component MUST have a backend-free gallery specimen with replayable
streaming, Markdown, tools, failure and expansion.
Items MUST appear in one chronological sequence. User messages MUST use comic-style
speech balloons aligned right; assistant messages MUST use speech balloons aligned
left. Tool calls MUST use centered cards without speech-balloon shapes, with
left-aligned text. Balloon widths MUST adapt to the available space and have a
readable maximum. Long code MUST scroll horizontally inside its block; the
conversation itself MUST NOT require horizontal scrolling.
Only the assistant balloon under construction MAY receive text deltas. Its text
selection MUST be disabled. Finalized balloon content MUST be immutable; theme,
scale and width changes MAY reflow the same content. A new tool call between
assistant text segments MUST finalize the preceding balloon, and subsequent text
MUST create another balloon. Updates to an existing tool MUST retain its card's
position and MUST NOT rewrite previous balloons. Empty assistant balloons and one
balloon per text delta MUST NOT be generated.
Assistant messages MUST render CommonMark headings, paragraphs, lists, emphasis,
links and code using a native renderer. HTML MUST remain inert text and images
MUST NOT trigger resource downloads. Finalized messages MUST allow local text
selection and the platform copy shortcut. Selection across multiple messages is
not required. Earlier finalized messages MUST remain selectable while another
balloon streams. Each balloon MUST offer copying its original text, preserving
Markdown; while streaming, this copies the currently received snapshot. Code-copy
controls MUST copy only the code. Copy feedback MUST be brief and preserve layout.
Tool cards MUST display a readable title and state, with details initially
collapsed. Transitioning to failure MUST expand the card once; users MUST be able
to collapse it again without subsequent updates reopening it. Expanded details
MUST show only input, output and content actually supplied by the agent. Missing
details MUST be identified without inventing a command or result. Non-shell tools
such as read, search and edit MUST use the same card family.
The conversation MUST follow new content while the user is at its end. Manual
scrolling MUST suspend following without stopping generation or reception. Returning
to the end MUST resume following. New content below the suspended view MUST expose
a localized Go to latest control that resumes following. Updates, expansion and
resize MUST preserve reading position when following is suspended. Recycled cells
and switching chats MUST preserve per-chat expansion and reading/following state.
User balloons MUST retain submitted text with delivery/failure metadata separate
from immutable content. Existing acknowledgement, draft preservation and manual
recovery rules MUST remain effective. Turn completion, failure and cancellation
MUST be explicit. Tool status MUST NOT imply success merely because the turn ended.
Rendering MUST use incremental item updates and bounded batching rather than
replacing all finalized content for each delta. Content limits and retirement
follow specification 16 and MUST be visible to the user.
## Studio preferences
Studio preferences MUST contain an AI / ACP section identifying Codex as the initial
@@ -66,12 +66,37 @@ it; edits made while sending MUST survive. The submitted text and failures MUST
remain in the conversation. Recover last request MUST copy that text only into an
empty draft. Failed work MUST NOT be automatically resubmitted.
The log MUST show user text, streamed agent text, tool activity and terminal
result/error/cancellation. Thought content MUST NOT be stored or shown; generic
working activity MAY be shown. Current activity and connection state MUST remain
visible, including the running chat identity when another chat is selected. The
Studio log is a bounded plain-text view (last 200,000 characters per chat), not an
authoritative persisted agent history.
The conversation MUST retain separate typed items for user messages, streamed
assistant segments, tool calls and terminal results. Thought content MUST NOT be
stored or shown; generic working activity MAY be shown. Current activity and
connection state MUST remain visible, including the running chat identity when
another chat is selected. Presentation follows specification 15.
The JavaFX-free port MUST preserve tool identity, title, category, state, input,
output and supported content from ACP tool_call/tool_call_update notifications.
Updates MUST route by session and toolCallId. Omitted/null optional fields MUST
retain prior values; explicit empty content MUST clear content. Supplied snapshots
MUST replace their corresponding fields rather than being concatenated as deltas.
Unsupported content MUST NOT be presented as invented shell output. Missing terminal
tool status at turn completion MUST remain an unconfirmed/interrupted outcome.
Studio's conversation remains transient and bounded, not an authoritative persisted
agent history. Its reducer MUST limit each message/content/output field to 64,000
UTF-16 code units, tool input to 16,000 and title to 1,000. New tool identities MUST
be nonblank and at most 512 code units. A turn MUST admit at most 256 content items
plus its terminal result, with a shared 200,000-character budget across message text,
titles, input and output; terminal error detail MAY add at most 1,000 characters.
Omitted fields MUST remain unchanged even at the budget boundary. Truncation MUST
preserve UTF-16 surrogate pairs and be indicated visibly. Oversized transport fields
MUST also be bounded before dispatch and carry an explicit truncation marker.
Completed older turns MUST be retired as complete turns to retain at most 200,000
characters, 512 items and 20 turns, subject to retaining the newest turn intact
within its own admission limits. The active turn MUST remain retained while running
and MAY temporarily coexist with that completed history budget. History retirement
and admission limits MUST produce a visible localized notice. Virtualization MUST
NOT be treated as a data-memory limit. Repeated deltas or snapshots after reaching a
limit MUST NOT create unlimited empty balloons or entries.
Connection loss MUST invalidate bound session IDs. Retained transcripts MUST remain
readable, with explicit guidance to create a new chat after reconnecting. Studio MUST