[GH-ISSUE #4722] [GUI] one reply uses three text widths: paragraphs cap at 56ch while lists and tables use the full 864 px, because the list cap targets a class the renderer never emits (.md-li) #2161

Closed
opened 2026-11-04 01:57:09 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @xvcezrqpbxtpzblrt on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4722

2026-11-06 核对结果:已修且已在装机 0.2.11 CSS 中生效——.st-msg--assistant .st-bubble :is(p,ul,ol,blockquote){max-width:var(--st-measure)}(dist/assets/index-Dor2RFX-.css)。CJK 每行约 28 字的残余已由 Niko1221 移入 #5066。可关单;如实测段落与列表仍不齐请带场景。


Area

[GUI] (the desktop app)

Desktop app, Terminal or source?

Desktop app (Windows)

What happened

Inside one assistant reply, the text is laid out at three different widths, so part of the answer looks as if it were written for a wide screen and part for a narrow one:

  • prose paragraphs wrap early, in the middle of a sentence, with a large unused margin on the right;
  • the bullets and numbered points under them run to nearly the full column;
  • tables and code blocks run to the full column again.

With Chinese text the difference is very visible, because the paragraph cap lands at about 30 Chinese characters per line while the list items reach roughly 55. It is not the model: the same answer, the same bubble, three measures.

Cause, in the shipped 0.2.8 stylesheet (host/dist/assets/index-ycN8HD_X.css):

--st-measure: 56ch
.st-msg--assistant .st-bubble p,
.st-msg--assistant .st-bubble .md-li { max-width: var(--st-measure) }

The cap is written for paragraphs and list items, but the renderer never emits the class md-li: the list branch pushes a bare <ol>/<ul> with plain <li> children (https://github.com/Niko1221/Strata/blob/v0.2.8/apps/host/src/components/Markdown.tsx#L103-L113), and the compiled UI bundle index-CpwV4C51.js contains the string md-li 0 times. So the selector's second half matches nothing: <p> is capped, <li> and <table> are not.

Measured, using the app's own stylesheet and its own markup (.chat__inner fixed at its 920 px maximum, headless Edge 1.4k window, the chat font this install resolves from --st-content-fs):

box measured width CJK characters per line
.chat__inner 920 px —
.st-msg / .st-bubble 864 px —
<p> inside the bubble 460 px 30
<li> inside the same bubble 824 px ~55
.md-table 864 px —

The second problem is the unit itself: ch is the width of the digit 0. At the 14 px chat font, 56ch ≈ 460 px, which is ~30 Chinese glyphs but ~90 Latin characters. So the intended reading measure is script-dependent: it reads as "comfortable" in English and as "half a column" in Chinese, and any reply that mixes prose with lists shows both at once.

Smallest steps or command that reproduce it

In the app:

  1. Open the desktop app and a chat.
  2. Send: 用中文写一段90字左右的段落,然后写三条同样长度的中文要点,不要空行以外的分段.
  3. The paragraph breaks at roughly 30 characters per line, leaving a wide right margin; the three bullets break at roughly 55 characters per line, in the same bubble.

Off the app, to get the numbers above:

  1. Take host/dist/assets/index-ycN8HD_X.css from an installed 0.2.8.
  2. Make a page with the app's markup skeleton — .app > .chatcol > .main__body.chat > .chat__inner > .st-msg.st-msg--assistant > .st-bubble > a <p>, a <ul><li> and a <div class="md-table-wrap"><table class="md-table">, each filled with the same Chinese sentence — and set .main__body.chat{width:1200px}.
  3. msedge --headless=new --window-size=1400,900 --dump-dom file:///…/measure.html and read getBoundingClientRect().width for the three elements: 460 / 824 / 864.

Reproduction status

Confirmed by measurement — the widths in the table are read from the shipped stylesheet rendered in a browser, and the person at the keyboard sees the same effect in the app. The dead .md-li selector is confirmed both in the source at v0.2.8 and in the compiled bundle shipped inside the app.

Strata version

Strata 0.2.8 — app 0.2.8, Control and engine 0.1.54.

Graphics card, memory and system

NVIDIA GeForce RTX 3080 Ti Laptop GPU 16 GB - 64 GB RAM - Windows 11 Pro build 26300

Model, size and settings

Qwen3.8-Flash-Next IQ3_S, 384K context. The model only supplies the text; the layout difference is CSS, and it appears for any model.

Logs

None: rendering only, no engine request involved.

Searched open and closed issues for width, wrap, measure, narrow, 换行, 排版:

  • #4486 [GUI] About ▸ Model settings: every parameter field squeezed to ~30 px — a different screen (the settings card), a different cause (label column taking the full width).
  • #3818 [bug] reply text cannot be fully selected, and single newlines in replies become paragraph breaks — about where a break comes from; that half was fixed in 0.2.5. This report is about how wide each block is allowed to be, which is a separate stylesheet rule.
  • #3720 user bubble collapses line breaks — the user bubble, opposite direction.

No issue covers the inconsistent measure inside one assistant reply.

Suggested fix (not tested)

  • Make the measure one rule instead of a per-element mix: either cap the list items too (.st-bubble li { max-width: var(--st-measure) }), or drop the cap from p and put a single measure on .st-bubble, so prose, bullets and numbering share it.
  • Make the measure script-aware rather than ch-based, e.g. max-width: min(56ch, 34em), so a Chinese paragraph does not come out at roughly half the Latin measure.
  • Keep tables and code at the full column width on purpose, and give the block quote the same measure as the prose it sits in.
  • Restore the class the stylesheet already expects (emit md-li on list items) if the cap is meant to cover lists — either half of that pair, in the CSS or in the renderer, would make the selector do what it says today.
Originally created by @xvcezrqpbxtpzblrt on GitHub (Oct 30, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4722 **2026-11-06 核对结果**:已修且已在装机 0.2.11 CSS 中生效——`.st-msg--assistant .st-bubble :is(p,ul,ol,blockquote){max-width:var(--st-measure)}`(dist/assets/index-Dor2RFX-.css)。CJK 每行约 28 字的残余已由 Niko1221 移入 #5066。可关单;如实测段落与列表仍不齐请带场景。 --- ### Area [GUI] (the desktop app) ### Desktop app, Terminal or source? Desktop app (Windows) ### What happened Inside one assistant reply, the text is laid out at three different widths, so part of the answer looks as if it were written for a wide screen and part for a narrow one: - prose paragraphs wrap early, in the middle of a sentence, with a large unused margin on the right; - the bullets and numbered points under them run to nearly the full column; - tables and code blocks run to the full column again. With Chinese text the difference is very visible, because the paragraph cap lands at about 30 Chinese characters per line while the list items reach roughly 55. It is not the model: the same answer, the same bubble, three measures. **Cause, in the shipped 0.2.8 stylesheet** (`host/dist/assets/index-ycN8HD_X.css`): ```css --st-measure: 56ch .st-msg--assistant .st-bubble p, .st-msg--assistant .st-bubble .md-li { max-width: var(--st-measure) } ``` The cap is written for paragraphs **and** list items, but the renderer never emits the class `md-li`: the list branch pushes a bare `<ol>`/`<ul>` with plain `<li>` children (https://github.com/Niko1221/Strata/blob/v0.2.8/apps/host/src/components/Markdown.tsx#L103-L113), and the compiled UI bundle `index-CpwV4C51.js` contains the string `md-li` **0 times**. So the selector's second half matches nothing: `<p>` is capped, `<li>` and `<table>` are not. **Measured**, using the app's own stylesheet and its own markup (`.chat__inner` fixed at its 920 px maximum, headless Edge 1.4k window, the chat font this install resolves from `--st-content-fs`): | box | measured width | CJK characters per line | |---|---|---| | `.chat__inner` | 920 px | — | | `.st-msg` / `.st-bubble` | 864 px | — | | `<p>` inside the bubble | **460 px** | 30 | | `<li>` inside the same bubble | **824 px** | ~55 | | `.md-table` | 864 px | — | The second problem is the unit itself: `ch` is the width of the digit `0`. At the 14 px chat font, `56ch` ≈ 460 px, which is ~30 Chinese glyphs but ~90 Latin characters. So the intended reading measure is script-dependent: it reads as "comfortable" in English and as "half a column" in Chinese, and any reply that mixes prose with lists shows both at once. ### Smallest steps or command that reproduce it In the app: 1. Open the desktop app and a chat. 2. Send: `用中文写一段90字左右的段落,然后写三条同样长度的中文要点,不要空行以外的分段`. 3. The paragraph breaks at roughly 30 characters per line, leaving a wide right margin; the three bullets break at roughly 55 characters per line, in the same bubble. Off the app, to get the numbers above: 1. Take `host/dist/assets/index-ycN8HD_X.css` from an installed 0.2.8. 2. Make a page with the app's markup skeleton — `.app > .chatcol > .main__body.chat > .chat__inner > .st-msg.st-msg--assistant > .st-bubble >` a `<p>`, a `<ul><li>` and a `<div class="md-table-wrap"><table class="md-table">`, each filled with the same Chinese sentence — and set `.main__body.chat{width:1200px}`. 3. `msedge --headless=new --window-size=1400,900 --dump-dom file:///…/measure.html` and read `getBoundingClientRect().width` for the three elements: 460 / 824 / 864. ### Reproduction status Confirmed by measurement — the widths in the table are read from the shipped stylesheet rendered in a browser, and the person at the keyboard sees the same effect in the app. The dead `.md-li` selector is confirmed both in the source at `v0.2.8` and in the compiled bundle shipped inside the app. ### Strata version Strata 0.2.8 — app `0.2.8`, Control and engine `0.1.54`. ### Graphics card, memory and system NVIDIA GeForce RTX 3080 Ti Laptop GPU 16 GB - 64 GB RAM - Windows 11 Pro build 26300 ### Model, size and settings Qwen3.8-Flash-Next IQ3_S, 384K context. The model only supplies the text; the layout difference is CSS, and it appears for any model. ### Logs None: rendering only, no engine request involved. ### Duplicate search Searched open and closed issues for `width`, `wrap`, `measure`, `narrow`, `换行`, `排版`: - #4486 [GUI] About ▸ Model settings: every parameter field squeezed to ~30 px — a different screen (the settings card), a different cause (label column taking the full width). - #3818 [bug] reply text cannot be fully selected, and single newlines in replies become paragraph breaks — about *where* a break comes from; that half was fixed in 0.2.5. This report is about *how wide each block is allowed to be*, which is a separate stylesheet rule. - #3720 user bubble collapses line breaks — the user bubble, opposite direction. No issue covers the inconsistent measure inside one assistant reply. ### Suggested fix (not tested) - Make the measure one rule instead of a per-element mix: either cap the list items too (`.st-bubble li { max-width: var(--st-measure) }`), or drop the cap from `p` and put a single measure on `.st-bubble`, so prose, bullets and numbering share it. - Make the measure script-aware rather than `ch`-based, e.g. `max-width: min(56ch, 34em)`, so a Chinese paragraph does not come out at roughly half the Latin measure. - Keep tables and code at the full column width on purpose, and give the block quote the same measure as the prose it sits in. - Restore the class the stylesheet already expects (emit `md-li` on list items) if the cap is meant to cover lists — either half of that pair, in the CSS or in the renderer, would make the selector do what it says today.
Author
Owner

@xvcezrqpbxtpzblrt commented on GitHub (Nov 3, 2026):

Following up from 0.2.10 (ffa80d7): the fix landed as app.css:483 .st-msg--assistant .st-bubble :is(p, ul, ol, blockquote){max-width:var(--st-measure)}, and .md-li at app.css:2470 is now dead code. So the three widths in one reply became two: prose and lists at 56ch, tables and code blocks at the full 864 px.

The consequence is script-dependent, because ch is the advance of 0 (0.556 em in the resolved face) while a Chinese glyph is 1.000 em -- measured here: 10 × 汉 = 140 px at 14 px. 56ch is ~66–68 Latin characters, which the comment at app.css:477-482 targets at 45–75, and 28 Chinese characters, 1.6x below that band. A 1000-glyph Chinese answer is 36 lines / 700 px tall at 12 px with 1.62 leading (app.css:492); the full column makes it 14 lines / 272 px, in a window that opens at 920 px (main.rs:952).

Numbers, the script-aware shape of the rule (store.ts:472 already sets <html lang="zh-CN">) and the Reply width control are in #5066. Nothing needed from this thread -- it is the thread that established the target, so I am recording what the fix changed for CJK readers.

<!-- gh-comment-id:6597289861 --> @xvcezrqpbxtpzblrt commented on GitHub (Nov 3, 2026): Following up from 0.2.10 (`ffa80d7`): the fix landed as `app.css:483` `.st-msg--assistant .st-bubble :is(p, ul, ol, blockquote){max-width:var(--st-measure)}`, and `.md-li` at `app.css:2470` is now dead code. So the three widths in one reply became two: prose **and** lists at `56ch`, tables and code blocks at the full 864 px. The consequence is script-dependent, because `ch` is the advance of `0` (0.556 em in the resolved face) while a Chinese glyph is 1.000 em -- measured here: `10 × 汉 = 140 px` at 14 px. `56ch` is ~66–68 Latin characters, which the comment at `app.css:477-482` targets at 45–75, and **28 Chinese characters**, 1.6x below that band. A 1000-glyph Chinese answer is 36 lines / 700 px tall at 12 px with 1.62 leading (`app.css:492`); the full column makes it 14 lines / 272 px, in a window that opens at 920 px (`main.rs:952`). Numbers, the script-aware shape of the rule (`store.ts:472` already sets `<html lang="zh-CN">`) and the `Reply width` control are in #5066. Nothing needed from this thread -- it is the thread that established the target, so I am recording what the fix changed for CJK readers.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2161
No description provided.