consciousness/poc-agent
Kent Overstreet f2c2c02a22 tui: fix cursor position with proper word-wrap simulation
The previous approach scanned ratatui's rendered buffer to find the
cursor position, but couldn't distinguish padding spaces from text
spaces, causing incorrect cursor placement on wrapped lines.

Replace with a word_wrap_breaks() function that computes soft line
break positions by simulating ratatui's Wrap { trim: false } algorithm
(break at word boundaries, fall back to character wrap for long words).
cursor_visual_pos() then maps a character index to (col, row) using
those break positions.

Also fixes the input area height calculation to use word-wrap semantics
instead of character-wrap, matching the actual Paragraph rendering.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 01:09:55 -04:00
..
.claude Move poc-agent into workspace, improve agent prompts 2026-03-18 22:45:01 -04:00
paper Move poc-agent into workspace, improve agent prompts 2026-03-18 22:45:01 -04:00
src tui: fix cursor position with proper word-wrap simulation 2026-03-19 01:09:55 -04:00
tests Move poc-agent into workspace, improve agent prompts 2026-03-18 22:45:01 -04:00
.gitignore Move poc-agent into workspace, improve agent prompts 2026-03-18 22:45:01 -04:00
Cargo.lock Move poc-agent into workspace, improve agent prompts 2026-03-18 22:45:01 -04:00
Cargo.toml tui: fix cursor desync by scanning rendered buffer 2026-03-19 00:40:05 -04:00
POC.md Move poc-agent into workspace, improve agent prompts 2026-03-18 22:45:01 -04:00
scratch.md Move poc-agent into workspace, improve agent prompts 2026-03-18 22:45:01 -04:00