Pyright evaluates `if _TEXTUAL_AVAILABLE:` blocks statically and raises
reportMissingImports for textual.geometry, textual.reactive, and
textual.widgets. Add `# type: ignore[import]` to the three conditional
imports so typecheck passes when textual is not installed in the
check environment.
The typecheck session was installing only the base package (-e .)
without the tui optional dependency, so pyright could not resolve
the textual.geometry, textual.reactive, and textual.widgets imports
that prompt.py conditionally loads when _TEXTUAL_AVAILABLE is True.
Changing to -e .[tui] ensures textual is present in the typecheck
venv so pyright reports no reportMissingImports errors.
Input._watch_value sets self.virtual_size (Reactive layout=True) on every
keystroke, keeping Textual's WriterThread write queue permanently non-empty.
The queue never reaches qsize()==0 so flush() is never called and typed
characters are invisible until Enter drains the queue.
Two fixes applied:
1. _PromptTextInput subclasses textual.widgets.Input and overrides
virtual_size with Reactive(layout=False). Setting virtual_size in
_watch_value no longer triggers refresh(layout=True). Zero type:ignore
suppressions — uses proper Textual reactive types.
2. CSS #prompt and #prompt > Input changed from height:auto to fixed
heights (3 and 1). This prevents the auto_dimensions guard in
_watch_value from adding a second refresh(layout=True) per keystroke.
3 BDD regression scenarios added covering: virtual_size layout=False,
_PromptInputBase usage in _TextualPromptInput, and fixed CSS height.
ISSUES CLOSED: #11249
Input._watch_value sets self.virtual_size (Reactive layout=True) on every
keystroke, keeping Textual's WriterThread write queue permanently non-empty.
The queue never reaches qsize()==0 so flush() is never called and typed
characters are invisible until Enter drains the queue via conversation.update().
_PromptTextInput subclasses Input and overrides _watch_value to skip the
virtual_size update while preserving Changed event, _suggestion reset and
initial cursor positioning. The prompt is single-line and never scrolls
horizontally so omitting virtual_size is safe.
ISSUES CLOSED: #11249