diff --git a/web/claw/README.md b/web/claw/README.md index f29eb09..6c13ed1 100644 --- a/web/claw/README.md +++ b/web/claw/README.md @@ -90,6 +90,11 @@ Two consequences worth knowing before changing this code: ## What the transcript does with the stream +- **Replies, asks and files only.** The stream carries tool calls and + the model's thinking trace; this surface drops both and renders the + reply. A consent card and an attachment card still appear inline, + because the reader has to answer or open them. The mirror still + folds those other events; only the render ignores them. - **Long pastes travel as chips.** A paste over three lines (the TUI's `PASTE_INLINE_LINES`) never lands in the composer; it stages as a droppable chip (`▣1 42L`) and embeds into the sent text as @@ -175,10 +180,10 @@ app/ raw HTML escaped, styles in main.css .md) ClawBanner.vue the one error/notice banner surface ChatPanel.vue transcript: sent lines (paste chips), - streamed turns as bash shell lines and - glyph rows, consent + attachment - cards; the growing composer; agent - replies render through AppMarkdown + streamed turns as reply text plus + consent + attachment cards; the growing + composer; agent replies render through + AppMarkdown SessionsSidebar.vue conversable dispatch keys (phone status keys hidden), interactive first; the + form creates a session diff --git a/web/claw/app/components/ChatPanel.vue b/web/claw/app/components/ChatPanel.vue index 924ff0b..88abfd6 100644 --- a/web/claw/app/components/ChatPanel.vue +++ b/web/claw/app/components/ChatPanel.vue @@ -136,20 +136,12 @@ watch( }, ) -// Thinking grows inside the trailing entry without changing the -// entries length, so its total length joins the watch to keep the -// stream pinned at the bottom. -function liveThinkingLength(): number { - return ( - props.live?.entries.reduce( - (count, entry) => (entry.kind === 'thinking' ? count + entry.text.length : count), - 0, - ) ?? 0 - ) -} - +// A consent or attachment card opening inside the trailing turn +// changes the rendered height, so the reply length and the entries +// length both join the watch that keeps the stream pinned at the +// bottom. watch( - () => [props.items.length, props.live?.reply.length, liveThinkingLength(), props.live?.entries.length], + () => [props.items.length, props.live?.reply.length, props.live?.entries.length], async () => { if (!pinned.value) return await nextTick() @@ -498,7 +490,6 @@ function streamTone(status: StreamStatus): 'ok' | 'warn' | 'error' {
{{ agentName }}
-// A turn's stream-ordered middle: tool rows, pieces of the thinking -// trace, the agent's asks, its handovers — each at the position the -// stream delivered it, so an ask sits at the tool call that raised it -// and thinking sits between the calls it precedes. +// The turn's middle, as the web surface shows it: the agent's asks +// (consent cards) and its handovers (attachment cards), each at the +// position the stream delivered it. Tool calls and the thinking trace +// stay off this surface; the reply is what it shows, and these two +// cards are the only things the reader must act on or can open. +import { computed } from 'vue' import type { TurnEntry } from '~/composables/useTranscript' import type { ConsentAnswer } from '~/composables/useClaw' -defineProps<{ +const props = defineProps<{ entries: TurnEntry[] - /** A live turn's thinking blocks start expanded; finished ones collapse. */ - openThinking?: boolean }>() +/** Cards only: a turn's tool rows and thinking blocks never render. */ +const cards = computed(() => + props.entries.filter((entry) => entry.kind === 'consent' || entry.kind === 'attachment'), +) + const emit = defineEmits<{ consentAnswer: [id: string, answer: ConsentAnswer] consentDeny: [id: string] @@ -20,21 +25,16 @@ const emit = defineEmits<{