From 6c5b3e53841a9b636864500379f74d66ff94d699 Mon Sep 17 00:00:00 2001 From: argszero Date: Tue, 15 Sep 2026 00:53:34 +0800 Subject: [PATCH] fix(ui): submit the inline cards from every field, not from a hand-written roster MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The inline form cards (`#topup-card`, `#raise-card`, `#dept-form-card`, `#model-form-card`, `#ak-new-inline`) are `
` / ``, not real `
`s (the real one is `#share-form`, where the implicit submission of a `type="submit"` button makes Enter work in every field for free). So Enter has to be implemented by hand — and it was implemented as a **per-field roster**: $("#model-form-provider").addEventListener("keydown", ... $("#model-confirm").click()); $("#model-form-model").addEventListener("keydown", ...) // and that is the whole list The model form has ten text controls. The roster named two of them, so the other eight — input price, cache-hit price, output price, all three peak prices, context window, max output — did nothing at all when you pressed Enter, while every one of them submits when you click Confirm. Nothing errors; the card simply ignores the key. The department form on the same page registered every field it has (2/2), and `#share-form` needs no registration at all, so this is an omission that never got caught, not a deliberate trade-off. A roster is the problem, not its entries: it does not grow when the markup does. The fix deletes it and delegates Enter to the card: wireEnterSubmit($("#model-form-card"), "#model-confirm") `wireEnterSubmit` listens on the container, so every text control the card has — today's and tomorrow's — is covered, and it bails on non-text targets, so pressing Enter while the *Cancel* button has focus still dismisses the card instead of submitting it. The delegate only calls `btn.click()`: the busy state (`withLoading`), the field validation and the request all stay in the confirm button's own listener, which is the one place that already implements them. `src/i18n_pack.rs::enter_submit_is_delegated_to_the_card` pins the shape in CI: * no `keydown` registration that clicks a confirm button may hang off an id that `ui/index.html` declares on an `` / `