ChatTextArea(
self,
**kwargs: Any = {},
)TextAreaTextArea subclass with custom key handling for chat input.
Key bindings for the chat text area.
These are the single source of truth for shortcut keys. _NEWLINE_KEYS
is derived from this list so that _on_key stays in sync automatically.
Inline slash-command argument hint rendered at the end of the line.
Render a single line, appending any argument hint at line end.
The built-in TextArea.suggestion renders at the cursor position,
but slash-command argument hints should stay attached to the end of the
command text regardless of cursor movement.
Scroll to make the cursor visible, guarding against cursor/document desync.
Textual's WrappedDocument.location_to_offset has an off-by-one in its
line-index clamp (len(...) instead of len(...) - 1). When a reactive
watcher (e.g. _watch_show_vertical_scrollbar) fires between a document
replacement and cursor update, the stale cursor location triggers a
ValueError. Guard here since scroll_cursor_visible is the sole
caller of _recompute_cursor_offset.
Set whether the app should show the cursor as active.
Set whether completion suggestions are visible.
Insert a newline character.
Move cursor up, or navigate to the previous history entry at top.
When select is true or a selection is active, falls through to
TextArea's default so shift+up extends selection rather than
triggering navigation. History fires only when moving up cannot
advance the cursor — handled via the wrapped-document navigator so
soft-wrap is respected.
Move cursor down, or navigate to the next history entry at bottom.
Mirrors action_cursor_up: defers to TextArea on selection or when
the cursor still has somewhere to move; otherwise fires history.
Set text from history navigation.
Clear the text area.
Message sent when text is submitted.
Request previous history entry.
Request next history entry.
Message sent when paste payload resolves to file paths.
Posted when the user presses a printable key or backspace.
Relayed by ChatInput as ChatInput.Typing for the app to track
typing activity.