@sanity/workflow-studio 0.29.0 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
1
1
  # @sanity/workflow-studio
2
2
 
3
+ ## 0.31.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [ff72ece]
8
+ - @sanity/workflow-engine@0.31.0
9
+ - @sanity/workflow-react@0.31.0
10
+ - @sanity/workflow-sdk@0.31.0
11
+
12
+ ## 0.30.0
13
+
14
+ ### Minor Changes
15
+
16
+ - a3a8dc0: **BREAKING:** the exported `WorkflowObserver` contract (workflow-react) gains two required members, `fetchInstancePreviews` and `listenInstanceChanges` — a custom observer no longer compiles until it implements both; the shipped SDK and Studio adapters already do, so their consumers need no action.
17
+
18
+ The reactive layer gains a progressively-hydrated preview list. `useInstancePreviews` (workflow-react) drains the engine's preview projection page by page until the whole filtered set is held — `drained: true` means counts over it are totals — then keeps every row fresh from ONE shared change listener per engine tag: an event refetches the touched previews alone, so update cost is per commit, never per list size. Page size is caller-supplied. The engine adds `instanceChangesQuery` (the tag partition as a listen filter), and the `WorkflowObserver` contract adds `fetchInstancePreviews` and `listenInstanceChanges`, implemented by the SDK observer (the Studio adapter inherits them). A change-feed failure never silently freezes a list: the SDK observer reconnects with exponential backoff and then emits a `reset` event, on which `useInstancePreviews` re-drains the whole partition — gap-missed additions, edits, and deletions all land.
19
+
20
+ **Docs impact:** The reactive-core reference documents `useInstancePreviews` and the observer contract's two new required members in this release's pass — the Workflows tool ships reading them in the same release, and the custom-adapter guidance must name both members beside the BREAKING note.
21
+
22
+ - a3a8dc0: The Workflows tool now reaches every run. The Overview table, the board, and the Definitions catalog read the progressively-hydrated preview stream instead of a 200-instance capped read: lists fill page by page until the whole partition is held (a "Loading workflows…" note discloses the gap while counts are still a floor), then stay fresh from the shared change feed. Display strings join from the deployed catalog rather than each run's pinned snapshot, so a workflow absent from the catalog shows raw names. The board cuts the shared stream client-side, retiring its per-workflow capped read and cap note. `workflowStudioPlugin` accepts `previewHydration: {pageSize?, interPageDelayMs?}` to tune or simulate hydration, `@sanity/workflow-studio` exports the `useWorkflowInstancePreviews` wrapper, and `useInstancePreviews` (workflow-react) accepts `interPageDelayMs`, a development throttle between hydration pages. No upgrade action required.
23
+
24
+ **Docs impact:** The Workflows-tool guide should drop the capped-read caveat and describe progressive hydration (counts grow until the stream drains); the plugin configuration reference gains `previewHydration`; the Studio adapter reference gains `useWorkflowInstancePreviews`; the reactive-core reference gains `interPageDelayMs` beside `useInstancePreviews`.
25
+
26
+ - b0b1550: **BREAKING:** Product-prefixed telemetry events now use `Workflows <event>` instead of `Editorial Workflows <event>`; `EditorialWorkflowsResource` is replaced by `WorkflowsResource`; and `defineWorkflows` now generates `workflows-<deployment name>` resource names instead of `editorial-workflows-<deployment name>`. Telemetry consumers matching the previous literals stop receiving events until updated, TypeScript consumers importing the previous Blueprint interface no longer compile, and an existing Blueprint stack that relies on the generated name treats the new default as a different resource identity.
27
+
28
+ Update telemetry dashboards, schemas, alerts, and queries to match the `Workflows` prefix; event suffixes, payloads, and versions are unchanged. Replace Blueprint imports with `WorkflowsResource`. Before deploying an existing Blueprint stack, either pass its recorded resource name explicitly or plan the detach-and-create migration to the new default. Workflows request-tag families and billing classification are unchanged.
29
+
30
+ Other user-facing package copy now uses the Workflows product name. No upgrade action is required for consumers that do not match telemetry event names or use the Blueprint package.
31
+
32
+ **Docs impact:** Rename the product throughout the public documentation, move the docs section to `/docs/workflows/*` with permanent redirects from every `/docs/editorial-workflows/*` path, and document the telemetry-prefix, `WorkflowsResource`, and Blueprint resource-name migrations in the telemetry reference, Blueprint guide, and release notes.
33
+
34
+ ### Patch Changes
35
+
36
+ - Updated dependencies [210ca63]
37
+ - Updated dependencies [a3a8dc0]
38
+ - Updated dependencies [a3a8dc0]
39
+ - Updated dependencies [a3a8dc0]
40
+ - Updated dependencies [90207dc]
41
+ - Updated dependencies [a3a8dc0]
42
+ - Updated dependencies [b0b1550]
43
+ - @sanity/workflow-engine@0.30.0
44
+ - @sanity/workflow-react@0.30.0
45
+ - @sanity/workflow-sdk@0.30.0
46
+
3
47
  ## 0.29.0
4
48
 
5
49
  ### Patch Changes
package/README.md CHANGED
@@ -31,9 +31,13 @@ Studio source context (`useSource` / `useClient`).
31
31
  in `unreadable`. Hooks under one Studio source share the auto-bootstrapped
32
32
  SDK instance; callers can instead pass a shared `sdk` explicitly. SDK store
33
33
  errors surface reactively through `error`.
34
+ - `useWorkflowInstancePreviews` — `useInstancePreviews` (workflow-react) bound
35
+ to the auto-bootstrapped observer: the whole tag partition as light preview
36
+ rows, drained page by page and kept fresh from the shared change feed.
37
+ Returns `{previews, loading, drained, unreadable, error}`.
34
38
  - `useStudioProjectUsers` — the shared Studio project-user directory used by
35
39
  actor resolution and member pickers. It returns the upstream membership and
36
- profile records without an Editorial Workflows projection, the project's
40
+ profile records without a Workflows projection, the project's
37
41
  assignable `roles`, and the engine's `ProjectUserDirectory` integration. The
38
42
  role catalog is read alongside the memberships and is the only account of a
39
43
  role nobody currently holds; it is filtered to roles a person can be assigned,
@@ -97,7 +101,7 @@ This adapter composes `@sanity/workflow-sdk`'s store layer through its headless
97
101
 
98
102
  - **`@sanity/sdk` is required** (peer) — it addresses every observed resource.
99
103
  - **`@sanity/workflow-engine` is required** (peer) — the host and adapter share one engine runtime.
100
- - **`@sanity/workflow-react` and `@sanity/workflow-sdk` are required** (exact-version peers) — install the matching Editorial Workflows release stack so the reactive context and SDK store are single-sourced.
104
+ - **`@sanity/workflow-react` and `@sanity/workflow-sdk` are required** (exact-version peers) — install the matching Workflows release stack so the reactive context and SDK store are single-sourced.
101
105
  - **`@sanity/sdk-react` is NOT required** — nothing here touches the App
102
106
  SDK's React binding.
103
107
 
package/dist/index.cjs CHANGED
@@ -187,6 +187,26 @@ function useDocumentWorkflows({engine: engine, document: document, sdk: sdk2}) {
187
187
  });
188
188
  }
189
189
 
190
+ function useWorkflowInstancePreviews({engine: engine, filter: filter, interPageDelayMs: interPageDelayMs, pageSize: pageSize, sdk: sdk2}) {
191
+ const observer2 = useStudioObserver({
192
+ engine: engine,
193
+ sdk: sdk2
194
+ });
195
+ return workflowReact.useInstancePreviews({
196
+ engine: engine,
197
+ observer: observer2,
198
+ ...filter !== void 0 ? {
199
+ filter: filter
200
+ } : {},
201
+ ...interPageDelayMs !== void 0 ? {
202
+ interPageDelayMs: interPageDelayMs
203
+ } : {},
204
+ ...pageSize !== void 0 ? {
205
+ pageSize: pageSize
206
+ } : {}
207
+ });
208
+ }
209
+
190
210
  const PROJECT_USERS_RETRY_MS = 3e4;
191
211
 
192
212
  function isRecord(value) {
@@ -353,6 +373,8 @@ exports.useStudioProjectUsers = useStudioProjectUsers;
353
373
 
354
374
  exports.useWorkflowEngine = useWorkflowEngine;
355
375
 
376
+ exports.useWorkflowInstancePreviews = useWorkflowInstancePreviews;
377
+
356
378
  exports.useWorkflowInstances = useWorkflowInstances;
357
379
 
358
380
  exports.useWorkflowSession = useWorkflowSession;
package/dist/index.d.cts CHANGED
@@ -3,6 +3,8 @@ import { EffectHandler } from "@sanity/workflow-engine";
3
3
  import { Engine } from "@sanity/workflow-engine";
4
4
  import { EnsureDocumentClient } from "@sanity/workflow-react/observer";
5
5
  import type { GdrUri } from "@sanity/workflow-engine";
6
+ import { InstancePreviewList } from "@sanity/workflow-react";
7
+ import { InstancePreviewsFilter } from "@sanity/workflow-react";
6
8
  import type { InstancesQueryFilter } from "@sanity/workflow-engine";
7
9
  import { MissingHandlerPolicy } from "@sanity/workflow-engine";
8
10
  import { MutationGuardDoc } from "@sanity/workflow-react";
@@ -17,6 +19,10 @@ import { WorkflowObserver } from "@sanity/workflow-react/observer";
17
19
  import { WorkflowResource } from "@sanity/workflow-engine";
18
20
  import { WorkflowSession } from "@sanity/workflow-react";
19
21
 
22
+ export { InstancePreviewList };
23
+
24
+ export { InstancePreviewsFilter };
25
+
20
26
  /**
21
27
  * A Studio {@link WorkflowObserver} backed entirely by the App SDK store.
22
28
  * Document and query observation therefore share the SDK's resource-scoped
@@ -158,6 +164,24 @@ export declare function useWorkflowEngine({
158
164
  missingHandler?: MissingHandlerPolicy;
159
165
  }): Engine;
160
166
 
167
+ /** A live, progressively-hydrated instance-preview list observed from Sanity
168
+ * Studio — the drained store behind list surfaces that hold every run. Same
169
+ * routing and `sdk` rules as {@link useWorkflowInstances}. */
170
+ export declare function useWorkflowInstancePreviews({
171
+ engine,
172
+ filter,
173
+ interPageDelayMs,
174
+ pageSize,
175
+ sdk,
176
+ }: {
177
+ engine: Engine;
178
+ filter?: InstancePreviewsFilter;
179
+ /** A development throttle between hydration pages; leave unset in production. */
180
+ interPageDelayMs?: number;
181
+ pageSize?: number;
182
+ sdk?: SanityInstance;
183
+ }): InstancePreviewList;
184
+
161
185
  /** A live, filterable workflow-instance list observed from Sanity Studio
162
186
  * through an App SDK instance (auto-bootstrapped, or supply `sdk`). Must
163
187
  * render inside Studio source context. */
package/dist/index.d.ts CHANGED
@@ -3,6 +3,8 @@ import { EffectHandler } from "@sanity/workflow-engine";
3
3
  import { Engine } from "@sanity/workflow-engine";
4
4
  import { EnsureDocumentClient } from "@sanity/workflow-react/observer";
5
5
  import type { GdrUri } from "@sanity/workflow-engine";
6
+ import { InstancePreviewList } from "@sanity/workflow-react";
7
+ import { InstancePreviewsFilter } from "@sanity/workflow-react";
6
8
  import type { InstancesQueryFilter } from "@sanity/workflow-engine";
7
9
  import { MissingHandlerPolicy } from "@sanity/workflow-engine";
8
10
  import { MutationGuardDoc } from "@sanity/workflow-react";
@@ -17,6 +19,10 @@ import { WorkflowObserver } from "@sanity/workflow-react/observer";
17
19
  import { WorkflowResource } from "@sanity/workflow-engine";
18
20
  import { WorkflowSession } from "@sanity/workflow-react";
19
21
 
22
+ export { InstancePreviewList };
23
+
24
+ export { InstancePreviewsFilter };
25
+
20
26
  /**
21
27
  * A Studio {@link WorkflowObserver} backed entirely by the App SDK store.
22
28
  * Document and query observation therefore share the SDK's resource-scoped
@@ -158,6 +164,24 @@ export declare function useWorkflowEngine({
158
164
  missingHandler?: MissingHandlerPolicy;
159
165
  }): Engine;
160
166
 
167
+ /** A live, progressively-hydrated instance-preview list observed from Sanity
168
+ * Studio — the drained store behind list surfaces that hold every run. Same
169
+ * routing and `sdk` rules as {@link useWorkflowInstances}. */
170
+ export declare function useWorkflowInstancePreviews({
171
+ engine,
172
+ filter,
173
+ interPageDelayMs,
174
+ pageSize,
175
+ sdk,
176
+ }: {
177
+ engine: Engine;
178
+ filter?: InstancePreviewsFilter;
179
+ /** A development throttle between hydration pages; leave unset in production. */
180
+ interPageDelayMs?: number;
181
+ pageSize?: number;
182
+ sdk?: SanityInstance;
183
+ }): InstancePreviewList;
184
+
161
185
  /** A live, filterable workflow-instance list observed from Sanity Studio
162
186
  * through an App SDK instance (auto-bootstrapped, or supply `sdk`). Must
163
187
  * render inside Studio source context. */
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ import { useMemo, useEffect, useSyncExternalStore } from "react";
10
10
 
11
11
  import { useSource, useClient } from "sanity";
12
12
 
13
- import { useWorkflowTelemetry, useWorkflowSession as useWorkflowSession$1, useDocumentWorkflows as useDocumentWorkflows$1, useWorkflowInstances as useWorkflowInstances$1 } from "@sanity/workflow-react";
13
+ import { useWorkflowTelemetry, useWorkflowSession as useWorkflowSession$1, useDocumentWorkflows as useDocumentWorkflows$1, useInstancePreviews, useWorkflowInstances as useWorkflowInstances$1 } from "@sanity/workflow-react";
14
14
 
15
15
  import { loadProjectRolesOrNone, loadProjectUserProfiles } from "@sanity/workflow-sdk/project-users";
16
16
 
@@ -195,6 +195,26 @@ function useDocumentWorkflows({engine: engine, document: document, sdk: sdk}) {
195
195
  });
196
196
  }
197
197
 
198
+ function useWorkflowInstancePreviews({engine: engine, filter: filter, interPageDelayMs: interPageDelayMs, pageSize: pageSize, sdk: sdk}) {
199
+ const observer = useStudioObserver({
200
+ engine: engine,
201
+ sdk: sdk
202
+ });
203
+ return useInstancePreviews({
204
+ engine: engine,
205
+ observer: observer,
206
+ ...filter !== void 0 ? {
207
+ filter: filter
208
+ } : {},
209
+ ...interPageDelayMs !== void 0 ? {
210
+ interPageDelayMs: interPageDelayMs
211
+ } : {},
212
+ ...pageSize !== void 0 ? {
213
+ pageSize: pageSize
214
+ } : {}
215
+ });
216
+ }
217
+
198
218
  const PROJECT_USERS_RETRY_MS = 3e4;
199
219
 
200
220
  function isRecord(value) {
@@ -347,4 +367,4 @@ function useStudioProjectUsers() {
347
367
  };
348
368
  }
349
369
 
350
- export { makeStudioObserver, studioProjectUserDirectory, studioResourceClients, useDocumentWorkflows, useStudioObserver, useStudioProjectUsers, useWorkflowEngine, useWorkflowInstances, useWorkflowSession };
370
+ export { makeStudioObserver, studioProjectUserDirectory, studioResourceClients, useDocumentWorkflows, useStudioObserver, useStudioProjectUsers, useWorkflowEngine, useWorkflowInstancePreviews, useWorkflowInstances, useWorkflowSession };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/workflow-studio",
3
- "version": "0.29.0",
3
+ "version": "0.31.0",
4
4
  "description": "React adapter that drives the @sanity/workflow-engine reactive session in Sanity Studio through the App SDK store.",
5
5
  "keywords": [
6
6
  "sanity",
@@ -50,17 +50,17 @@
50
50
  "react-dom": "^19.2.7",
51
51
  "sanity": "^6",
52
52
  "vitest": "^4.1.8",
53
- "@sanity/workflow-engine": "0.29.0",
54
- "@sanity/workflow-react": "0.29.0",
55
- "@sanity/workflow-sdk": "0.29.0"
53
+ "@sanity/workflow-engine": "0.31.0",
54
+ "@sanity/workflow-react": "0.31.0",
55
+ "@sanity/workflow-sdk": "0.31.0"
56
56
  },
57
57
  "peerDependencies": {
58
58
  "@sanity/sdk": "^2.12.0",
59
59
  "react": "^19.2.7",
60
60
  "sanity": "^6",
61
- "@sanity/workflow-react": "0.29.0",
62
- "@sanity/workflow-engine": "0.29.0",
63
- "@sanity/workflow-sdk": "0.29.0"
61
+ "@sanity/workflow-engine": "0.31.0",
62
+ "@sanity/workflow-react": "0.31.0",
63
+ "@sanity/workflow-sdk": "0.31.0"
64
64
  },
65
65
  "engines": {
66
66
  "node": ">=20"