Watch
0
0
Fork
You've already forked hyperhive
0

flow: close the @-mention list once the recipient is chosen

The composer's suggestion list stayed open for as long as the line started
with a name that matched an agent, so typing "@iris hello" left it showing.
Enter then accepted the highlighted suggestion (a no-op once the name is
complete) and returned without sending; the message only went on a second
Enter. The list now shows only while the cursor is still inside the leading
@-token, so Enter sends as soon as the message has started.
This commit is contained in:
iris 2026-10-17 23:46:37 +02:00 • committed by mara
commit 3a7272bdfb

View file

@ -353,10 +353,12 @@ import { epochSec } from "./util.js";
} }
function updateSuggest() { function updateSuggest() {
const v = input.value; const v = input.value;
// Only suggest when an @-token sits at the very start of the // Only suggest while the cursor is still inside the @-token at the
// input — switching recipient is always "redirect this whole // very start of the input — switching recipient is always "redirect
// line." Mid-message @-mentions stay literal. // this whole line." Once whitespace follows the token the recipient
const m = v.match(/^@(\S*)/); // is chosen: the list must close, or it swallows the Enter that
// should send. Mid-message @-mentions stay literal.
const m = v.match(/^@(\S*)$/);
if (!m) { if (!m) {
hideSuggest(); hideSuggest();
return; return;