Repository navigation
fix(native-chat): show arriving replies without markdown flashes - #26380
brennanb2025 wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe change adds source-preserving Markdown block splitting and streaming-tail repair. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No identified issue blocks merging. The streaming tail remains visible as its content grows. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the user impact, implementation, rationale, testing, and known limitations. However, it does not provide the required linked issue in the required format, and the required visual proof for this UI behavior change is still missing. Resolution Add a direct issue link and use the required issue-closing reference if applicable. Attach before-and-after streaming evidence, including the reduced-motion case, or write Full details: Docstring CoverageExplanation Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 8 files. (1 skipped: 1 unsupported.)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ELI5
Native chat replies arrive in chunks, and half-written markdown can briefly show raw
**or backticks while each update reparses the reply. Incoming text now appears immediately, unfinished formatting stays readable, and each new block fades in once while the reply streams.What Changed
Native chat opts into an optional streaming prop on the shared markdown renderer. Sidebar comments retain their existing whole-document rendering and formatting. Following the reply, scrolling and Jump to latest keep their current behavior.
Supersedes #26238 and credits @AmoabaKelvin for the reused top-level block splitter, its tests, and the incremental markdown rendering approach.
Why
Showing text as soon as it arrives and fading only inserted blocks follows the common pattern. Delaying received text or fading individual words would add latency without improving unfinished-markdown rendering, so this change repairs the tail directly with
remendand leaves delivery timing alone.Differences from the common pattern are intentional: parser-derived boundaries and reconsidering the last two blocks preserve loose lists, tables and block quotes; links and footnotes defined later in the reply, and HTML tags that can span paragraphs, use whole-document rendering to preserve their meaning at the cost of reparsing those exceptional replies. Existing handling of incomplete chat visualization directives remains in place because a partial directive cannot safely render a visualization. Intended: empty formatting openers are omitted until they have content, and code spans use matching delimiters even when their literal content contains a backslash or shorter backticks; this prevents raw-marker flashes without delaying prose. There are no temporary differences or scrolling changes in this PR.
Linked Issue
Supersedes #26238.
Visual Proof
Before/after streaming video and a reduced-motion capture are pending an exclusive remote QA host slot. No visual verification is claimed yet.
Testing
All 122 focused tests passed, covering immediate fragments, unfinished emphasis/code/link rendering, unchanged settled code controls, loose-list growth, late reference and footnote definitions, sidebar comments, existing visualization frames, and transcript following. Renderer typecheck passed through the machine queue and all 22 static checks passed before push. Final-head CI finished with 40 passing checks, five skipped checks and no failures. All ten unit-test shards, static analysis and typecheck, both package jobs and all six persistence jobs passed. The skipped checks were end-to-end UI tests, real input-method and Windows Subsystem for Linux terminal tests, the mobile main-only job and release-template assembly; they are not counted as passes. Remote rendered evidence is pending; Linux, Windows and live-provider/SSH streaming have not been exercised.
AI Disclosure
Review
Independent review pending.
Agent skill upstream boundary
Notes
This change is confined to renderer markdown and CSS, with no host execution, path, shortcut, persisted-state or remote protocol changes. The streaming prop is opt-in; other markdown surfaces keep their existing rendering path. Author: @BrennanKB5.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)