From 029dae0488dfea4c2887edac29fee6824830bb66 Mon Sep 17 00:00:00 2001 From: Guilhem Lemouel Date: Mon, 7 Sep 2026 10:08:58 +0200 Subject: [PATCH] fix(frontend): respect disable_hub in both hub-project entry points MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An instance with the hub turned off still got the catalogue preloaded on every empty home and an "Import a hub project" entry in the create menu — an outbound request the operator has said not to make, and a door to somewhere unreachable. Both now observe `disableHubStore`, the store the script and flow hub pickers already read. With the hub off the caption reads "Create a new one." rather than continuing a sentence whose first half is gone. The telemetry disclosure also scoped the create menu and picker counters to the empty home, when both fire from the toolbar in a populated one, and said a creation was recorded when what is recorded is the menu opening. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_012fRjnaHLwjpHN84gNNxah9 --- .../lib/components/InstanceSettings.svelte | 12 +-- .../src/lib/components/home/ItemsList.svelte | 8 +- .../home/WorkspaceEmptyState.svelte | 78 ++++++++++--------- 3 files changed, 54 insertions(+), 44 deletions(-) diff --git a/frontend/src/lib/components/InstanceSettings.svelte b/frontend/src/lib/components/InstanceSettings.svelte index 875bfec942..a235ac49a7 100644 --- a/frontend/src/lib/components/InstanceSettings.svelte +++ b/frontend/src/lib/components/InstanceSettings.svelte @@ -1073,9 +1073,9 @@ are started for, whether AI chat skills are turned on or off and how often one is loaded, whether SSO logins evaluate an IdP groups claim (SAML or OIDC) and change a membership, the plan tier and quota shown when the execution meter is opened, how often - an empty workspace home is seen and its create menu or hub-project picker opened, and - which home-page entry point a new item is created from, the name of any public hub - project imported from it and how far that import got, last 30 days)
  • feature adoption (counts of which flow, script, trigger and worker features your @@ -1130,9 +1130,9 @@ are started for, whether AI chat skills are turned on or off and how often one is loaded, whether SSO logins evaluate an IdP groups claim (SAML or OIDC) and change a membership, the plan tier and quota shown when the execution meter is opened, how often - an empty workspace home is seen and its create menu or hub-project picker opened, and - which home-page entry point a new item is created from, the name of any public hub - project imported from it and how far that import got, last 30 days)
  • feature adoption (counts of which flow, script, trigger and worker features your diff --git a/frontend/src/lib/components/home/ItemsList.svelte b/frontend/src/lib/components/home/ItemsList.svelte index 0017a4476b..5983e97c38 100644 --- a/frontend/src/lib/components/home/ItemsList.svelte +++ b/frontend/src/lib/components/home/ItemsList.svelte @@ -16,7 +16,7 @@ } from '$lib/gen' import { resource } from 'runed' import { getDraftItems } from '$lib/workspaceDrafts.svelte' - import { userStore, workspaceStore } from '$lib/stores' + import { disableHubStore, userStore, workspaceStore } from '$lib/stores' import type uFuzzy from '@leeoniya/ufuzzy' import { ArrowDownUp, @@ -1813,7 +1813,11 @@ whose direct-deploy protection cleared showEditButtons (NoDirectDeployAlert), since the menu itself does no permission check. --> {#if !$userStore?.operator && showEditButtons} - (hubPickerOpen = true)} /> + + (hubPickerOpen = true)} + /> {/if} diff --git a/frontend/src/lib/components/home/WorkspaceEmptyState.svelte b/frontend/src/lib/components/home/WorkspaceEmptyState.svelte index ccda47ee1d..b3d1422d07 100644 --- a/frontend/src/lib/components/home/WorkspaceEmptyState.svelte +++ b/frontend/src/lib/components/home/WorkspaceEmptyState.svelte @@ -3,7 +3,7 @@ import { logFeatureUsage } from '$lib/utils/featureUsage' import Popover from '$lib/components/meltComponents/Popover.svelte' import { preloadHubProjects, type HubProjectPick } from '$lib/hubProject' - import { workspaceStore } from '$lib/stores' + import { disableHubStore, workspaceStore } from '$lib/stores' import CreateActionsMenu from './CreateActionsMenu.svelte' import HubTemplatePicker from './HubTemplatePicker.svelte' @@ -32,9 +32,10 @@ // Warmed as soon as the empty state renders rather than on the first click: the // catalogue is one request for the whole hub, and paying for it here is what makes - // the picker open on content. + // the picker open on content. Not on an instance with the hub turned off, where the + // request is one the operator has said not to make. $effect(() => { - if ($workspaceStore) preloadHubProjects($workspaceStore) + if ($workspaceStore && !$disableHubStore) preloadHubProjects($workspaceStore) }) @@ -65,38 +66,43 @@ class="border-t border-dashed border-border-light px-4 pb-[22px] pt-[18px] text-center text-[13.5px] leading-relaxed text-hint" > Your scripts, flows and apps will show up here. - - - e.detail && logFeatureUsage('home', 'template_picker_open', { key: 'empty_state' })} - > - {#snippet trigger()}Start from a template{/snippet} - {#snippet content({ close })} - { - close() - onPick(project) - }} - /> - {/snippet} - - or + + {#if !$disableHubStore} + + + e.detail && logFeatureUsage('home', 'template_picker_open', { key: 'empty_state' })} + > + {#snippet trigger()}Start from a template{/snippet} + {#snippet content({ close })} + { + close() + onPick(project) + }} + /> + {/snippet} + + or + {/if} {#snippet trigger()}