From 7c68818da124d6a9e8d3a28b63ce486df058ec09 Mon Sep 17 00:00:00 2001 From: Diego Imbert Date: Fri, 4 Sep 2026 16:32:42 +0200 Subject: [PATCH] fix(datatables): a role picked at creation is the role the app keeps Leaving it out when it happened to equal the data table's default meant "whatever the default is then", so an app created as `analyst` became a `reader` app the day an admin changed that default. The pick is written down. The hint says what is true of the choice in front of it and no more: what the assistant writes when an app names no data table is a property of the prompt, not of this data table. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01S5arH3G2Sa1Qqm32veJQ1n --- .../raw_apps/RawAppTemplatePicker.svelte | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/frontend/src/lib/components/raw_apps/RawAppTemplatePicker.svelte b/frontend/src/lib/components/raw_apps/RawAppTemplatePicker.svelte index 0aa7417f7a..8e6b481721 100644 --- a/frontend/src/lib/components/raw_apps/RawAppTemplatePicker.svelte +++ b/frontend/src/lib/components/raw_apps/RawAppTemplatePicker.svelte @@ -96,14 +96,11 @@ selectedRole !== undefined && loadedRoles.includes(selectedRole) ? selectedRole : undefined ) - // Omitted when it is the data table's own default, which is what the server - // resolves anyway. Named otherwise: that default is not filtered by what this - // caller may use, so a caller who cannot use it has to say what they can. - const roleToSave = $derived( - effectiveRole !== undefined && effectiveRole !== roles.current.defaultRole - ? effectiveRole - : undefined - ) + // The role this app is created with, written down rather than left to resolve. + // Leaving it out means "whatever the default is then", which silently moves the + // app the day an admin changes it — and that default is not filtered by what + // this caller may use in the first place. + const roleToSave = $derived(effectiveRole) const availableDatatables = $derived(datatables.current) // `undefined` while the list loads, so this is false until it has answered. @@ -365,11 +362,8 @@ class="w-40" /> {#if noUsableRole} - - no role you can use — queries against it will be refused + no role you can use {/if} {#if showRolePicker}