From bda59e6d23eb521b07d3769c54a59a80c7accd0f Mon Sep 17 00:00:00 2001 From: AlexRV12 <71396855+AlexRV12@users.noreply.github.com> Date: Wed, 28 Oct 2026 19:24:43 +0100 Subject: [PATCH] fix: show not deployed yet for undeployed apps in session preview tabs (#12076) * fix: show not deployed yet for undeployed apps in session preview tabs * fix: say what an embed-token 404 means in the app viewer comment * fix: name the protection rule only when the rules were actually read --- .../apps/editor/InWorkspaceAppViewer.svelte | 3 +++ .../components/sessions/ItemViewerView.svelte | 13 +++++++++++-- .../sessions/sessionPermissions.svelte.ts | 19 ++++++++++++++++--- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/frontend/src/lib/components/apps/editor/InWorkspaceAppViewer.svelte b/frontend/src/lib/components/apps/editor/InWorkspaceAppViewer.svelte index d86713253a..56563a957c 100644 --- a/frontend/src/lib/components/apps/editor/InWorkspaceAppViewer.svelte +++ b/frontend/src/lib/components/apps/editor/InWorkspaceAppViewer.svelte @@ -117,6 +117,9 @@ headers }) if (!res.ok) { + // Minted for the deployed app under the caller's RLS: a 404 is "nothing deployed here" or + // "not visible to this member", the same reading as `getAppLiteByPath`'s 404 below. + if (res.status == 404) onLoadState?.('not_found') const err: any = new Error('Failed to fetch embed token') err.status = res.status throw err diff --git a/frontend/src/lib/components/sessions/ItemViewerView.svelte b/frontend/src/lib/components/sessions/ItemViewerView.svelte index 93e62702f8..cd9772a331 100644 --- a/frontend/src/lib/components/sessions/ItemViewerView.svelte +++ b/frontend/src/lib/components/sessions/ItemViewerView.svelte @@ -21,8 +21,11 @@ previewLocationLabel, barePath } from './previewRouter' - import { useSessionPermissions } from './sessionPermissions.svelte' + import { useSessionPermissions, useSessionReadOnly } from './sessionPermissions.svelte' import { agentWriteCount } from '$lib/components/flows/agentEditorStore.svelte' + import { userWorkspaces } from '$lib/stores' + import { findCanonicalDevWorkspace } from '$lib/utils/workspaceHierarchy' + import { devLabelNoun } from '$lib/utils/devWorkspaceLabel' let { runtime, @@ -70,6 +73,8 @@ () => runtime.manager ) const canEdit = $derived(permissions.canOpenEditor(kind)) + const protectedWorkspace = useSessionReadOnly(() => workspaceId) + const devWorkspace = $derived(findCanonicalDevWorkspace(workspaceId, $userWorkspaces)) // This reads the deployed version over the API rather than from the editor cell the // chat mutates, so it is the one preview kind that does not self-sync (the invariant @@ -259,7 +264,11 @@