Repository navigation
fix(chat): keep the Preview pill up while streaming, call the panel Preview - #70
Merged
Merged
Conversation
…review
After a build, asking 'What did you build?' streamed an answer with no
Preview button above the composer on a phone — the one persistent way
back to the page was hidden exactly when the person looked for it.
The build prompt also taught the model the wrong name ('side-by-side
Outputs preview panel'), which it then repeated, and the panel itself
was labelled 'Tabs', a third name for the same place.
- Drop the streaming guard on the Preview memo: lastPage only returns
closed fenced blocks, so a half-written fence is never a page.
- Build prompt now says the page 'opens as the Preview beside the
conversation', matching about.ts.
- Panel label 'Tabs' -> 'Preview' (desktop side panel + mobile sheet).
- Two new lastpage tests pin the streaming-safety property.
Fixes hanzo-inc/app#443
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.
PR — hanzoai/app: fix(chat): keep the Preview pill up while streaming, call the panel Preview
Branch:
fix/443-preview-panel(based on358f9e2, @hanzo/app 0.3.100)Commit:
7550e9aWork dir:
~/workspace/prs/443/repo/— fresh depth-1 clone of hanzoai/app, patch applied and re-verified (git apply --checkclean).Status: NOT pushed, NOT opened as a PR. No GitHub auth on this VM — push +
gh pr createstill need Zach's device-code login (running separately).Title
fix(chat): keep the Preview pill up while streaming, call the panel PreviewBody
Fixes hanzo-inc/app#443 — after Enso built a landing page on hanzo.app (mobile Safari), it said "The page is live in the Output panel", but Zach could find no Output tab, and asking "What did you build?" left him with no Preview button while the answer streamed.
hanzoai/app main already had a partial fix (
about.tscalls the place "the Preview",PreviewButtonabove the composer, auto-open on build end), but three holes remained:Chat.tsxdemoNotetold it the page "renders live in the side-by-side Outputs preview panel" — the literal words Enso then repeated. Now: "opens as the Preview beside the conversation", matchingabout.ts.chat.streaming ? null : lastPage(said)). After a build, "What did you build?" starts a long streaming answer, and the per-answer Preview button scrolls away with it — so the one persistent way back to the page was hidden precisely when it was looked for. The guard is dropped; this is safe becausewritten()only returns a fenced block that is closed, and reaches back past answers that wrote none to the last finished page.label={t("Tabs")}, desktop side panel and mobile sheet alike, while the button andabout.tscall it "Preview" (and the summary card calls it "Outputs"). Nowt("Preview")in both places. Per-tab file names and the "Outputs" summary section are unchanged.Two new tests in
lastpage.test.tspin the streaming-safety property: an unclosed fence mid-stream returns the earlier finished page; a closed fence in the streaming turn already returns that page.Tests
Run in a scratch vitest harness (
~/workspace/prs/443/harness/, outside the repo — not committed), because this VM has no pnpm and nonode_modulesin the clone:vitest run src/lastpage.test.ts src/about.test.ts(vitest 3.2.7) — 10 passed, 0 failed:lastpage.test.ts5/5 (3 pre-existing + 2 new),about.test.ts5/5 (no regression in the "call it the Preview" wording).esbuildparse of the editedChat.tsx— clean, no syntax errors.Caveats, for the reviewer: the harness mocks
@hanzo/buildexactly as the repo test does, and replaces@hanzo/personaswith a minimal front-matter stub (the realteam.gen.tsdata is copied verbatim). Not run here: fullvitest run,tsc --noEmit, or a real mobile render — CI must run those before merging. The demo-prompt wording change has no repo test covering it; it needs a human/CI pass.Closing #443 — read this before closing
Do not close hanzo-inc/app#443 on this merge alone. This PR changes hanzoai/app; nothing changes on hanzo.app until:
@hanzo/apprelease is published,Close #443 only when the fix is live on hanzo.app. (Same release-order pattern as hanzoai/ui#327 → host bump.)
To open the PR (once GitHub auth is ready)