Repository navigation
[Idea] Fold surface-replaced history in the Web transcript (compaction and plugin replace markers) #11810
William20100221
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Motivation
When a surface
replacelands, the history it shadowed stays fully expanded in the Web/Desktop transcript. For compaction this is by design:CompactionSummaryNodesays the shadowed conversation "stays in the transcript above it" (packages/client/ui-conversation/src/client/contract/records.ts:186-191). In long sessions that means scrolling through many messages the model can no longer see, with no visual cue for where the model's context actually starts.The same mechanism is open to plugins:
SurfaceOpdocuments that "any surface-replacing producer may use it" (packages/core/session/src/types.ts:467). My plugin dsh-clear-conversation uses it so a user can say "clear everything above, then …" or type/clear: earlier turns are replaced by a short marker and stop being sent. Users then asked for the cleared messages to fold away, like the reasoning block, instead of staying expanded above the clear.A plugin cannot do this today:
ui-conversation/.../conversation/assembler.ts,exclusivehandling around lines 522-542), so a later replace event cannot reclaim rows other definitions already built.chattarget allows oneConversationGroupDefinition(conversation/group-registry.ts:24-38throws "already registered"), and ui-chat already registersprocessGroupDefinition(ui-chat/src/client/conversation-nodes/register.ts:37).The data is already on the wire: replacement events carry
surfaceOpandsourceEventSeqs(packages/api/session-controller/src/types.ts:462-464).Behavior
Proposed, Web and Desktop chat only; the session log and the model-visible surface do not change:
sourceEventSeqsshadow earlier transcript rows, the chat folds those rows into one collapsible block at the replacement point, collapsed by default, reusing the disclosure style of the reasoning row.conversation.chat.fold.headerkeyed by the marker'ssource.kind, with the default header as fallback.A smaller alternative that would also unblock plugins: an API for a client plugin to mark transcript rows as folded under a node it owns, or allowing more than one group definition per target.
Related but separate: #6850 asks for compaction hooks that change what the model sees; this idea only changes what the user sees.
Drafted with AI assistance and checked against the 0.2.1-rc.5 sources.
All reactions