co-mono/packages/tui/test
Nick Seelert dde5f25170 feat(tui): implement word wrapping in Editor component
Previously, the Editor component used character-level (grapheme-level)
wrapping, which broke words mid-character at line boundaries. This
created an ugly visual experience when typing or pasting long text.

Now the Editor uses word-aware wrapping:
- Wraps at word boundaries when possible
- Falls back to character-level wrapping for tokens wider than the
  available width (e.g., long URLs)
- Strips leading whitespace at line starts
- Preserves multiple spaces within lines

Added wordWrapLine() helper function that tokenizes text into words
and whitespace runs, then builds chunks that fit within the specified
width while respecting word boundaries.

Also updated buildVisualLineMap() to use the same word wrapping logic
for consistent cursor navigation.

Added tests for:
- Word boundary wrapping
- Leading whitespace stripping
- Long token (URL) character-level fallback
- Multiple space preservation
- Edge cases (empty string, exact fit)
2025-12-30 23:05:35 -05:00
..
autocomplete.test.ts Release v0.7.23 2025-11-20 11:59:17 +01:00
chat-simple.ts Release v0.8.0 2025-11-21 03:12:42 +01:00
editor.test.ts feat(tui): implement word wrapping in Editor component 2025-12-30 23:05:35 -05:00
image-test.ts Enable more biome lints and fix things 2025-12-21 22:56:20 +01:00
key-tester.ts Add Kitty keyboard protocol support for Shift+Enter and other modifier keys 2025-12-18 19:20:30 +02:00
markdown.test.ts Fix markdown tables overflowing/wrapping in TUI (width-aware rendering) (#206) 2025-12-17 17:13:27 +01:00
test-themes.ts Add CI workflow and fix workspace tests 2025-12-02 12:53:53 +00:00
truncated-text.test.ts Enable more biome lints and fix things 2025-12-21 22:56:20 +01:00
virtual-terminal.ts Fix terminal rendering and add improvements 2025-11-11 00:13:46 +01:00
wrap-ansi.test.ts Fix wrap-ansi test to use node:test instead of vitest 2025-12-06 00:48:46 +01:00