ui: keep a new chat's first message on screen; expand the chat form only by hand (#33796)
* ui: keep a new chat's first message on screen as it lands
Sending the first message of a new conversation glided the page to its
bottom before the message had rendered, so the moment a tall message
appeared the page was already sweeping it off the top of the screen:
the layout jumped and the message the user just wrote was cut off.
A one-line message never made the page scrollable, which is why only
taller ones showed it.
A send that starts a new conversation now holds the viewport while the
message lands, and the hold releases itself once the message has
settled. A message that leaves the page unscrollable leaves the reader
at its bottom: the reply streaming in under it eases the viewport down
as before. A tall one leaves the reader at the top of a page that
already scrolls: that place is theirs, the reply streams in below it
out of sight, and following returns the moment they scroll to it.
Assisted-by: Llama Chat (ggml-org/Qwen4-35B-A3B-GGUF:Q8_0 + MTP:Q8_0)
* ui: expand the chat form only by hand
The form expanded on its own once the message being written had several
lines or a markdown block in its finished lines, growing the card
mid-typing without the reader asking for it. It now expands only when
the reader clicks the toggle — or for a message put back after a failed
send, which keeps its explicit expand path. shouldExpandChatForm,
CHAT_FORM_EXPAND_MIN_LINES and the markdown structure detector they
alone used are removed with it.
Assisted-by: Llama Chat (ggml-org/Qwen4-35B-A3B-GGUF:Q8_0 + MTP:Q8_0)
* ui: hold a new chat's first message until it is on the page
The landing hold let go once the page had not grown for 16 ms, so the
early layout changes of a new chat (the form moving, the navigation)
could release it before the first message existed, and the message was
swept off the top again. The hold now waits until the reply's row shows
up in that conversation, then lets go once the page stops growing; a
timer remains only as a fallback.
A tall first message now keeps the reader at its top with reduced
motion too, scrolling to the bottom ends a pending hold, and the
landing is tied to the conversation it was sent into, so a failed send
or a switch to another chat no longer keeps that chat from opening at
its bottom. A message put back after a failed send expands the form
only when it spans more than one line.
Assisted-by: Claude (Opus 5.5 Medium)