Keep single line breaks in `clai2` web UI assistant Markdown, matching the TUI

Merged
MP
1mo ago
+37-4

Fixes #11297

Why we make these changes

The clai2 web UI's marked instance used breaks: false (#11297), so single line breaks in assistant Markdown became spaces: 1\n2\n3 rendered as 1 2 3. The TUI (termflow) keeps each source line, so the two UIs disagreed. This sets breaks: true in web-ui/src/markdown.ts and rebuilds the committed bundle (only app.js changes: breaks:!1 to breaks:!0).

New public surface

none

User-visible behavior

model output:  "One per line\n2\n3"
before (web):  One per line 2 3
after  (web):  One per line
               2
               3

Fenced code blocks are unchanged (they never contain <br>). Thinking text uses the same renderer, so it keeps single line breaks too, matching the TUI.

Verification

  • New browser regression test_single_line_breaks_survive_like_the_tui in tests/clai2/browser/test_web_browser.py: failed before the fix with 'One per line 2 3' != 'One per line\n2\n3', passes after. All 4 browser tests pass locally (CLAI2_BROWSER_TESTS=1 uv run --group clai2-browser pytest tests/clai2/browser).
  • Bundle rebuilt with npm ci --ignore-scripts && npm run build on Node 24.22.1 (.nvmrc).
  • ruff and pyright clean on the changed test file.

What changes for existing users

Single line breaks in web UI assistant and thinking Markdown now render as line breaks, as in the TUI.

PR decisions
  • pre-push review 1 of 3 at b4c71f0e1: remediated (fixture docstring no longer says "two live sessions"); follow-up 2733142ce is docstring-only.

Checklist

  • No breaking changes in accordance with the version policy.
  • Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
  • PR title is fit for the release changelog.