Public: anyone can read this; the crew can change it.
A check's summary, test row and error line are cut with `clip`, so a failing test named with an emoji reads whole #6764
Check · Review · Land · Live done — Landed and live in production.
The four places that shorten the lines explaining a red check now all call `clip` from `src/text/clip.ts`, and their own cutting code is gone. Before, they cut by UTF-16 position (`slice`), which could split an emoji at the limit and leave a lone surrogate. Now the cut always falls between whole code points.
shipped production is serving it deploy d5b2fe2
The four places that shorten the lines explaining a red check now all call clip from src/text/clip.ts, and their own cutting code is gone. Before, they cut by UTF-16 position (slice), which could split an emoji at the limit and leave a lone surrogate. Now the cut always falls between whole code points.
src/checks/words.ts:oneLinenow returnsclip(text, LINE_MAX)(80).src/checks/tests-row.ts:boundis nowclip(text, LINE_MAX)(200). It shortens both pinned failure names and their output lines.src/checks/summary.ts:truncateis nowclip(text, SUMMARY_MAX)(200). Thefallbacksummary is still not cut, as before.src/runs/error_line.ts:firstErrorLinereturnsclip(text, ERROR_LINE_MAX)(120).
Behaviour changes to look at: clip collapses runs of whitespace to one space and counts length in code points. So a pinned failure line or error line that had aligned columns now shows single spaces. Lines with emoji may also keep a few more UTF-16 units than before. Existing tests don't depend on either.
New test: test/text-clip-checks.test.ts gives firstErrorLine a 300-character line with an emoji straddling the 120 limit. It checks there is no lone surrogate and that the result is 120 code points ending in …. It does the same for oneLine, a pinned failure name, and a summary. All four cases fail on main.
Tests run: the ten test files that import these modules, plus the new one. Two tests in test/looks.test.ts fail ("a real capture through the grant door" and "a dark capture is truly dark"). They fail the same way on main, so this change doesn't cause them. Everything else passes, and bun x tsc --noEmit is clean.
I made no other changes.
🤖 Generated with Claude Code
Four duplicated slice-based cuts now share clip, so no emoji is split at the limit. Each test places an emoji across the old UTF-16 cut, so it would fail on main. The scope is tight, there are no new dependencies, and there is no UI surface. The whitespace folding is a disclosed behaviour change. Next: (1) add a case for a name that folds to a short line, so the fold is pinned too. (2) Look at the two failing looks.test.ts cases separately, since they fail on main as well.
The four places that shorten the lines explaining a red check now all call
clipfromsrc/text/clip.ts, and their own cutting code is gone. Before, they cut by UTF-16 position (slice), which could split an emoji at the limit and leave a lone surrogate. Now the cut always falls between whole code points.src/checks/words.ts:oneLinenow returnsclip(text, LINE_MAX)(80).src/checks/tests-row.ts:boundis nowclip(text, LINE_MAX)(200). It shortens both pinned failure names and their output lines.src/checks/summary.ts:truncateis nowclip(text, SUMMARY_MAX)(200). Thefallbacksummary is still not cut, as before.src/runs/error_line.ts:firstErrorLinereturnsclip(text, ERROR_LINE_MAX)(120).Behaviour changes to look at:
clipcollapses runs of whitespace to one space and counts length in code points. So a pinned failure line or error line that had aligned columns now shows single spaces. Lines with emoji may also keep a few more UTF-16 units than before. Existing tests don't depend on either.New test:
test/text-clip-checks.test.tsgivesfirstErrorLinea 300-character line with an emoji straddling the 120 limit. It checks there is no lone surrogate and that the result is 120 code points ending in…. It does the same foroneLine, a pinned failure name, and a summary. All four cases fail on main.Tests run: the ten test files that import these modules, plus the new one. Two tests in
test/looks.test.tsfail ("a real capture through the grant door" and "a dark capture is truly dark"). They fail the same way on main, so this change doesn't cause them. Everything else passes, andbun x tsc --noEmitis clean.I made no other changes.
🤖 Generated with Claude Code
Closes #6629