mirror of
https://github.com/coder/coder.git
synced 2026-11-10 19:24:37 +08:00
## Problem When streaming completes in the agent chat, `<p>` elements inside list items visually break out of the `<ul>`, rendering as `<ul> → <li>` then `<p>` after `</ul>` instead of staying nested as `<ul> → <li> → <p>`. ## Root Cause The `Response` component overrides streamdown's default `li` component to handle GFM task-list items (suppressing bullets when a checkbox is present). However, this override drops streamdown's built-in `[&>p]:inline` CSS class from `MarkdownLi`. When the final markdown from the LLM contains blank lines between list items, `remark-parse` treats it as a **loose list** per the CommonMark spec and wraps each item's content in `<p>` tags. Without `[&>p]:inline`, those `<p>` tags render as block elements with default margins, visually pushing content outside the list. During streaming this is less noticeable because `remend` preprocesses incomplete markdown and the list items tend to arrive without blank-line separators (tight list → no `<p>` wrapping). ## Fix Remove the custom `li` override entirely. Streamdown's built-in `MarkdownLi` already handles both: - Task-list bullet suppression - Paragraph nesting via `[&>p]:inline` The custom `input` override for styled checkboxes is unaffected since it's a separate component.