Skip to content

feat(chat): streamed assistant text renders as visible jumps under burst arrival #602

Closed as not planned

Description

@mengmengjiang1999

Problem

While a reply is streaming, the chat UI renders the assistant message from the raf-flushed client store: at most one render per animation frame, but whatever bytes arrived get painted in full. Upstream delivery of stream frames is bursty (network/proxy buffering), so text visibly jumps — several sentences appear at once, pause, then jump again. Tool-call boundaries make this worse.

Current behavior

  • dsh-client-ui-chat renders the streaming text block (AssistantMarkdown → MarkdownText) directly from the store value.
  • Store notifications are already coalesced per frame (flush: "raf"), but there is no pacing of content, only of renders.

Expected behavior

Text should stream continuously: when a burst arrives, the UI can walk the displayed prefix toward the target a few characters per frame (catching up faster as the backlog grows), so bursts paint as smooth motion with a small (~100–200 ms) visual lag. Settled and historical messages must render instantly as today.

Suggestion

A small SmoothMarkdownText wrapper around the streaming text block: a rAF loop advancing a local shown prefix of the target text, bypassed entirely when not streaming. I have a working implementation as a replayable patch and will open a PR referencing this issue.

Activity

  1. yaojin3616 commented on Oct 28, 2026

    @yaojin3616
    Contributor

    Thanks for the proposal. We’re not planning to add client-side typing animation to smooth out buffered responses; we prefer to show received text immediately. Closing this request as not planned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions