canopycms 0.2.0 → 0.3.1

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.
Files changed (74) hide show
  1. package/CHANGELOG.md +213 -41
  2. package/dist/api/branch.d.ts +2 -2
  3. package/dist/api/branch.js +4 -31
  4. package/dist/authorization/branch.js +3 -4
  5. package/dist/cli/cli.js +0 -18
  6. package/dist/cli/generate-ai-content.js +0 -6
  7. package/dist/cli/init.js +0 -6
  8. package/dist/editor/BranchManager.d.ts +2 -0
  9. package/dist/editor/BranchManager.js +3 -3
  10. package/dist/editor/Editor.js +253 -128
  11. package/dist/editor/EntryNavigator.d.ts +44 -9
  12. package/dist/editor/EntryNavigator.js +275 -103
  13. package/dist/editor/branch-lock.d.ts +42 -0
  14. package/dist/editor/branch-lock.js +79 -0
  15. package/dist/editor/branch-status.d.ts +0 -6
  16. package/dist/editor/branch-status.js +0 -10
  17. package/dist/editor/components/BranchNotAvailableNotice.d.ts +11 -0
  18. package/dist/editor/components/BranchNotAvailableNotice.js +10 -0
  19. package/dist/editor/components/BranchPill.d.ts +3 -18
  20. package/dist/editor/components/BranchPill.js +7 -10
  21. package/dist/editor/components/EditorHeader.d.ts +24 -52
  22. package/dist/editor/components/EditorHeader.js +151 -71
  23. package/dist/editor/components/EditorRail.d.ts +8 -8
  24. package/dist/editor/components/EditorRail.js +7 -5
  25. package/dist/editor/components/EntryBreadcrumb.d.ts +5 -1
  26. package/dist/editor/components/EntryBreadcrumb.js +3 -3
  27. package/dist/editor/components/EntryHeader.d.ts +60 -0
  28. package/dist/editor/components/EntryHeader.js +45 -0
  29. package/dist/editor/components/EntrySaveButton.d.ts +24 -0
  30. package/dist/editor/components/EntrySaveButton.js +101 -0
  31. package/dist/editor/components/NoEditPermissionNotice.d.ts +1 -1
  32. package/dist/editor/components/NoEditPermissionNotice.js +1 -1
  33. package/dist/editor/components/RetryToastMessage.d.ts +3 -1
  34. package/dist/editor/components/RetryToastMessage.js +8 -4
  35. package/dist/editor/components/SaveAllButton.d.ts +25 -0
  36. package/dist/editor/components/SaveAllButton.js +81 -0
  37. package/dist/editor/components/UnsavedMark.d.ts +1 -1
  38. package/dist/editor/components/UnsavedMark.js +1 -1
  39. package/dist/editor/components/index.d.ts +1 -1
  40. package/dist/editor/components/index.js +1 -1
  41. package/dist/editor/copy.d.ts +0 -1
  42. package/dist/editor/copy.js +0 -1
  43. package/dist/editor/editor-utils.d.ts +2 -2
  44. package/dist/editor/editor-utils.js +2 -2
  45. package/dist/editor/entry-search.d.ts +10 -16
  46. package/dist/editor/entry-search.js +4 -24
  47. package/dist/editor/hooks/useBranchManager.d.ts +7 -3
  48. package/dist/editor/hooks/useBranchManager.js +13 -9
  49. package/dist/editor/hooks/useEntryManager.d.ts +3 -0
  50. package/dist/editor/hooks/useEntryManager.js +10 -3
  51. package/dist/editor/shell/ActivityRail.d.ts +4 -0
  52. package/dist/editor/shell/ActivityRail.js +13 -4
  53. package/dist/editor/shell/EditorShell.d.ts +6 -7
  54. package/dist/editor/shell/EditorShell.js +9 -13
  55. package/dist/editor/shell/PaneLayout.d.ts +1 -0
  56. package/dist/editor/shell/PaneLayout.js +23 -5
  57. package/dist/editor/shell/SidePanelHost.d.ts +11 -4
  58. package/dist/editor/shell/SidePanelHost.js +95 -7
  59. package/dist/editor/shell/TopBar.d.ts +4 -4
  60. package/dist/editor/shell/TopBar.js +6 -3
  61. package/dist/editor/utils/focus-return.d.ts +10 -2
  62. package/dist/editor/utils/focus-return.js +40 -6
  63. package/dist/operating-mode/client-safe-strategy.d.ts +1 -6
  64. package/dist/operating-mode/client-safe-strategy.js +1 -10
  65. package/dist/operating-mode/types.d.ts +0 -3
  66. package/dist/version.d.ts +1 -1
  67. package/dist/version.js +1 -1
  68. package/package.json +1 -1
  69. package/dist/editor/components/BranchLockBanner.d.ts +0 -23
  70. package/dist/editor/components/BranchLockBanner.js +0 -66
  71. package/dist/editor/components/QuickOpenPalette.d.ts +0 -28
  72. package/dist/editor/components/QuickOpenPalette.js +0 -71
  73. package/dist/editor/components/SaveSplitButton.d.ts +0 -31
  74. package/dist/editor/components/SaveSplitButton.js +0 -121
package/CHANGELOG.md CHANGED
@@ -5,9 +5,9 @@ packages release together, at one version.
5
5
 
6
6
  ## This build
7
7
 
8
- Version `0.2.0`, built from [`ecd004a`](https://github.com/safeinsights/canopycms/tree/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463).
8
+ Version `0.3.1`, built from [`2924058`](https://github.com/safeinsights/canopycms/tree/2924058c932bb84bb07466ecaab6562d46c8825c).
9
9
 
10
- Its entries are [0.2.0](#020), under **Released**.
10
+ Its entries are [0.3.1](#031), under **Released**.
11
11
 
12
12
  If you upgraded from a build on another branch, compare the `<!-- changeset: … -->` slugs in your previous build's `CHANGELOG.md` (`npm pack canopycms@<old>` fetches it) with this one's: entries whose slug your old file lacks are new to you.
13
13
 
@@ -24,7 +24,7 @@ Each entry has up to three parts:
24
24
  `node_modules/canopycms/CHANGELOG.md`, assembled for that build: its **This build** section lists
25
25
  what is new since the previous int on the same branch, or on a stable release links its entries, and its links point at the commit the build
26
26
  came from. The copy in the repository holds released history and the entries from before changesets;
27
- every entry written since is a file in [`.changeset/`](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/.changeset/README.md) until a stable release
27
+ every entry written since is a file in [`.changeset/`](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/.changeset/README.md) until a stable release
28
28
  moves it here.
29
29
 
30
30
  **Find your starting point.** From a stable pin, start at the first version under **Released**
@@ -62,6 +62,178 @@ entries under **Released**.
62
62
 
63
63
  ## Released
64
64
 
65
+ ### 0.3.1
66
+
67
+ #### The branch list shows exactly the branches you can open
68
+
69
+ <!-- changeset: branch-list-follows-access-check -->
70
+
71
+ _First in 0.3.1._
72
+
73
+ **What changed.** The branch list now includes a branch only when branch access grants it, so
74
+ the two can no longer disagree. Under `defaultBranchAccess: 'allow'`, a colleague's branch with
75
+ no ACL now appears in your list, and opening it no longer shows "Not available · read-only" with
76
+ Save locked while its content loads. A branch whose explicit ACL leaves out its own creator no
77
+ longer appears in that creator's list, matching the access check that already refused them.
78
+
79
+ ### 0.3.0
80
+
81
+ #### The branch bar's tooltips open beside their controls
82
+
83
+ <!-- changeset: bar-tooltips-beside-controls -->
84
+
85
+ _First in 0.3.0._
86
+
87
+ **What changed.** The tooltips on the bar's unsaved count, Save all and the branch-actions caret
88
+ no longer open a fixed distance below the bar, where a bar wrapped to several rows put them over
89
+ the entry's Save and breadcrumb, and a one-row bar over the preview toolbar. The unsaved count's
90
+ and the caret's open at their control. Save all's opens to its left, in the bar's free middle,
91
+ and below it when the left edge has no room. The unsaved count's tooltip now reads "Show unsaved
92
+ entries in the content panel".
93
+
94
+ #### The top bar becomes the branch bar — **behaviour change**
95
+
96
+ <!-- changeset: branch-bar-layout -->
97
+
98
+ _First in 0.3.0._
99
+
100
+ **What changed.** The branch pill moves to the start of the top bar, and its menu opens from
101
+ there. The actions on the branch sit at the bar's other end: the warning that drafts could not
102
+ be stored on this device, then Save all, then Submit for review or Withdraw from review. Below
103
+ the `md` breakpoint, on a branch you can edit, Save all and the review action share one split
104
+ button: Save all is the button, and its caret holds Submit or Withdraw. A branch with no review
105
+ action draws no caret. The confirm dialog returns focus to the review action, and focus follows
106
+ that action when a submit or withdraw moves it between the caret and a button of its own.
107
+
108
+ #### The branch bar states a locked branch's status, replacing the lock banner — **behaviour change**
109
+
110
+ <!-- changeset: branch-bar-status -->
111
+
112
+ _First in 0.3.0._
113
+
114
+ **What changed.** The banner under the top bar is gone. A branch's lasting state now shows
115
+ once, beside the branch pill, at every width: "Loading branch…", "Protected · read-only", "In
116
+ review · read-only", "Approved · read-only", "Archived · read-only", "Details unavailable ·
117
+ read-only" when branch details failed to load, "Not available · read-only" when the branch list
118
+ has no such branch for you, or "Protected" for a protected branch that still takes edits. Screen
119
+ readers hear the status with its reason when a lock arrives. The pill no longer carries a status
120
+ badge, and on a phone it shows the branch name, truncated, with the full name heading its menu.
121
+ The bar offers the way forward: New branch…, which opens Branches on its new-branch form, on the
122
+ protected base branch; Withdraw from review on a branch in review; Refresh branch when details
123
+ failed to load; and Switch branch… otherwise. Below the `md` breakpoint a locked branch has no
124
+ Save all: its way forward leads, with Submit or Withdraw in its caret unless Withdraw is that way.
125
+ Someone who may not withdraw gets Switch branch…, with the blocked Withdraw and its reason in the
126
+ caret.
127
+
128
+ #### The content panel lists unsaved entries under a Changed filter, replacing the pill's list — **behaviour change**
129
+
130
+ <!-- changeset: changed-filter -->
131
+
132
+ _First in 0.3.0._
133
+
134
+ **What changed.** The branch pill's menu no longer lists the unsaved entries. It keeps Switch
135
+ branch…, Refresh branch and Discard all changes. The unsaved count leaves the pill, and Save all
136
+ no longer carries it: "N unsaved" beside the branch's status opens the content panel filtered to
137
+ Changed, with any search cleared, in the overlay on a narrow window. The panel's All / Changed
138
+ choice lists only entries with unsaved changes, under the collections that hold them, and
139
+ combines with the search field. Enter opens the first one. Changed says when nothing is unsaved,
140
+ when no unsaved entry matches the search, when some entries are still being listed, and when the
141
+ entry list failed to load; an unsaved entry outside the content tree is offered beneath it.
142
+ Finding an entry with Mod+P, or switching branch, goes back to All. The entry menu gains "Show
143
+ in content panel": it opens the panel on All, with the search cleared, and focuses the entry's
144
+ row.
145
+
146
+ #### Save moves into a header over the open entry, and Save all becomes its own button — **behaviour change**
147
+
148
+ <!-- changeset: entry-header-save -->
149
+
150
+ _First in 0.3.0._
151
+
152
+ **What changed.** A header above the preview and form holds the open entry's breadcrumb, entry
153
+ menu, unsaved dot, "Read-only" chip and Save. It stays in view while the preview is maximized,
154
+ and with no entry open Save stays there, blocked, saying to open one; while entries load, the
155
+ crumb is a placeholder. "Save all" leaves Save's
156
+ menu for a button of its own in the top bar, showing the unsaved count and then its progress,
157
+ and waits while any entry is saving. Save waits while Save all runs, and says why. The warning
158
+ that drafts could not be stored on this device now shows whenever anything on the branch is
159
+ unsaved, not only the open entry.
160
+
161
+ #### EntryNavigator's `revealCollection` prop is replaced by `reveal` — **breaking (EntryNavigator props)**
162
+
163
+ <!-- changeset: entry-navigator-props -->
164
+
165
+ _First in 0.3.0._
166
+
167
+ **What changed.** `EntryNavigatorProps` loses `revealCollection` and gains `reveal`, a
168
+ `ContentPanelReveal` (a new export of `canopycms/client`). `EntryNavItem` gains an optional
169
+ `route`. The other additions are all optional: `onChangedOnlyChange`, `changedOnly`,
170
+ `unsavedCount`, `unsavedEntries`, `entryListFailed`, `branchNotAvailable`, `onSwitchBranch`,
171
+ `onFilterEnter`, `onFilterEscape`, `onRowMenuOpen`, `filterRef` and `filterShortcut`. No prop
172
+ became required, and the editor's own use of the navigator needs no change. Only code that
173
+ renders `EntryNavigator` directly is affected.
174
+
175
+ **To adopt.** Where you pass `revealCollection={{ path, seq }}`, pass
176
+ `reveal={{ kind: 'collection', path, seq }}` instead. `reveal` also takes
177
+ `{ kind: 'entry', path, seq }` for an entry's row and `{ kind: 'changed', seq }` to clear the
178
+ query for the Changed filter. `onRevealed` is unchanged. A `reveal` of kind `collection` or
179
+ `entry` calls `onChangedOnlyChange(false)`, so a controlled `changedOnly` returns to All.
180
+
181
+ #### A branch you can't open says so everywhere, and locked drafts say why they wait
182
+
183
+ <!-- changeset: no-access-branch-and-locked-drafts -->
184
+
185
+ _First in 0.3.0._
186
+
187
+ **What changed.** On a branch the branch list doesn't include for you ("Not available ·
188
+ read-only" in the bar), once its content fails to load, the content panel and the form pane say
189
+ "You don't have access to this branch, or it no longer exists." and offer Switch branch…, which
190
+ opens Branches; the preview pane says the same. They used to read "No content" and "Select an
191
+ item to start editing." No failed load is toasted on that branch. On any other branch, a failed
192
+ content load keeps its "Could not load content" toast with Retry, now in plain words, with any
193
+ diagnostic behind a "Details" disclosure. On a locked branch, the bar's "N unsaved" tooltip says
194
+ the edits are in this browser and what lets them be saved: "Withdraw to save them." in review or
195
+ approved, for someone who may withdraw; a pointer to "Refresh branch" when details failed to
196
+ load; and, on a protected or archived branch, that they can only be discarded.
197
+
198
+ #### One search: Mod+P opens the content panel's "Find entries" field, and the quick-open dialog is gone — **behaviour change**
199
+
200
+ <!-- changeset: one-entry-search -->
201
+
202
+ _First in 0.3.0._
203
+
204
+ **What changed.** Finding an entry has one place, the content panel's field, now called "Find
205
+ entries" and showing its shortcut (⌘P on macOS, Ctrl+P elsewhere). Mod+P focuses it from
206
+ anywhere, a form field included; pressed in the field, it selects the text. With the docked panel
207
+ closed, Mod+P opens it only until Enter opens the first match, Escape is pressed in the empty
208
+ field, or focus moves elsewhere; opening a row's menu or pressing Content keeps it open. That
209
+ Enter moves focus to the opened entry's first field. The quick-open dialog, the panel's
210
+ magnifier button and the rail's Open entry button are removed; the Content button's tooltip names
211
+ the shortcut. Each tree row's second line now shows the entry's route after its type, as in
212
+ "Landing page · /contact" (the type alone when the entry has no page), in full on hover or focus
213
+ when it is cut off.
214
+
215
+ ##### Added in 0.3.0
216
+
217
+ <!-- changeset: one-entry-search-focus-polish -->
218
+
219
+ **What changed.** The form pane, when it takes focus after Enter opens an entry with no fields, draws the
220
+ editor's focus ring inside its edges, above the form's sticky header. On keyboard focus, a tree
221
+ row's cut-off line shows in full after a short delay, below the row (above it when
222
+ there is no room), never over the row's title, and Escape hides it. The field's shortcut hint takes
223
+ the placeholder's colour, and its clear buttons read "Clear search".
224
+
225
+ #### The rail drops its Branches button and moves the layout toggle up — **behaviour change**
226
+
227
+ <!-- changeset: rail-polish -->
228
+
229
+ _First in 0.3.0._
230
+
231
+ **What changed.** The activity rail now runs Content, Comments and Media, then a divider, then the
232
+ layout toggle; Settings and Account stay at the bottom. Arrow keys move across the divider without
233
+ stopping on it. Content shows an unsaved dot while its panel is closed, and its name says how many
234
+ entries are unsaved ("Content, 3 unsaved"). The Branches button is gone: the branch pill's Switch
235
+ branch… opens the Branches drawer.
236
+
65
237
  ### 0.2.0
66
238
 
67
239
  #### Removing a file from the media library hides it, and an admin can restore it — **breaking (assets.delete, AssetStore) / behaviour change; template first**
@@ -272,7 +444,7 @@ URL.
272
444
  2. For a branch preview: wrap views with `withCanopyPreview` in a `'use client'` module, add
273
445
  `app/preview/[[...path]]/page.server.tsx`, set `editor.previewPrefix: '/preview'`, and serve that
274
446
  route with `frame-ancestors 'self'`, not `X-Frame-Options: DENY` (see
275
- [Live Preview](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/README.md#live-preview)).
447
+ [Live Preview](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#live-preview)).
276
448
  3. A test reading view content from the route's server HTML must load the page in a browser.
277
449
  Server output rendered during a preview request carries the signed-in asset prefix; keep it out
278
450
  of cross-request caches (`unstable_cache`, module memos).
@@ -287,7 +459,7 @@ kept site styles ahead of Mantine's in the preview.
287
459
  server components. A string path marks the form's spelling (`'a.0.b'` marks `a[0].b`), and an empty
288
460
  path marks nothing. The editor counts and logs marks naming no field. `createEntrySchemaRegistry`
289
461
  refuses a field name that is empty, all digits or contains `.`, `[` or `]`. See
290
- [Live Preview](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/README.md#live-preview).
462
+ [Live Preview](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#live-preview).
291
463
 
292
464
  **To adopt.** Fix each path that stops compiling; the error lists valid ones. Rewrite computed paths
293
465
  as literal segments, or type that component's prop as plain `FieldProps`. Pass `fieldProps` as
@@ -369,7 +541,7 @@ or a failed render) renders as its plain text, with no URL; any other form of th
369
541
  fields are nested or renamed, pass the AI config's `seo` the same object you pass
370
542
  `createNextCanopyContext({ seo })`, so the sitemap and AI content read the flag from the same
371
543
  place. A field that links to a hidden section by plain URL needs a field transform; the README
372
- shows [the recipe](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/README.md#ai-content-configuration).
544
+ shows [the recipe](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#ai-content-configuration).
373
545
 
374
546
  **Now deletable.** An `exclude.where` that re-read the `noindex` flag by hand.
375
547
 
@@ -391,7 +563,7 @@ A `markdown` field with `renderAs: 'mdx'` is checked as MDX, and `mdxAllow` narr
391
563
  field or site-wide. New: field options `renderAs`, `mdxAllow`; config key `mdxAllow`; type
392
564
  `MdxAllowlist`. (int.110) A component prop allowance can be `'string'` (or
393
565
  `{ type: 'string', maxLength }`): a quoted value only, never bare or `{…}`. See
394
- [MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/README.md#mdx-content-cannot-run-code).
566
+ [MDX content cannot run code](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#mdx-content-cannot-run-code).
395
567
 
396
568
  **To adopt.** Set `renderAs: 'mdx'` on each `markdown` field your site compiles as MDX, and
397
569
  `mdxAllow` to what your renderer takes. Set `executable: true` only on a field whose editors you
@@ -528,7 +700,7 @@ a format check.
528
700
 
529
701
  - (int.93) Submit commits gain an `Edited-by: Name (id)` trailer; PR bodies gain a section that
530
702
  re-submits replace, keeping human text. Options: `gitEditedByTrailers`, `gitCoAuthoredByTrailers`
531
- ([reference](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/README.md#definecanopyconfig-options)).
703
+ ([reference](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#definecanopyconfig-options)).
532
704
  - (int.110) Submit-commit trailers name every user who saved since the last submit commit, and
533
705
  the PR-body section every user who edited the branch, not only the submitter; settings commits
534
706
  (permissions, groups) carry the acting user's trailer.
@@ -552,7 +724,7 @@ saves only push the branch, and no failing PR task lands in System health.
552
724
  that entry type goes unavailable: the editor says so, and its entries answer 503 with
553
725
  `code: 'SCHEMA_UNAVAILABLE'`. Builds, static deploys and `generate-ai-content` still fail. The
554
726
  worker holds the base branch for up to 30 minutes while that lasts; see
555
- [New schemas wait for the editor deploy](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/docs/deploying-to-aws.md#new-schemas-wait-for-the-editor-deploy).
727
+ [New schemas wait for the editor deploy](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#new-schemas-wait-for-the-editor-deploy).
556
728
  Public types gain optional `unavailable` on `EntryTypeConfig` and `FlatSchemaItem`, optional
557
729
  `ApiResponse.code`, and a required `SchemaResolutionResult.issues`.
558
730
 
@@ -590,7 +762,7 @@ hang until the drain heartbeat lets termination continue. Its in-flight task is
590
762
  new stack needs no steps.
591
763
 
592
764
  **What changed.** (int.109) Detailed in
593
- [The worker instance](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/docs/deploying-to-aws.md#the-worker-instance): IMDSv2 with a hop limit of 1; the
765
+ [The worker instance](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#the-worker-instance): IMDSv2 with a hop limit of 1; the
594
766
  bundle is one file whose sha256 user data checks, readable as that one object; a file-system policy
595
767
  refusing clients without TLS or IAM, replacing the worker's
596
768
  `AmazonElasticFileSystemClientReadWriteAccess`; an encrypted gp3 root volume; a boot-time upgrade to
@@ -644,10 +816,10 @@ failure and exits non-zero on `selfStopped`, with a code outside `RestartPrevent
644
816
  with its hash, as `worker/dist/index.js` and `index.js.sha256`. The default, `'asset'`, is
645
817
  unchanged.
646
818
  - `CanopyCmsService` alarms when the worker logs no git sync for 30 minutes. See
647
- [Worker-down alarm](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/docs/deploying-to-aws.md#worker-down-alarm).
819
+ [Worker-down alarm](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#worker-down-alarm).
648
820
 
649
821
  **To adopt.** Optional. For parameter-only change sets, see
650
- [Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/docs/deploying-to-aws.md#rolling-the-worker-from-ci). For the alarm, pass
822
+ [Rolling the worker from CI](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#rolling-the-worker-from-ci). For the alarm, pass
651
823
  `alarmTopic`.
652
824
 
653
825
  **Now deletable.** A manual `cdk deploy` after each canopycms bump whose only purpose is moving the
@@ -658,7 +830,7 @@ worker, and a hand-built alarm on the worker log group.
658
830
  **What changed.** (int.112) The boot's `dnf upgrade` could be OOM-killed on every retry. A 1 GiB
659
831
  swap file now goes on first; an upgrade that still fails starts the worker unpatched and notifies
660
832
  `alarmTopic` if set; a retried step names itself when it gives up. See
661
- [The worker instance](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/docs/deploying-to-aws.md#the-worker-instance).
833
+ [The worker instance](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#the-worker-instance).
662
834
 
663
835
  **To adopt.** Deploy, which replaces the worker instance. The bundle needs none of this, so it is
664
836
  not Template first and the worker contract stays at 1.
@@ -724,7 +896,7 @@ and operations may reuse GitHub fetches under 30 seconds old.
724
896
 
725
897
  **To adopt.** Nothing. Seeding `remote.git` stages a copy of the repository beside the gateway's
726
898
  mirror, so the root volume needs room for two
727
- ([details](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/docs/deploying-to-aws.md#the-worker-instance)).
899
+ ([details](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#the-worker-instance)).
728
900
 
729
901
  #### The worker follows a rebased or deleted GitHub branch
730
902
 
@@ -746,7 +918,7 @@ changes the template too (the fallback bundle's key and hash), so only the contr
746
918
  bundle-only roll is safe.
747
919
 
748
920
  **To adopt.** Parameter mode: gate bundle-only rolls on the contract
749
- ([recipe](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/docs/deploying-to-aws.md#rolling-the-worker-from-ci)). The gate refuses a stack without the
921
+ ([recipe](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#rolling-the-worker-from-ci)). The gate refuses a stack without the
750
922
  `WorkerContract` output, so `cdk deploy` the template once, which adds it. A hand-installed unit
751
923
  copies its `Environment=CANOPYCMS_WORKER_CONTRACT=` line from `worker/canopy-worker.service`.
752
924
 
@@ -763,8 +935,8 @@ units from the bundle's contract: 2 gets the split, an older bundle the single u
763
935
  template, then roll the bundle; on an older template it stops with `template too old for this
764
936
  bundle`. Inspect EFS only through `sudo /opt/canopy-worker/canopy-inspect <command>`, never from a root shell. A hand install
765
937
  takes `worker/`'s three units and `gateway.env.example`
766
- ([steps](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/docs/deploying-to-aws.md#installing-the-units-by-hand)). After the first deploy, run the
767
- [checklist](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/docs/deploying-to-aws.md#first-deploy-checklist).
938
+ ([steps](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#installing-the-units-by-hand)). After the first deploy, run the
939
+ [checklist](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#first-deploy-checklist).
768
940
 
769
941
  #### `canopycms-cdk`: `CanopyCmsService.attachTo`, and editor response headers — **behaviour change if you frame the CMS**
770
942
 
@@ -775,7 +947,7 @@ response headers policy. `CanopyCmsDistribution` sends the same headers: `frame-
775
947
  `X-Frame-Options: SAMEORIGIN`, `nosniff`, HSTS and `X-Robots-Tag: noindex`. Unless your app sends
776
948
  its own framing headers, no other origin can frame the editor or any page the CMS domain serves. Every such page is
777
949
  marked `noindex`. The editor's default preview is same-origin and unaffected. See
778
- [Serving the editor from a distribution you already own](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/docs/deploying-to-aws.md#serving-the-editor-from-a-distribution-you-already-own).
950
+ [Serving the editor from a distribution you already own](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#serving-the-editor-from-a-distribution-you-already-own).
779
951
 
780
952
  **To adopt.** If you wired the Function URL into your own distribution by hand, delete those
781
953
  behaviors and call `attachTo`, passing your CMS build's `assetPrefix` as `editorAssetPrefix` and a
@@ -951,7 +1123,7 @@ one the exclusions leave out. A throw or any other return is logged and treated
951
1123
  **To adopt.** If your site's routes, sitemap or bylines decide that some entries have no page,
952
1124
  apply the same rule here, for example `referenceLink: (target, { body }) =>
953
1125
  !body?.trim() ? false : undefined` in `defineAIContentConfig` from `canopycms/ai`. See
954
- [AI Content Configuration](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/README.md#ai-content-configuration).
1126
+ [AI Content Configuration](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#ai-content-configuration).
955
1127
 
956
1128
  **Now deletable.** A `fieldTransforms` entry that re-renders a reference field only to drop or
957
1129
  change its link.
@@ -1026,7 +1198,7 @@ _First in int.115._
1026
1198
  entry the base branch also changed, the "updated on the base branch" notice and the branch's
1027
1199
  conflict count now stay until the branch merges, so a reviewer still sees which entries replaced a
1028
1200
  base change. They used to clear on the next sync, about five minutes later. README's new [Drafts
1029
- and Unpublishing](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/README.md#drafts-and-unpublishing) section covers long-lived branches and
1201
+ and Unpublishing](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#drafts-and-unpublishing) section covers long-lived branches and
1030
1202
  unpublishing.
1031
1203
 
1032
1204
  #### The editor calls the content drawer "All content"
@@ -1338,7 +1510,7 @@ editor carries an unsaved draft of a stamped entry onto its stamped version.
1338
1510
  The flag is refused off a top-level `datetime`, on `list: true`, and with `required: true`.
1339
1511
 
1340
1512
  **To adopt.** Add `stampOnPublish: true` to the date field your site sorts or labels by, such as
1341
- `{ name: 'publishedAt', type: 'datetime', stampOnPublish: true }`. See [Stamping a publication date](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/README.md#stamping-a-publication-date).
1513
+ `{ name: 'publishedAt', type: 'datetime', stampOnPublish: true }`. See [Stamping a publication date](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#stamping-a-publication-date).
1342
1514
 
1343
1515
  **Now deletable.** A build step or hook that writes a missing publication date into new entries.
1344
1516
 
@@ -1385,7 +1557,7 @@ preview/form divider is now keyboard-resizable within the same 15–85% the spli
1385
1557
  stored at, and `react-split-pane` is no longer a dependency.
1386
1558
  `EditorPanes`, `EditorPanesProps`, the `PaneLayout` type and the `SPLIT_PERCENT_*` and `DEFAULT_*_SPLIT_PERCENT` constants are
1387
1559
  no longer exported from `canopycms/client`. See
1388
- [Your root layout](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/README.md#editor-customization).
1560
+ [Your root layout](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#editor-customization).
1389
1561
 
1390
1562
  **To adopt.** Nothing, unless you import `EditorPanes` or those constants: render `CanopyEditor`
1391
1563
  instead, which lays out its own panes. Hiding your site chrome on the editor route is now
@@ -1496,7 +1668,7 @@ never ended. `canopycms-auth-clerk` skips it while the editor is mounted, and ex
1496
1668
  **To adopt.** Nothing for the editor, if your edit page uses `useClerkAuthConfig()` or
1497
1669
  `ClerkSignIn`. If your CMS build renders `<SignIn>`, `UserButton` or `OrganizationSwitcher` on your
1498
1670
  own pages, mount the hook as in
1499
- [Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/packages/canopycms-auth-clerk/README.md#clerk-components-on-your-own-pages).
1671
+ [Clerk components on your own pages](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/packages/canopycms-auth-clerk/README.md#clerk-components-on-your-own-pages).
1500
1672
  Your own Server Actions in the CMS build still 403 behind OAC.
1501
1673
 
1502
1674
  **Now deletable.** Any local patch of `window.__internal_onBeforeSetActive` (or 6.x's
@@ -1537,12 +1709,12 @@ fast naming the ARN, the field and the keys present, never a value.
1537
1709
  **To adopt.** Nothing, unless one of those secrets holds a JSON document: then set the matching
1538
1710
  prop. The scaffolded stack fills them from the repository _variables_
1539
1711
  `CANOPY_GITHUB_TOKEN_SECRET_JSON_FIELD` and `CLERK_SECRET_KEY_SECRET_JSON_FIELD`
1540
- ([why the prefix](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/docs/deploying-to-aws.md#repository-secrets-and-variables)); a stack scaffolded earlier
1712
+ ([why the prefix](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#repository-secrets-and-variables)); a stack scaffolded earlier
1541
1713
  adds the props to `infrastructure/bin/app.ts` and `infrastructure/lib/cms-stack.ts` and the two `env`
1542
1714
  lines to `.github/workflows/deploy-cms.yml`, or re-runs the generator and diffs. `cdk synth` refuses a `…JsonField` prop without its `…SecretArn`, and an ARN carrying the ECS `:KEY::` suffix
1543
1715
  (also in `secretsArns`). Don't use CDK's `secretValueFromJson`: it resolves the plaintext into the deployed
1544
1716
  resource's configuration, readable by anyone who can describe it. Only `CLERK_SECRET_KEY` goes through Secrets Manager; `CLERK_JWT_KEY` and the publishable
1545
- key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/docs/deploying-to-aws.md#security-model)).
1717
+ key are public material ([Security Model](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#security-model)).
1546
1718
 
1547
1719
  **Now deletable.** A wrapper that fetches the secret, parses it and re-exports one field into the
1548
1720
  worker's environment, such as a `jq` step in user data or a wrapper entrypoint around
@@ -1554,7 +1726,7 @@ worker's environment, such as a `jq` step in user data or a wrapper entrypoint a
1554
1726
  `githubToken` is not deprecated and stays the documented default; `canopycms` neither depends on
1555
1727
  nor imports `@octokit/auth-app`. Register one App per site, not one shared across repositories:
1556
1728
  anyone holding an App's key can mint a token for any of its installations
1557
- ([why](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/ARCHITECTURE.md#why-one-github-app-per-site-not-one-shared-across-an-organisation)).
1729
+ ([why](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/ARCHITECTURE.md#why-one-github-app-per-site-not-one-shared-across-an-organisation)).
1558
1730
 
1559
1731
  **To adopt with `canopycms-cdk`** (existing stacks need no edit). `CanopyCmsServiceProps` takes
1560
1732
  `githubAppId`, `githubAppInstallationId`, `githubAppPrivateKeySecretArn` and
@@ -1567,7 +1739,7 @@ anyone holding an App's key can mint a token for any of its installations
1567
1739
  `verify` checks an existing installation's permissions: run it, since an App missing a
1568
1740
  permission only shows up later, as `sync-failed`. `create` needs an interactive terminal and
1569
1741
  never edits an existing JSON secret (create one and point the JSON-field prop at it)
1570
- ([details](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/docs/deploying-to-aws.md#register-it-with-canopycms-init-github-app)).
1742
+ ([details](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#register-it-with-canopycms-init-github-app)).
1571
1743
  2. Set the three props and **remove `githubTokenSecretArn`** (with its JSON field). A partial set
1572
1744
  of the three is refused at synth, and so is an App alongside a token.
1573
1745
  3. In the generated workflow, store them as `CANOPY_GITHUB_APP_ID`,
@@ -1578,7 +1750,7 @@ anyone holding an App's key can mint a token for any of its installations
1578
1750
 
1579
1751
  The private key is ARN-only; passing the key itself is refused at synth. Its ARN joins the worker's
1580
1752
  IAM policy automatically, so you need not add it to `secretsArns`. See
1581
- [Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/docs/deploying-to-aws.md#authenticating-as-a-github-app).
1753
+ [Authenticating as a GitHub App](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#authenticating-as-a-github-app).
1582
1754
 
1583
1755
  ```bash
1584
1756
  canopycms init-github-app create -- \
@@ -1626,7 +1798,7 @@ downloads the `.pem` from the App's settings page.
1626
1798
 
1627
1799
  **What changed.** The worker re-reads a Secrets Manager secret (the GitHub token or the Clerk secret
1628
1800
  key) when the operation using it fails. Timings, costs and the store-before-revoke order are in
1629
- [Rotating a secret](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/docs/deploying-to-aws.md#rotating-a-secret).
1801
+ [Rotating a secret](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#rotating-a-secret).
1630
1802
 
1631
1803
  **To adopt.** Nothing for credentials from `*_SECRET_ARN`, which is every scaffolded deployment. A
1632
1804
  GitHub App private key is still read only at boot: store the new key, replace the instance, and
@@ -1680,12 +1852,12 @@ also check the bucket policy for its grant.
1680
1852
  5. `withCanopy()` adds sharp's libvips to Next's file tracing (not for a static export) and, on
1681
1853
  Next 16 and later, sets `turbopack: {}` when your config has neither `turbopack` nor your own
1682
1854
  `webpack` and it can read your Next version. A webpack build still fails its image transforms
1683
- ([Dual Build Support](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/docs/deploying-to-aws.md#dual-build-support)).
1855
+ ([Dual Build Support](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#dual-build-support)).
1684
1856
 
1685
1857
  **Breaking:** a stack setting `platform` on `fromImageAsset` without `architecture` gets an arm64
1686
1858
  function while `platform` still decides the image, so `Platform.LINUX_AMD64` builds an image the
1687
1859
  function cannot run. A stack setting neither moves to arm64 with a matching image, built under QEMU
1688
- on an x86 host ([Where the image is built](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/docs/deploying-to-aws.md#where-the-image-is-built)).
1860
+ on an x86 host ([Where the image is built](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#where-the-image-is-built)).
1689
1861
 
1690
1862
  **To adopt.**
1691
1863
 
@@ -1714,7 +1886,7 @@ reason; `platform` on `fromImageAsset`; and, with `withCanopy()`, a hand-written
1714
1886
 
1715
1887
  **What changed.** `media.uploadUrl` (s3 adapter; an absolute http(s) URL or a site-relative path)
1716
1888
  replaces the `url` that `beginUpload()` returns, leaving the presign's `fields` untouched, so
1717
- uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/README.md#media-configuration) for the
1889
+ uploads can be same-origin. See [Media Configuration](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#media-configuration) for the
1718
1890
  CloudFront behavior it expects.
1719
1891
 
1720
1892
  **To adopt.** Optional. Set it from an environment variable: a site-relative value works only where
@@ -1739,7 +1911,7 @@ needs `lazyPublicTransforms: true`) let you pass a deterministically named role,
1739
1911
  bucket's stack computes `arn:aws:iam::<account>:role/<name>` from literals instead of a
1740
1912
  `Fn::GetStackOutput` reference only the CDK CLI resolves. The constructs re-attach
1741
1913
  `AWSLambdaBasicExecutionRole` (and the VPC policy) that `lambda.Function` drops from a role you
1742
- pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/docs/deploying-to-aws.md#cross-account-asset-bucket).
1914
+ pass. See [Cross-account asset bucket](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#cross-account-asset-bucket).
1743
1915
 
1744
1916
  **To adopt.** Optional:
1745
1917
 
@@ -1849,7 +2021,7 @@ public JWKS PEM, used only to verify signatures.
1849
2021
  to variables (Settings → Secrets and variables → Actions → Variables); `bin/app.ts` refuses the
1850
2022
  deploy at synth while it is unset. Check that `bin/app.ts` passes `CLERK_SECRET_KEY` as
1851
2023
  `clerkSecretKeySecretArn` (read by the worker), never in the Lambda's `environment`, unless you keep
1852
- `clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/docs/deploying-to-aws.md#security-model)).
2024
+ `clerkMiddleware` ([Security Model](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/docs/deploying-to-aws.md#security-model)).
1853
2025
 
1854
2026
  #### `readByUrlPath` answers only where `listEntries` publishes — **breaking (routing)**
1855
2027
 
@@ -1948,7 +2120,7 @@ basePath: process.env.NEXT_PUBLIC_BASE_PATH,
1948
2120
  Then pass `baseUrl` to `assetUrl` only if Next serves `/assets` (local adapter, `next dev`, S3 with
1949
2121
  no distribution): `assetUrl(image, { width: 960, baseUrl: BASE_PATH })`. Assets on CloudFront via
1950
2122
  `AssetSupport` stay at the distribution root; pass no `baseUrl` (mount table under "Where `/assets`
1951
- is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/README.md#media-configuration)). Two traps:
2123
+ is mounted" in [Media Configuration](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#media-configuration)). Two traps:
1952
2124
 
1953
2125
  - Don't pass a deployment `basePath` to `contentStaticParams({ basePath })`; that option filters by
1954
2126
  a nested route prefix and emits zero params, building green.
@@ -2107,7 +2279,7 @@ Under `exactOptionalPropertyTypes: true`, omit keys instead of assigning `undefi
2107
2279
  `withTrailingSlash` and `isAbsoluteUrl` from `canopycms/server`; `defineSeoFieldGroup()` from
2108
2280
  `canopycms`; `generateContentSitemap` and `entryToMetadata` from `canopycms-next`, bound on
2109
2281
  `createNextCanopyContext`'s result. See
2110
- [Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/README.md#sitemap-and-seo-metadata). Every routable entry type is in
2282
+ [Sitemap and SEO Metadata](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#sitemap-and-seo-metadata). Every routable entry type is in
2111
2283
  the sitemap unless `exclude`d or `noindex`; one `noindex` predicate drives both robots metadata and
2112
2284
  sitemap exclusion. `trailingSlash` is never inferred. `lastModified` defaults to `updatedAt`, a
2113
2285
  filesystem mtime. An empty SEO field counts as unset. `siteUrl` must be absolute, colliding URLs are
@@ -2164,7 +2336,7 @@ underscore-prefixed files are skipped.
2164
2336
 
2165
2337
  **What changed.** New scaffolds write `defaultBranchAccess: 'deny'` and
2166
2338
  `defaultPathAccess: { read: 'allow' }`
2167
- ([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/README.md#public-read-on-server-deployments)).
2339
+ ([Public read on server deployments](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#public-read-on-server-deployments)).
2168
2340
 
2169
2341
  **To adopt.** An older scaffold's `defaultBranchAccess: 'allow'` is wider than recommended;
2170
2342
  consider `'deny'`. If you deleted `defaultPathAccess: { read: 'allow' }`, anonymous visitors get no content until you
@@ -2217,7 +2389,7 @@ re-checked an entry's type (a `switch` on `meta.entryType` can merge them into o
2217
2389
  **What changed.** `BlockComponentRegistry<Blocks>` (types only, from `canopycms`; `BlockValueOf<Blocks, 'hero'>`
2218
2390
  gives one template's value type) requires exactly
2219
2391
  one component per block template name when written as an object literal. See
2220
- [Block Component Registries](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/README.md#block-component-registries) and
2392
+ [Block Component Registries](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#block-component-registries) and
2221
2393
  `apps/example1/app/components/PostView.tsx`.
2222
2394
 
2223
2395
  ```ts
@@ -2239,7 +2411,7 @@ templates against the schema.
2239
2411
 
2240
2412
  **What changed.** Spreading a `const` field array into several schemas, and nesting
2241
2413
  `defineInlineFieldGroup()` inside a block template, are documented
2242
- ([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/README.md#reusable-field-fragments)); `defineFieldFragment()` is an
2414
+ ([Reusable Field Fragments](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#reusable-field-fragments)); `defineFieldFragment()` is an
2243
2415
  identity helper for them.
2244
2416
 
2245
2417
  ```ts
@@ -2258,7 +2430,7 @@ field by composing from the same `const` field object.
2258
2430
  A block template holding a `reference` field is a shared block; `read()`/`readByUrlPath()` resolve
2259
2431
  it, and listings do with
2260
2432
  [`resolveReferences`](#listings-resolve-references-and-a-resolved-reference-carries-urlpath-and-optionally-its-body-16--breaking-type-level)
2261
- (0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/README.md#shared--referenced-blocks).
2433
+ (0.0.64). See [Shared / Referenced Blocks](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#shared--referenced-blocks).
2262
2434
 
2263
2435
  **Now deletable.** A second `read()` in page code to unwrap a shared block's reference.
2264
2436
 
@@ -2280,7 +2452,7 @@ Not retro-documented, apart from these:
2280
2452
 
2281
2453
  #### The registry is keyed by entry-type name (0.0.42)
2282
2454
 
2283
- **What changed.** `createEntrySchemaRegistry` keys are the entry-type names that `.collection.json` files name in `entry.schema`, and `EntryTypesFromRegistry` derives the typed entry-type map from them. Schema-variable keys (`{ postSchema }`) still work but derive nothing; [README's registry convention](https://github.com/safeinsights/canopycms/blob/ecd004a19d226d3b93e175eb8a2bd2c5a4ef2463/README.md#convention-why-key-the-registry-by-entry-type-name) says when to keep them.
2455
+ **What changed.** `createEntrySchemaRegistry` keys are the entry-type names that `.collection.json` files name in `entry.schema`, and `EntryTypesFromRegistry` derives the typed entry-type map from them. Schema-variable keys (`{ postSchema }`) still work but derive nothing; [README's registry convention](https://github.com/safeinsights/canopycms/blob/2924058c932bb84bb07466ecaab6562d46c8825c/README.md#convention-why-key-the-registry-by-entry-type-name) says when to keep them.
2284
2456
 
2285
2457
  **To adopt.**
2286
2458
 
@@ -11,7 +11,7 @@ import type { UserProfile } from '../auth/types.js';
11
11
  * symmetric: the editor client now defaults every missing flag fail-closed
12
12
  * (`?? true`), so a NEW client talking to an OLD server that omits these
13
13
  * fields degrades to fully locked -- read-only, Submit hidden, and (see
14
- * EditorHeader's `branchDataUnavailable`) a "could not be loaded" banner --
14
+ * `branchLockState`'s `branchDataUnavailable`) a "could not be loaded" status --
15
15
  * rather than silently behaving as if nothing changed. That is by design:
16
16
  * wire compatibility here means "doesn't break", not "behaves the same".
17
17
  */
@@ -22,7 +22,7 @@ export interface BranchListItem extends BranchMetadata {
22
22
  * True when content writes are rejected -- base-branch read-only OR a status
23
23
  * lock (submitted/approved/archived). The editor renders its locked state off
24
24
  * this instead of re-deriving the status rule client-side; `readOnly` still
25
- * distinguishes WHICH lock applies, for banner copy.
25
+ * distinguishes WHICH lock applies, for the status copy.
26
26
  */
27
27
  writeBlocked?: boolean;
28
28
  /**
@@ -34,7 +34,7 @@ const updateBranchAccessBodySchema = z.object({
34
34
  allowedUsers: z.array(z.string()).optional(),
35
35
  allowedGroups: z.array(z.string()).optional(),
36
36
  });
37
- import { isPrivileged, isAdmin, isLockedOutOfBranch, loadPathPermissions, getBranchProtection, getBranchWriteProtection, } from '../authorization/index.js';
37
+ import { isPrivileged, isAdmin, loadPathPermissions, getBranchProtection, getBranchWriteProtection, } from '../authorization/index.js';
38
38
  import { operatingStrategy } from '../operating-mode/index.js';
39
39
  /**
40
40
  * Returns true if:
@@ -405,36 +405,9 @@ export const listBranchesHandler = async (ctx, req) => {
405
405
  // editor matches defaultBranch against registry names, so return the form
406
406
  // that can actually be found there.
407
407
  const defaultBranch = sanitizeBranchName(ctx.services.config.defaultActiveBranch ?? baseBranchOf(ctx.services.config));
408
- // Admins and Reviewers see all branches
409
- if (isPrivileged(req.user.groups)) {
410
- return branchListResponse(ctx, req, allBranches, defaultBranch);
411
- }
412
- // Regular users see the base branch and the branches they created or were given access to
413
- const visibleBranches = allBranches.filter((context) => {
414
- const branch = context.branch;
415
- // Ahead of every grant below, as in checkBranchAccessWithDefault.
416
- if (isLockedOutOfBranch(branch.access, req.user.groups)) {
417
- return false;
418
- }
419
- // The protected base branch is where every user lands by default; always
420
- // show it (read-only) so the editor can render its protected state.
421
- if (getBranchProtection(ctx.services.config, branch.name, branch.baseBranch).isProtected) {
422
- return true;
423
- }
424
- // User created the branch
425
- if (branch.createdBy === req.user.userId) {
426
- return true;
427
- }
428
- // User is in allowedUsers
429
- if (branch.access?.allowedUsers?.includes(req.user.userId)) {
430
- return true;
431
- }
432
- // User's group is in allowedGroups
433
- if (branch.access?.allowedGroups?.some((groupId) => req.user.groups?.includes(groupId))) {
434
- return true;
435
- }
436
- return false;
437
- });
408
+ // The access check is the rule: the list shows exactly the branches it grants, so the editor
409
+ // never lists a branch it cannot open, nor leaves out one it can.
410
+ const visibleBranches = allBranches.filter((context) => ctx.services.checkBranchAccess(context, req.user).allowed);
438
411
  return branchListResponse(ctx, req, visibleBranches, defaultBranch);
439
412
  };
440
413
  /**
@@ -25,10 +25,9 @@ export function checkBranchAccessWithDefault(context, user, defaultAccess = 'den
25
25
  const hasUserConstraint = !!access.allowedUsers?.length;
26
26
  const hasGroupConstraint = !!access.allowedGroups?.length;
27
27
  if (!hasUserConstraint && !hasGroupConstraint) {
28
- // The branch creator owns their own un-ACL'd branch, as listBranchesHandler,
29
- // canDeleteBranch and canModifyBranchAccess also grant: without it, under
30
- // 'deny' a creator could delete their branch and rewrite its ACL but not
31
- // read a file on it. Scoped to the no-ACL case on purpose -- an EXPLICIT
28
+ // The branch creator owns their own un-ACL'd branch, as canDeleteBranch and
29
+ // canModifyBranchAccess also grant: without it, under 'deny' a creator could
30
+ // delete their branch and rewrite its ACL but not read a file on it. Scoped to the no-ACL case on purpose -- an EXPLICIT
32
31
  // allowlist omitting the creator still denies them, which is how an admin
33
32
  // locks down a branch someone else created.
34
33
  if (context.branch.createdBy === user.userId) {