Commit a4c84b5
fix(config): resolve the deployment shape on the server and read it through one client reader
Client-side deployment flags (`isHosted`, `isBillingEnabled`, `isChatEnabled`,
provider-configured flags, and the enterprise feature set) were module constants
computed once from the `NEXT_PUBLIC_*` transport the root layout emits. A
document that never runs the root layout — Next's bare `__next_error__` 404
shell, or `global-error` after the root or workspace layout throws — leaves
every one of them unset for the life of the tab, including after `retry()` or
a client-side navigation recovers the app in place. Sim Cloud then rendered as
self-hosted: an API Key field on every hosted-model block, no Auto model, no
billing sections, "Self hosting" in settings.
Project the deployment shape into the workspace host context, resolved on the
server per request (`resolveDeploymentShape`), and give browser code one
reader: `useDeploymentShape()` for components and `getDeploymentShape()` for
block conditions, sub-block visibility, stores, and helpers. The host provider
seeds the reader during its own render, ahead of any workspace child, so the
first paint already reads the server value; outside a workspace, where the root
layout always runs, the env constants remain the fallback.
Parameterize the settings catalog on the shape instead of module constants:
`selfHostedOverride` names a feature key resolved by
`isSelfHostedOverrideEnabled`, `buildUnifiedSettingsCatalog` is unfiltered so
`/settings/self-host` redirects to General on hosted instead of 404ing, and the
server section gate passes the same shape. Retire the browser-hostname fallback
for `isHosted` (superseded) and the module-scope env reads in the catalog.
Tests cover the resolver, the env-less document with and without a seeded
shape, provider seeding order, catalog resolution on both deployment kinds,
and the billing gate reading the host context; four component suites move from
partial `env-flags` factories to `setEnvFlags`.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>1 parent 389eea4 commit a4c84b5
65 files changed
Lines changed: 1081 additions & 389 deletions
File tree
- .claude/rules
- apps/sim
- app/workspace/[workspaceId]
- components/invite-modal
- home/components
- credits-chip
- message-content/components/special-tags
- integrations
- [block]
- components/showcase-with-explore
- knowledge/[id]/components
- logs/components/log-details
- providers
- settings
- [section]
- components
- byok
- general
- components
- recently-deleted
- teammates
- w
- [workflowId]/components
- panel
- components/deploy/components/deploy-modal/components/chat
- hooks
- workflow-block
- components/sidebar
- components
- search-modal
- settings-sidebar
- workspace-header
- blocks
- blocks
- components/settings
- ee
- access-control/components
- data-retention/components
- organization-usage/components
- session-policy/components
- sso/components
- whitelabeling/components
- workspace-forking/components
- hooks
- queries
- lib
- api/contracts
- billing
- core/config
- settings/application
- workflows/subblocks
- workspaces
- stores/terminal/console
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
| |||
190 | 191 | | |
191 | 192 | | |
192 | 193 | | |
193 | | - | |
| 194 | + | |
194 | 195 | | |
195 | 196 | | |
196 | 197 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | | - | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
287 | 288 | | |
288 | 289 | | |
289 | 290 | | |
290 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
291 | 294 | | |
292 | 295 | | |
293 | 296 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| |||
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
94 | | - | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
Lines changed: 8 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
2990 | 2990 | | |
2991 | 2991 | | |
2992 | 2992 | | |
| 2993 | + | |
2993 | 2994 | | |
2994 | 2995 | | |
2995 | 2996 | | |
2996 | 2997 | | |
2997 | | - | |
| 2998 | + | |
2998 | 2999 | | |
2999 | 3000 | | |
3000 | 3001 | | |
3001 | 3002 | | |
3002 | | - | |
| 3003 | + | |
3003 | 3004 | | |
3004 | 3005 | | |
3005 | 3006 | | |
| |||
3032 | 3033 | | |
3033 | 3034 | | |
3034 | 3035 | | |
3035 | | - | |
3036 | | - | |
3037 | | - | |
| 3036 | + | |
| 3037 | + | |
| 3038 | + | |
3038 | 3039 | | |
3039 | 3040 | | |
3040 | 3041 | | |
3041 | | - | |
| 3042 | + | |
3042 | 3043 | | |
3043 | 3044 | | |
3044 | 3045 | | |
| |||
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
200 | | - | |
| 201 | + | |
201 | 202 | | |
202 | 203 | | |
203 | 204 | | |
| |||
279 | 280 | | |
280 | 281 | | |
281 | 282 | | |
282 | | - | |
| 283 | + | |
283 | 284 | | |
284 | 285 | | |
285 | 286 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | | - | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
Lines changed: 7 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
0 commit comments