Repository navigation
Smooth answer flow: real analysis stages and a calm arrival - #28
Merged
Merged
Conversation
- The fresh-answer reveal now covers an AADI analysis's sections (.analysis-document > *), not only a template's lines; 60 ms apart, capped at the eighth block, fixed nth-child delays instead of sibling-index(). - The answer's arrival (wait card out, answer and document pane in) runs in one named view transition: chat column, composer and header tools glide to their new width instead of snapping. CLS is unchanged because the layout change is intended; what changes is how it is drawn. - A fresh answer is scrolled to its top, so on a phone its first lines are no longer cut off; opened encounters and new questions still go to the bottom. - Soft pulse for the wait dot; removed keyframes and comments left from the old typing reveal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ta9C8RaPJ5eAJ3QcD1cHP
The wait card no longer shows one generic line for up to 65 s. When the workspace asks for it (Accept: application/x-ndjson), POST /api/aadi streams one line per gateway stage start and end (retrieve_dx, aadi_dx, retrieve_tx, aadi_tx, gate), then the exact reply (status and body) as its last line. Stage lines carry a stage name and state only: no case text, model output, cost, codes or timings. The answer is still sent once, validated and dose-gated exactly as before; model text is not streamed, because streamed text would show ungated doses. Without the header the route is unchanged, and the client falls back to plain JSON when a gateway does not stream. The wait card lists only the stages the gateway reported. Not verified here: that Cloudflare Access in front of the beta server passes lines through unbuffered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ta9C8RaPJ5eAJ3QcD1cHP
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Requested by Gafferness · project thread
Status: REVIEW. Gaffer approved the approach on 2026-11-26 ("A + B: tahap nyata + reveal halus"). Audit with evidence: https://claude.ai/artifact/6GnsdsmB5idFhLu4CCp7NT
Why
Before this change the doctor waited up to 65 s behind a single "Menunggu jawaban AADI" line, even though the gateway already times five real stages. When the answer arrived, the chat column snapped from about 980 px to 533 px in a single frame. The section reveal also skipped AADI analyses, because the CSS selector targeted the wrong container. On phones the view jumped to the bottom of the answer, so the doctor started reading in the middle.
Model text is not streamed, on purpose. The engine returns one structured result. The gateway validates it and runs the dose evidence gate, and the browser runs the gate again. Streaming the text would show doses that have not passed the gate yet.
Commit 1:
fix(ui): let an analysis arrive smoothly(client only).analysis-document > *: each block fades in over 480 ms, 60 ms apart, capped at the eighth block. All content is in the DOM from the first frame.smooth(update, "arrive"), a named view transition. The chat column, composer and header tools glide to their new size over 280 ms, with snapshots pinned to the top left so text is never stretched.Commit 2:
feat(aadi): show the analysis's real stages while it runsAccept: application/x-ndjson./api/aadistreams{"type":"stage","stage","state"}lines forretrieve_dx,aadi_dx,retrieve_tx,aadi_txandgate. The last line is{"type":"final","status","body"}, carrying exactly the reply the plain JSON request would have returned.docs/aadi-integration.mdgains an "Analysis progress" section, anddocs/sentrapedia-ui.mdis updated.Verification
tsc --noEmitis clean. ESLint reports 0 errors; its 3 warnings are pre-existing and in untouched files.vitest run: 90 files, 888 passed, 0 failed. New tests:tests/aadi-stage-stream.test.ts,tests/ui/answer-arrival.test.tsx, plus stage cases added totests/ui/thinking-card.test.tsx.Not verified
Porting
The public repo is regenerated from the private monorepo by export-split. Both commits must be applied there as well.
Generated by Claude Code