diff --git a/frontend/src/lib/components/sidebar/WorkspacePickerBody.svelte b/frontend/src/lib/components/sidebar/WorkspacePickerBody.svelte index 3719e35d35..5a893316e5 100644 --- a/frontend/src/lib/components/sidebar/WorkspacePickerBody.svelte +++ b/frontend/src/lib/components/sidebar/WorkspacePickerBody.svelte @@ -36,7 +36,11 @@ findWorkspaceAncestors, isForkOwner } from '$lib/utils/workspaceHierarchy' - import { canCreateFork } from '$lib/utils/editInFork' + import { + canCreateFork, + OPERATOR_FORK_BLOCKED_REASON, + operatorForkBlocked + } from '$lib/utils/editInFork' import { workspaceRootId } from '$lib/components/sessions/sessionScope.svelte' import DevWorkspaceBadge from '$lib/components/DevWorkspaceBadge.svelte' @@ -156,6 +160,11 @@ const canForkHere = $derived( (!isCloudHosted() || $maybePremium) && $workspaceStore !== 'admins' && canCreateFork($userStore) ) + const forkBlockedHere = $derived( + (!isCloudHosted() || $maybePremium) && + $workspaceStore !== 'admins' && + operatorForkBlocked($userStore) + ) // The row mechanics below — which family to expand, which collapsed row carries the tick — key on // a depth-0 row of the list, which `buildWorkspaceHierarchy` puts at the highest workspace the // caller can see: parentless, or with a parent absent from their list. `findWorkspaceAncestors` @@ -363,7 +372,7 @@ {/each} - {#if (isCloudHosted() || $superadmin || canForkHere) && !strictWorkspaceSelect} + {#if (isCloudHosted() || $superadmin || canForkHere || forkBlockedHere) && !strictWorkspaceSelect}