fix(web): show the whole last turn in the Claude response viewer's brief view - #400
Open
shenlvkang-collab wants to merge 1 commit into
Open
fix(web): show the whole last turn in the Claude response viewer's brief view#400shenlvkang-collab wants to merge 1 commit into
shenlvkang-collab wants to merge 1 commit into
Conversation
…ief view
The eye button rendered `data.text`, which is one row: the last assistant
row of the transcript. A Claude answer is a median of 3 model messages
(p90 11) split around tool calls, so the brief view usually showed the tail
of an answer ("Done.", "Let me look.") and the substance appeared only after
More. The full view was fine, which is why the brief one read as broken by
comparison.
The brief view now asks `?context=turn`. The reader answers with the
assistant messages of the last ANSWERED turn (`selectLastAnsweredTurn`: the
highest `turn` that has an assistant row, so a prompt queued after the
answer does not blank the view) and the frontend renders them exactly as
the full view renders that turn: one badge, then continuation segments,
gated on the numeric `turn` as before.
`data.text` is unchanged in every context — still the last assistant row,
never `messages.at(-1)` — because agent pollers hash it. Readers that emit
no turns (Codex, the pane parser, DeepSeek, an older server) return `text`
only for `context=turn`, and the brief view keeps its single card for them.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01McLWqCWBuQYGuPMScb4Aou
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #369. The eye button's brief view rendered
data.text, which is one row: the last assistant row of the transcript. A Claude answer is a median of 3 model messages (p90 11) split around tool calls, so the brief view usually showed the tail of an answer ("Done.", "Let me look.") while the substance appeared only after More. The full view was fine, which is why the brief one read as broken by comparison.?context=turn. The Claude reader answers with the assistant messages of the last answered turn (selectLastAnsweredTurn()inresponse-viewer-transcript.ts: the highestturnthat has an assistant row, so a prompt queued after the answer does not blank the view), and the frontend renders them exactly as the full view renders that turn — one badge, then continuation segments, gated on the numericturnas before.data.textis unchanged in every context — still the last assistant row, nevermessages.at(-1)— because agent pollers hash it (skills/codeman/preamble.sh).textonly forcontext=turn, and the brief view keeps its single card for them. The terminal-buffer fallback is untouched.Docs:
skills/codeman/reference/endpoints.md(new row),docs/architecture-invariants.md(the viewer paragraph). Changeset: patch.Test plan
test/routes/session-routes-claude-last-response.test.ts:context=turnreturns the last answered turn's assistant rows (not the queued prompt after it) withtextstill the last row; empty list before the first answer.test/response-viewer-last-turn.test.ts(new): the pure selector (highest answered turn, no numeric turns → empty, turn 0 kept) and the brief view in jsdom (requestscontext=turn, one badge + segments, falls back totext, ignores user/blank rows).test/response-viewer-turn-segments.test.ts,test/response-viewer-transcript.test.tsunchanged and green.tsc --noEmit, eslint, prettier.🤖 Generated with Claude Code
https://claude.ai/code/session_01McLWqCWBuQYGuPMScb4Aou