@sanity/workflow-studio-plugin 0.23.0 → 0.24.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,141 @@
1
1
  # @sanity/workflow-studio-plugin
2
2
 
3
+ ## 0.24.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d029896: Definition detail: the Deployed row shows the full deploy timestamp with its relative age ("23 Jul 2026, 14:05 (9 days ago)") instead of the date plus the deploy tag, a new Active instances row joins the live in-flight count (with the capped-read disclosure), the spawn-only trigger phrase reads "Started by a parent workflow", the stage diagram sits in a labeled Stages row aligned with the facts above and filling the rest of the page, and the facts sit a step further below the title.
8
+
9
+ Hard-loading the page shows one loading row in the title slot instead of two spinners, and the header lands fully resolved in a single pass — no name-then-title swap.
10
+
11
+ - ab56ae3: Add a Documents board to the Workflows tool: pick a deployed workflow and see its documents grouped by stage, as horizontal columns or a stacked list. The tool's tab strip becomes Definitions, Documents, Tasks, For me, and the board's workflow is a path segment (`…/workflows/documents/<name>`) so a board survives a reload and travels in a shared link; a bare `…/workflows/documents` resolves to the first workflow by display title and writes that back. The layout choice persists per engine resource.
12
+
13
+ A card is one RUN, faced by the document that run is about, so a document carrying five runs of the workflow draws five cards — each in the stage its own run sits at. Completed runs park in the stage they finished in; aborted runs are left off. A run whose lead document ref doesn't resolve is faced by its own workflow title instead, which covers both a workflow with no subject entry and a stray unset subject, so no run is dropped. A stage the deployed definition no longer declares holds a trailing column rather than dropping the runs still sitting in it.
14
+
15
+ A card carries the document and nothing else. Assignees are properties of activities rather than of a run or a document, so they stay on the activity rows in the Tasks list and in the activity dialog. The board reads its runs filtered by definition lake-side rather than sharing the tool's newest-instances cap, so a busy neighbouring workflow can't crowd a quieter one's runs off the board; the board carries its own cap of the latest 200 runs, disclosed on the board when it bounds the read.
16
+
17
+ A **View definition** link sits beside the board's workflow picker, opening that workflow's definition detail view — a real link, so it opens in a new tab like any other.
18
+
19
+ Two new UI telemetry events — Board Workflow Selected (carrying the definition content fingerprint and whether the URL named the workflow or the board landed on its default) and Board Layout Changed.
20
+
21
+ Three changes to shared components, two of which reach surfaces outside the board:
22
+ - Document reference previews render through one shell that decides border, radius, tone and inset per layout, so the resolved, pending, missing, foreign and unopenable faces can no longer drift apart. A reference whose probe is still in flight shows a placeholder preview rather than a raw document id.
23
+ - A document reference now states the width it claims: one sitting among other things in a row keeps its compact chip size, while one that IS a list row fills the row and takes the work rows' hit area. The board's stacked layout is the one surface using the new row width; every other document reference keeps the size it had.
24
+ - The form strip's hover on a line with no work assigned to the reader reports what the run's current stage actually holds ("3 open tasks, none assigned to you") instead of restating that nothing is theirs. While the stage's read is still outstanding it names the destination instead of claiming a count it doesn't have yet.
25
+
26
+ - 41a3f02: Add `dueDate` and `dueDatetime` field kinds — elevated aliases of `date` / `datetime` (same stored value and validation) that mark THE due date of a level, so surfaces can identify a deadline by kind instead of guessing which date field means "due". Declarable at workflow, stage, and activity scope; optional (no field becomes required). The kind reserves a level's single due slot, so deploy enforces both halves of that: at most one due-\* (either kind, combined) per scope, and none below scope level — a due-\* nested in an `object`/`array` sub-field or an effect's `outputs` is rejected, naming `date` / `datetime` as the fix, because no deadline reader looks there. A `todoList` row's `dueDate` column is unaffected; it is a `date` named `dueDate`, not the kind. Choice lists (`options`) work on the due kinds exactly as on `date` / `datetime`. Persisted-model version 5 (additive, reader floor unchanged).
27
+
28
+ The Studio plugin edits and renders the new kinds exactly like the base kinds they elevate: the calendar picker in the start dialog, the Overview pills, the inline field editors and the activity row's date control, a locale-formatted face, and the Workflows tool's Date filter. Every date-family branch now routes through one shared kind predicate, so an elevated alias can't drift out of a site.
29
+
30
+ - 333f1d0: An in-flight workflow can be aborted from the Workflows tool's instance detail view: an **Abort workflow** button sits between the stage card and the history feed, and its confirm names the workflow and requires a reason, which lands on the workflow's history. A settled instance shows no button.
31
+
32
+ Abort lives on that one page rather than on every surface that lists an instance. Instances are named on both document-view tabs and both tool task tabs, and a destructive control repeated down a work queue is noise and a misclick risk, so the list surfaces link to the instance instead of carrying the action.
33
+
34
+ An abort that commits nothing because the instance reached a terminal state while the confirm was open reports that outcome instead of claiming a successful abort. A rejected abort reports an unconfirmed outcome: the engine commits the instance's abort before draining condemned children and propagating to ancestors, so a rejection never proves that nothing happened.
35
+
36
+ Abort visibility is advisory, like every other engine-side check — the Content Lake remains the only enforcement point, and its instance-document `update` grant cannot distinguish an abort from an ordinary transition commit.
37
+
38
+ - 043f8e0: Mapping validation accepts a row whose definition leaves a required field for the start dialog to collect. A definition declaring a required input entry beyond its subject — a reason, a priority, a release the perspective doesn't supply — is startable: the row's Start control is enabled and the dialog asks for the entry, holding Start until it is filled. Validation rejects a row only for faults a developer must fix: an undeployed definition, a seed that lands nowhere (undeclared name, mismatched kind, non-input source, duplicate, invalid scope), a `types` facet that rejects the mapped document type, and a seeded local reference carrying a document type the Studio schema doesn't declare.
39
+
40
+ A rejected row's diagnostic is developer-facing and stays out of editor surfaces. The disabled Start control in the form strip and the Workflows document view reads `Unavailable — this workflow isn't set up correctly for <Document type> documents`, naming the document type as the Studio schema titles it. The diagnostic goes where a developer already is: in the Workflows tool, a definition whose bindings are refused renders its catalog row in caution with a warning icon, and its detail view carries a Setup issue card stating the reason per document type. A configured workflow with nothing deployed under its name owns no catalog row, so the catalog names it directly — `"<name>" is set up to run on <Document type> documents, but no deployed workflow has that name` — including when nothing at all is deployed.
41
+
42
+ Mapping diagnostics log as warnings — the verdicts are advisory, and nothing has failed at runtime. Each rejected row gets one line naming the row, which is what its author can act on. Every rejection is a row the host wrote: discovery derives a row only when the definition's subject entry accepts that document type, and that is the condition every remaining verdict leg reads, so a derived row has nothing left to fail.
43
+
44
+ Discovery binds workflows only to document types an author declares. Studio's reserved `sanity.` namespace — the built-in asset documents among it — and the engine's own document types are skipped, so a definition whose subject declares no `types` is not offered on file and image uploads. An explicit mapping row still binds one, and a workflow field referencing a system document is unaffected.
45
+
46
+ - 1cec9c8: `Editorial Workflows Studio Plugin Action Control Used` bumps to payload version 2: `surface` now names the hosting view or dialog (document view, tool instance detail, tool task list, activity dialog — the same vocabulary as the other attributed events), and the physical placement (`dialog-strip`, `inline-row`, `terminal-footer`) moves to its own `placement` field. Downstream consumers reading v1's placement values out of `surface` must switch on the event version.
47
+
48
+ Four new UI telemetry events close attribution gaps in the plugin's engagement vocabulary. `Editorial Workflows Studio Plugin Field Control Used` logs every inline field-edit commit (assignee, date, scalar, choice, doc-ref, and notes controls) with the hosting surface (document view, tool instance detail, tool task list, or the activity dialog), the declared field kind, and a success flag — the unsampled, failure-aware companion the engine's sampled field-edited event can't provide; the todo list keeps its own seam and never emits this event. `Editorial Workflows Studio Plugin Todo Edited` completes the todo family's coverage: the list's non-toggle writes — an item added, a per-item assignee or due-date patch — log the gesture kind, surface, and success flag beside the toggles' existing Todo Toggled event. `Editorial Workflows Studio Plugin Document Link Clicked` logs the click-through from a workflow surface (field values, doc-ref chips, the detail title, the activity dialog's subject line) to the referenced document's editor. `Editorial Workflows Studio Plugin Definition Detail Viewed` logs the tool's per-definition detail view once the catalog read resolves, carrying the definition's content fingerprint rather than its customer-authored name.
49
+
50
+ - 2ecde51: To-do items on a live instance can be removed. A remove button sits on a row when the view owns the list that row belongs to and the row's field is editable — the activity dialog for an activity's own checklist, the to-do field dialog for a workflow- or stage-scoped one. A view offers nothing for rows it merely lists: the assigned-to-me reading has no removal at all, on the same rule that withholds its "Add item", and a view that reaches a row only through a tick action cannot drop it. Removal commits through the same field seam as the other row edits, with no confirmation step, an optimistic repaint, and a toast if the write fails. `TodoEditKind` includes a `remove` gesture, which the todo-edited telemetry event carries for these writes.
51
+
52
+ Editing and removing a to-do both refuse a stored list whose ids don't name exactly one row, and say why. Both rewrites identify their row by `_key`, so a duplicated id would otherwise edit or delete every row sharing it, and an id present in no row would write a silent no-op; a list in either state is reported as needing repair instead.
53
+
54
+ - 599e2e0: Workflows tool navigation reordered: Definitions is now the first tab and the landing view (`…/workflows`), followed by Tasks (the task list, at `…/workflows/tasks`) and For me. The Tasks tab presents every document group and instance band unfurled by default; collapsing remains an explicit, remembered toggle. The stored expand/collapse payload moves to a new version, so toggles saved by earlier plugin versions are discarded.
55
+ - cf0e85f: Stop telling editors a saved change failed. A commit that lands and then fails to
56
+ run its effects rejected the same promise a broken write rejects, so it reached
57
+ the editor as a critical `Failed to …` above a description saying the change was
58
+ committed — inviting them to redo work the engine had already persisted. That
59
+ case is now a typed rejection of its own: caution, titled so the editor knows
60
+ their change is safe, and carried under its own toast id so a later retry cannot
61
+ overwrite the only notice that the write landed.
62
+
63
+ A gesture that succeeds now clears its own outstanding toast. Without that, a
64
+ refusal the editor resolved could sit beside the row that shows the action
65
+ landed — for the full reason dwell, since a fired action raises no confirmation
66
+ of its own.
67
+
68
+ - cf0e85f: Settle Studio plugin toast copy on one grammar and stop toasts stacking. A
69
+ critical toast's title names what did not land — normally
70
+ `Failed to <verb phrase>`, replacing three competing constructions
71
+ (`Saving failed`, `Could not create document`, `Couldn’t resolve effect`), or the
72
+ outcome itself where that is shorter than restating the description, as a failed
73
+ orphan re-check now reads `Nothing was cleaned up` with the reason below it.
74
+
75
+ Authored text is quoted rather than conjugated: an action label is supplied by
76
+ whoever wrote the definition, so a title that put it in a verb slot only read
77
+ correctly for labels that happen to be verbs.
78
+
79
+ Contractions in editor-facing copy use a typographic apostrophe throughout;
80
+ several strings that feed toast descriptions used an ASCII one, so a single
81
+ toast could mix both.
82
+
83
+ Each toast now carries a stable id naming its gesture, so repeating a gesture
84
+ replaces its previous toast instead of stacking a column of cards, and a
85
+ refusal the editor then resolves can't sit beside the retry that succeeded.
86
+
87
+ - cf0e85f: Hold Studio plugin toasts that carry a reason on screen longer. Every toast used
88
+ the toast provider's default dwell, which is tuned for a glanceable line — so a
89
+ partial orphan cleanup listing one line per skipped-or-failed workflow was taken
90
+ away on the same timer as "Details copied to clipboard". A toast that carries a reason to read — a caution or critical one with a
91
+ description — now dwells for 20 seconds; a glanceable confirmation keeps the
92
+ default.
93
+ - cf0e85f: Tone Studio plugin toasts off what actually happened. An engine refusal — an
94
+ action the gate declined, a field outside its edit window, a guard holding the
95
+ document — now reaches editors as caution rather than critical, so a red toast
96
+ means a write was attempted and broke. A field-edit refusal also renders the
97
+ sentence the disabled control would have shown instead of the engine's
98
+ `Field "scope:field" is not editable` developer string.
99
+
100
+ Confirmations move from positive to neutral, and a fired action no longer
101
+ toasts at all: the row repaints when the commit settles, so a landed fire
102
+ reports itself. `success` is now unused across the plugin — the Studio hosting it
103
+ already toasts green for the document operations a workflow triggers.
104
+
105
+ ### Patch Changes
106
+
107
+ - 097632c: Render a finished workflow's terminal stage in gray rather than the primary blue: the stage label and glyph take the default badge tone, the glyph becomes the filled checkmark that already marks a completed activity, and the stage chip's pill swaps the primary tone and its focus-ring blue for the plain card tone with a ring in that same dark gray. This covers every surface showing a completed stage face — the document form strip's finished lines and the stage band in the Workflows document view and tool — so primary blue marks a run in flight and dark gray one that settled.
108
+ - 599e2e0: Document-type badges on the definitions catalog render on a single line, truncating long titles with an ellipsis instead of wrapping the pill onto two lines and stretching its radius.
109
+ - 599e2e0: The Definitions and Tasks tabs render their empty states as the shared empty-state card (centered icon, headline, explanation) the For me tab already uses, instead of a single status line.
110
+ - 599e2e0: Workflows tool URLs that resolve to nothing now recover instead of dressing up as content. A tab segment naming no tab (for example `…/workflows/foo`) replaces itself with the tool home's URL. The instance and definition detail views share one not-found face — an explanatory note over a back button that returns to the list the detail belongs to (“Back to all tasks” for instances, “Back to all definitions” for definitions), derived from the route's own tab mapping. A definition detail for an unknown name no longer shows a title line.
111
+ - d570436: A project-member directory that has not answered yet reports `loading` instead of reading as a loaded directory with no members. Its fetch starts from a consumer's effect, one commit after the first render, so that first pass previously looked settled-and-empty — enough for the plugin to warn that the logged-in user is not a project member before anything had been fetched, on every fresh page load.
112
+
113
+ The plugin's identity bridge now resolves the logged-in user before consulting the directory's state. An id that carries its own account-global identity — a `g…` global id, a robot, the global id embedded in a third-party-login `e-` id — resolves immediately and is unaffected by a directory that is still loading or has failed. Only a plain project-scoped id needs the member join, so only it waits, and only it can turn out unresolvable once the directory answers. That case keeps its warning, and a directory that failed to load now says so and names the failure instead of attributing it to project membership.
114
+
115
+ - 9554d46: The Workflows tool's task list waits for the document groups' preview titles before revealing — up to a short max wait, since an unreadable document's title never resolves — and mounts once in its settled alphabetical order, rather than painting in document-id order and re-sorting as titles land. A cold load answers titles with one batched query (compiled from each type's preview select where that select can be expressed as a flat projection, the type's own `prepare` applied) that also seeds the doc-ref link verdicts, so the wait usually shrinks to a single round trip instead of several chained preview-store hydration waves; types the compiler can't express, and documents the batch can't read, still resolve through the live pipeline under the bounded wait. The live preview observations stay open and always win over the seed, so renames, deletions, and new documents keep flowing in real time. A seeded title a live observation later contradicts warns in the console (document id only) and emits one `Editorial Workflows Studio Plugin Title Seed Drifted` telemetry event per task-list mount, count-only payload. A doc-ref face whose link verdict is still undecided renders a time-boxed title skeleton instead of the raw document id, degrading to the bare id when the verdict is still undecided after a few seconds; the face upgrades to a linked preview or a notice whenever the verdict lands.
116
+ - 208a9e1: Expanding or collapsing one band in the Workflows tool no longer repaints the rest of the page. A segment's expand/collapse memory moves from state held above the list to a subscribable store: a toggle notifies every band, but each band reads only its own key, so the bands that re-render are the ones whose state changed. The Documents board's stacked layout rides the same mechanism. Persistence is unchanged — explicit toggles only, per segment, same stored payload and cap.
117
+ - Updated dependencies [d029896]
118
+ - Updated dependencies [0bc4328]
119
+ - Updated dependencies [d029896]
120
+ - Updated dependencies [0bc4328]
121
+ - Updated dependencies [0bc4328]
122
+ - Updated dependencies [0bc4328]
123
+ - Updated dependencies [0bc4328]
124
+ - Updated dependencies [0bc4328]
125
+ - Updated dependencies [4b7531f]
126
+ - Updated dependencies [0bc4328]
127
+ - Updated dependencies [0bc4328]
128
+ - Updated dependencies [0bc4328]
129
+ - Updated dependencies [0bc4328]
130
+ - Updated dependencies [0bc4328]
131
+ - Updated dependencies [41a3f02]
132
+ - Updated dependencies [d570436]
133
+ - @sanity/workflow-diagram@0.24.0
134
+ - @sanity/workflow-engine@0.24.0
135
+ - @sanity/workflow-studio@0.24.0
136
+ - @sanity/workflow-components@0.24.0
137
+ - @sanity/workflow-react@0.24.0
138
+
3
139
  ## 0.23.0
4
140
 
5
141
  ### Minor Changes
package/README.md CHANGED
@@ -12,9 +12,13 @@ current stage, your task count, and a **Start workflow** button), and a
12
12
  **Workflows tab** next to the editor with the stage's activities and to-dos,
13
13
  where they fire actions, and a **Workflows tool** in the Studio navbar — the
14
14
  open tasks across the newest workflow instances (capped), the user's own cut
15
- of them, the deployed definitions catalog, and deep-linkable per-instance and
16
- per-definition detail views (the instance detail carries the full history
17
- feed).
15
+ of them, the deployed definitions catalog, one chosen workflow's documents
16
+ grouped by stage (as side-by-side columns or a stacked list, at its own
17
+ shareable address), and deep-linkable per-instance and per-definition detail
18
+ views (the instance detail carries the full history feed). That detail view is also where a running workflow can be stopped: an
19
+ **Abort workflow** button below the stage card, against a reason recorded in
20
+ the workflow's history. Aborting is open to anyone who can act on the
21
+ instance, and cannot be undone.
18
22
 
19
23
  Four ideas cover everything in this guide:
20
24
 
@@ -148,7 +152,10 @@ export default defineConfig({
148
152
  ```
149
153
 
150
154
  The plugin discovers deployed definitions whose caller-provided subject accepts
151
- a document type in this Studio schema. Start the studio and open an `article`:
155
+ a document type this Studio schema declares. System document types Sanity's
156
+ reserved `sanity.` namespace, the built-in asset documents among it, and the
157
+ engine's own types — are never discovered; binding a workflow to one takes an
158
+ explicit mapping row. Start the studio and open an `article`:
152
159
  the workflow strip above the form
153
160
  offers **Start workflow**. Once started, the strip shows the current
154
161
  stage, the document footer shows an **active workflow** chip, and the