Show formatted notes as the assistant writes - #1105
Draft
koutst wants to merge 2 commits into
Draft
Conversation
Contributor
|
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.



AI-generated notes currently preview as plain text while the assistant writes. Render structured draft blocks with Tiptap’s
generateHTML()and the live editor’s existing extensions, preserving headings, paragraphs, emphasis, and lists. Show a small “Drafting · Preview updates live” indicator and keep the duplicate draft in chat collapsed by default.Consumes optional replacement
blockssnapshots from ResearchHub/researchhub-backend#4116. The preview reuses the assistant HTML sanitization policy, retains the last renderable snapshot when a node is incomplete, and resets when the stream or draft changes. Older servers retain a plain-text fallback. The empty editor is hidden during initial drafting but stays mounted; partial blocks are never written into it or autosaved. No new frontend dependency is needed.Validation: ESLint on changed files and a full TypeScript check pass. A real local generation using this PR checkout displayed five headings, eight bullet items, seven numbered steps, and bold/italic text while still running. The note completed and saved successfully. Verified the narrow document drawer layout.
Live-test detail: the model’s first save omitted required paragraph wrappers in list items. Existing note validation rejected it, and the model corrected the blocks and saved on retry. The completed note remained formatted after reload.