ChatInputBox(
self,
**kwargs: Any = {},
)VerticalBordered box that owns the chat composer size.
Sizing is either automatic (content-driven, the default) or manual, and
_requested_height is the discriminator: None means automatic.
A manual size separates intent from what is rendered. The requested height is what the user dragged to and is preserved verbatim; the applied height is re-derived on every relayout by fitting that request between a content floor and whichever ceiling is currently tightest. So a completion popup can transiently squeeze the composer and it springs back when the popup closes, and a terminal shrink does not destroy the request.
ChatInput composes the children and drives this box through
set_manual_height, toggle_expanded, and refresh_content_height.
Re-fit the composer whenever the screen relayouts.
A manual height pins the composer, so once it has been squeezed by a
smaller terminal nothing about this box's own geometry changes when the
terminal grows back -- it never receives another Resize. The screen's
layout-refresh signal does still fire, so that is what restores the
height the user asked for.
Request a manual composer height and render it.
The request is stored clamped only by the screen ceiling; the popup and content constraints are applied at render time so they stay reversible.
Re-fit a manual height after the draft's rendered height changes.
Expand to the manual-height ceiling, or drop a manual height.
Keys off whether a manual height is visible rather than merely stored. A request floored by the draft renders identically to automatic sizing, so collapsing it would leave the composer where it already is and the gesture would read as broken -- expanding is the only move that responds. That also covers the stray row of travel a press can emit before the second half of a double-click lands.
Fit a manual composer around the completion popup.
Re-fit a manual height after this box is resized.
Deliberately re-renders rather than re-requesting: the stored request survives, so shrinking the terminal and growing it back restores the height the user actually chose.