Admin: inline group-name form; create-invite auto-copies without a prompt dialog
- Group name form uses the inline-form layout (input + Save on one row). - After creating an invite, copy the link immediately and refresh the list; the prompt() fallback (the 'weird dialog') is gone — on clipboard failure we just toast and the link is in the list with its own Copy button.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2 files changed,
+8
−5
web/pages/admin.html+2 −2web/static/admin.js+6 −3
diff --git a/web/pages/admin.html b/web/pages/admin.html| index 85c6cda..8affc07 100644 |
| --- a/web/pages/admin.html |
| +++ b/web/pages/admin.html |
| @@ -16,9 +16,9 @@ |
| <section> |
| <h2>Group name</h2> |
| <p class="sub" style="margin:0 0 8px">Shown as the app name when added to a Home Screen, and as the chat's title.</p> |
| - <form id="nameForm" autocomplete="off"> |
| + <form id="nameForm" class="inline-form" autocomplete="off"> |
| <input id="groupName" placeholder="e.g. Family Chat" maxlength="60" /> |
| - <div class="row"><button type="submit">Save name</button></div> |
| + <button type="submit">Save name</button> |
| </form> |
| </section> |
diff --git a/web/static/admin.js b/web/static/admin.js| index 9b66314..c5b4806 100644 |
| --- a/web/static/admin.js |
| +++ b/web/static/admin.js |
| @@ -103,10 +103,11 @@ function wireCreate() { |
| const label = document.getElementById("label").value.trim(); |
| const res = await api("POST", "/api/admin/invites", { label }); |
| if (!res.ok) return toast("Couldn't create invite"); |
| - document.getElementById("label").value = ""; |
| - await refresh(); |
| const inv = await res.json(); |
| + document.getElementById("label").value = ""; |
| + // Copy the new link straight away, then refresh the list (no blocking dialog). |
| copy(linkFor(inv.token), "Invite link copied"); |
| + refresh(); |
| }; |
| } |
| @@ -190,7 +191,9 @@ async function copy(text, msg) { |
| await navigator.clipboard.writeText(text); |
| toast(msg); |
| } catch { |
| - prompt("Copy this:", text); |
| + // Clipboard blocked (e.g. lost the user gesture) — no blocking dialog; |
| + // the link is in the list with its own Copy button. |
| + toast("Created — tap “Copy link” to copy it"); |
| } |
| } |