Thing 2.0: cells text (terminal widths and line breaking behind Measure) #23

Merged
eureka merged 6 commits from hands/thing2-cells-text into main 2026-11-28 09:01:01 +00:00
Owner

thing_core::text gains CellText and CellMeasure behind the Measure trait (thing2:ruling:cells-text-cut-before-tui): text is sanitized first (every C0/C1 control, ESC, DEL and bidi control removed, so a document cannot write escape codes or reorder a terminal), then segmented into grapheme clusters and measured (unicode-width 0.2.3, ambiguous narrow), so each recorded width is the width of exactly the emitted text; UAX #14 line breaking (unicode-linebreak); tab stops from the wrapped line start. Width vectors pin CJK, combining marks, emoji presentation and ZWJ sequences; a property test re-measures every emitted line over a 400,000-round fuzz; output is identical on Windows and Linux. New thing-core deps: unicode-width, unicode-segmentation, unicode-linebreak.

Spec thing2:cut_spec:cut-cells-text.r1; reports h1, h2; Soul s1, s2 (s2 holds). 249 tests; 20/20 mutants. No golden moved.

🤖 Generated with Claude Code

thing_core::text gains CellText and CellMeasure behind the Measure trait (`thing2:ruling:cells-text-cut-before-tui`): text is sanitized first (every C0/C1 control, ESC, DEL and bidi control removed, so a document cannot write escape codes or reorder a terminal), then segmented into grapheme clusters and measured (unicode-width 0.2.3, ambiguous narrow), so each recorded width is the width of exactly the emitted text; UAX #14 line breaking (unicode-linebreak); tab stops from the wrapped line start. Width vectors pin CJK, combining marks, emoji presentation and ZWJ sequences; a property test re-measures every emitted line over a 400,000-round fuzz; output is identical on Windows and Linux. New thing-core deps: unicode-width, unicode-segmentation, unicode-linebreak. Spec `thing2:cut_spec:cut-cells-text.r1`; reports h1, h2; Soul s1, s2 (s2 holds). 249 tests; 20/20 mutants. No golden moved. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Per-grapheme-cluster widths (unicode-width 0.2.3, ambiguous narrow), UAX #14 breaks,
controls sanitized to U+FFFD; Run::Cells carries a CellText; f12 Cells goldens.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
cells tests: a tab's width decides where a line breaks
All checks were successful
Portable Eve contracts and browser lowering / ubuntu-latest eve-browser-lowering (pull_request) Successful in 4m49s
Portable Eve contracts and browser lowering / ubuntu-latest eve-contracts (pull_request) Successful in 1m1s
20b88c5332
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
eureka merged commit 63ed2e3b01 into main 2026-11-28 09:01:01 +00:00
eureka deleted branch hands/thing2-cells-text 2026-11-28 09:01:01 +00:00
Sign in to join this conversation.
No reviewers
No labels
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
GameCult/Thing!23
No description provided.