Skip to content

feat: multiline agent input and fix user message wrapping#203

Merged
raphi011 merged 6 commits into
mainfrom
raphi011/tui-multiline-input
Mar 25, 2026
Merged

feat: multiline agent input and fix user message wrapping#203
raphi011 merged 6 commits into
mainfrom
raphi011/tui-multiline-input

Conversation

@raphi011

Copy link
Copy Markdown
Owner

Replace single-line textinput with textarea for multiline message composition, and fix user message truncation in conversation view.

New Features

  • Multiline input: Enter sends, Shift+Enter inserts newline. Height auto-grows from 1→10 lines.
  • User message wrapping: Long messages now wrap at maxTextWidth instead of being truncated (lipgloss Width() vs MaxWidth())

Breaking Changes

  • None

raphi011 and others added 6 commits March 25, 2026 14:44
FilterBar's textinput never had its Width set, causing the placeholder
and hint text to be truncated to ~1 character. Propagate terminal width
via SetWidth() for all FilterBar-using tabs (search, links, bookmarks,
tasks).

Task toggle used raw line text for content hash matching while extraction
used AST-derived text — any inline markdown (wiki-links, bold, etc.)
caused permanent hash mismatch. Now uses ParseMarkdown's extracted tasks
for lookup, ensuring identical hashing in both paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace single-line textinput with textarea for multiline message
composition. Enter sends, shift+enter inserts newline. Height auto-grows
from 1 to 10 lines based on content.

Fix user message truncation: MaxWidth() truncates in lipgloss v2, Width()
wraps. User messages now wrap at maxTextWidth instead of being cut off.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Convert FilterBar from textinput.Model to textarea.Model so all input
fields support multiline editing (shift+enter for newlines, enter to
submit). Configure MaxHeight=10 with auto-resize.

Fix user message truncation in chat scrollback: renderUserMessage and
renderParts used a fixed maxTextWidth=120 regardless of terminal size.
Now all render functions accept the terminal width and cap accordingly,
preventing the terminal's own line wrapping from breaking lipgloss
padding.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add input/list focus modes to all browse tabs (search, bookmarks, links, tasks)
- `/` focuses filter bar, up arrow from top returns to filter bar
- Dim cursor indicator when filter bar is focused
- Add label-based search via apiclient.SearchDocuments labels param
- Fix duplicate ContentHash disambiguation with proximity bias
- Guard SetWidth against negative values on tiny terminals

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… cleanup

- Detect flipCheckbox silent no-op (line not a checkbox → error instead of
  silent re-save)
- Extract findToggleLine as testable pure function with 7 table-driven tests
  covering exact match, drift, duplicates, no-match, equidistant tie-breaking
- Extract textWidth helper in render.go (dedup width calculation)
- Extract pick.CursorPrefix helper (dedup cursor prefix logic across 5 sites)
- Restore "Searching..." indicator in browse search tab

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@raphi011 raphi011 merged commit fa07346 into main Mar 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant