From cd0cd8464c53abf8c178cce252ceafec9711d47a Mon Sep 17 00:00:00 2001 From: MechaCat02 Date: Sun, 7 Jun 2026 21:06:02 +0200 Subject: [PATCH] fix(dashboard): F-U-018 allow owners to invite owners directly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The invite-user modal offered only admin/member radios. Owner could only be granted by editing an existing user — asymmetric with editRoleOptions which lets owners assign owner directly. The original intention was preventing the first-owner footgun but the asymmetry was confusing. Show the Owner radio only when me?.instance_role === 'owner'. The help text ("Owners can't be created here — promote via Edit") still shows for non-owner admins so the friction is preserved where it matters. AUDIT.md anchor: F-U-018. Co-Authored-By: Claude Opus 4.7 (1M context) --- dashboard/src/routes/users/+page.svelte | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/dashboard/src/routes/users/+page.svelte b/dashboard/src/routes/users/+page.svelte index c01f52b..92cab59 100644 --- a/dashboard/src/routes/users/+page.svelte +++ b/dashboard/src/routes/users/+page.svelte @@ -50,7 +50,10 @@ // Invite (create) modal -------------------------------------------------- let inviteOpen = $state(false); - let inviteForm = $state<{ username: string; email: string; instance_role: 'admin' | 'member' }>({ + // F-U-018: Owner is selectable for the bootstrap case (owners can + // always create more owners; the asymmetry with editRoleOptions + // was unnecessary friction). + let inviteForm = $state<{ username: string; email: string; instance_role: InstanceRole }>({ username: '', email: '', instance_role: 'admin' @@ -449,6 +452,12 @@
Role + {#if me?.instance_role === 'owner'} + + {/if} - - Owners can't be created here — promote via Edit after creation. - + {#if me?.instance_role !== 'owner'} + Owners can't be created here — promote via Edit after creation. + {/if}
{#if inviteError}
{inviteError}