Skip to content

fix(native-chat): show arriving replies without markdown flashes - #26380

Closed
brennanb2025 wants to merge 2 commits into
mainfrom
brennanb2025/native-chat-reply-arrival
Closed

brennanb2025 wants to merge 2 commits into
mainfrom
brennanb2025/native-chat-reply-arrival

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​250 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​250
Prod 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​211 $\color{#cf222e}{\Huge{\mathbf{−}}}$​11 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​200

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

Before After
A reply is parsed again as a whole on every update. Unchanged blocks reuse their rendered result; the growing tail updates immediately.
An unfinished bold phrase, code span or link can show raw markup. The streaming tail closes unfinished emphasis and code spans, and incomplete links show their label until their destination arrives.
New paragraphs and code blocks pop in. Newly inserted top-level blocks fade in for 600 ms using opacity only; words inside an existing block appear immediately. Reduced motion and opening a finished chat skip the fade.

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 remend and 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

  • Automated tests added/updated, or explained why not below
  • I manually tested these changes locally

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

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

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

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3b1c96de-666c-409a-83e1-fd3ff25019b8
📥 Commits

Reviewing files that changed from the base of the PR and between a86ae3d and 7ad10a8.

📒 Files selected for processing (1)
  • src/renderer/src/components/native-chat/native-chat-markdown.css
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/components/native-chat/native-chat-markdown.css

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The change adds source-preserving Markdown block splitting and streaming-tail repair. CommentMarkdown now renders individual blocks and accepts a streaming prop. NativeChatMarkdown forwards that state, and streaming content receives a reduced-motion-aware fade-in rule. Tests cover block splitting, tail repair behavior, and streaming renders.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 7ad10

No identified issue blocks merging. The streaming tail remains visible as its content grows.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning 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 vis… 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 N/A with a valid explanation if there is no visual or interaction …
Docstring Coverage ⚠️ Warning 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: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: preventing markdown flashes while native-chat replies stream.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

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 N/A with a valid explanation if there is no visual or interaction change.

Full details: Docstring Coverage

Explanation

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.)

  • Fix all pre-merge checks with AI
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Closing in favour of #26238, which merged as 3c07588. It covers the same thing: replies show as they arrive with no raw markdown flashing, and it also adds the per-word fade and smoother following.

@brennanb2025
brennanb2025 deleted the brennanb2025/native-chat-reply-arrival branch October 12, 2026 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant