Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

chat: hide panel immediately on submit, before awaiting handler

The TextInput submit callback was clearing text and sending
keyboard:close AFTER awaiting options.submitHandler. That's fine
when the default path's fire-and-forget client.server.send() runs
in microseconds, but for async submitHandlers like aa.mjs — which
awaits an entire SSE stream from Claude — the panel stayed open
for the whole reply. Move the clear/close up so UI feedback is
instant for both sync and async submit paths.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

+12 -9
+12 -9
system/public/aesthetic.computer/disks/chat.mjs
··· 544 544 async (text) => { 545 545 text = text.replace(/\s+$/, ""); // Trim trailing whitespace. 546 546 547 + // Clear text, hide cursor block, and close keyboard immediately so the 548 + // panel hides on Enter even when the submit handler is async (e.g. 549 + // aa.mjs awaits a streaming SSE reply — without this the panel would 550 + // stay open for the entire response). 551 + input.text = ""; 552 + draftMessage = ""; // Clear draft 553 + input.showBlink = false; 554 + input.mute = true; 555 + if (handleAutocomplete) handleAutocomplete.hide(); // 🔍 Clear autocomplete state 556 + console.log("⌨️🔴 [chat.mjs] sending keyboard:close - reason: message sent"); 557 + send({ type: "keyboard:close" }); 558 + 547 559 // Pieces inheriting chat.mjs (e.g. aa.mjs) may pass a custom submit 548 560 // handler so they can route the typed text somewhere other than the 549 561 // chat-system server. If provided, it owns the send. ··· 568 580 notice("SENT"); 569 581 } 570 582 } 571 - 572 - // Clear text, hide cursor block, and close keyboard after sending message. 573 - input.text = ""; 574 - draftMessage = ""; // Clear draft 575 - input.showBlink = false; 576 - input.mute = true; 577 - if (handleAutocomplete) handleAutocomplete.hide(); // 🔍 Clear autocomplete state 578 - console.log("⌨️🔴 [chat.mjs] sending keyboard:close - reason: message sent"); 579 - send({ type: "keyboard:close" }); 580 583 }, 581 584 { 582 585 // autolock: false,