fix: chat input correctness and mobile UX
- after-request → after-settle: scrollChat() was firing before HTMX swapped the new message into the DOM, so the chat log didn't scroll to the new message. after-settle fires post-swap, post-settle. - hx-sync="this:drop": prevents duplicate submissions if the user taps SEND a second time while a slow Ollama response is in flight. - hx-disabled-elt="find button": disables SEND button visually during a pending request; paired with hx-sync for belt-and-suspenders. - autocorrect="off" autocapitalize="none" spellcheck="false": iOS autocorrect mangles model names (llama3.2 etc.) and autocapitalize uppercases every message's first word. Both are wrong for a terminal- style chat interface. - enterkeyhint="send": tells the iOS/Android soft keyboard to label the Return key "Send" instead of the generic return arrow. https://claude.ai/code/session_01M4L3R98N5fgXFZRvV8X9b6
This commit is contained in:
@@ -55,12 +55,18 @@
|
||||
hx-target="#chat-log"
|
||||
hx-swap="beforeend"
|
||||
hx-indicator="#send-indicator"
|
||||
hx-on::after-request="this.reset(); scrollChat()"
|
||||
hx-sync="this:drop"
|
||||
hx-disabled-elt="find button"
|
||||
hx-on::after-settle="this.reset(); scrollChat()"
|
||||
style="display:flex; flex:1; gap:8px;">
|
||||
<input type="text"
|
||||
name="message"
|
||||
placeholder="send a message to timmy..."
|
||||
autocomplete="off"
|
||||
autocorrect="off"
|
||||
autocapitalize="none"
|
||||
spellcheck="false"
|
||||
enterkeyhint="send"
|
||||
required />
|
||||
<button type="submit">
|
||||
SEND
|
||||
|
||||
Reference in New Issue
Block a user