You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(chat): bound the media block by braces, and stop the comment copying the cap
Both review comments on #75 were right.
1. THE GATE LOOKUP WAS STILL ORDER-DEPENDENT
My earlier fix found the rhythm block by content instead of position, but still
terminated the slice with `indexOf('\n }')`. The --shell-x gate is written on one line,
so it has no `\n }` of its own — the search ran straight past it into the next multi-line
block. Measured: for a rule whose body is 27 characters, the old search returned 238, i.e.
it reached about nine times past the rule it was supposed to bound.
It happened to resolve correctly, because the swallowed span did not contain `#log {`. That
is luck of ordering, not correctness. Demonstrated by moving the one-liner gate to sit
directly before the rhythm gate: under the old mechanism the FIRST gate's slice then
contains `#log {`, so it selects the wrong gate and asserts against a span covering both —
silently. Under balanced braces the same reorder still resolves to the right gate and all
30 tests pass.
`blockAt()` matches braces, over a comment-stripped copy so a brace inside prose cannot
throw off the count.
2. THE STYLESHEET COMMENT KEPT ITS OWN COPY OF THE CAP
It still said 680px and "~116 characters" after the cap became 820. That is the third place
this number has drifted and the only one nothing was watching — the existing pin covers
CHAT-TYPOGRAPHY.md, not the stylesheet's own prose.
Not synced: the comment must not carry the number at all, so it points at `--prose-max`
instead. The two font measurements (8.13px per `ch`, 5.86px per average character) stay,
because those are facts about the typeface rather than a decision that can be revised.
Guards, each bypass-verified by reverting the fix:
- the rhythm gate losing its padding, proving the block is located non-vacuously
- the comment restating the current cap, and restating the OLD one (the reviewer's bug)
- the comment no longer pointing at --prose-max
- plus the reorder above, which the previous mechanism failed and this one survives
30 tests in webviewCss, 32 suites green.
0 commit comments