@happyvertical/smrt-content 0.43.6 → 0.43.7

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/README.md CHANGED
@@ -465,7 +465,7 @@ startup and seeds sample content (3 items) for immediate testing.
465
465
 
466
466
  | Component | Props | Description |
467
467
  |-----------|-------|-------------|
468
- | `ContentList` | `contents`, `onEdit`, `onDelete`, `onAdd`, `getViewHref` | Card/list catalog with search, filters, and view toggles |
468
+ | `ContentList` | `contents` or `query`, `jobs`, `onEdit`, `onDelete`, `onAdd`, `getViewHref` | Query-backed catalog with realtime freshness, background-job progress, retry, search, filters, and view toggles |
469
469
  | `ContentEditor` | `content`, `contentId`, `onSave`, `onCancel` | Full content editor with metadata, assets, references |
470
470
  | `GovernedContentEditor` | `content`, `contentId`, `onSave`, `onCancel` | Editor with integrated governance panel and review controls |
471
471
  | `ContentAgentChat` | `contentId`, `apiBasePath` | AI chat sidebar for content with thread management |
@@ -476,6 +476,10 @@ startup and seeds sample content (3 items) for immediate testing.
476
476
  | `ImageThumbnail` | `src`, `alt` | Thumbnail image display |
477
477
  | `Markdown` | `source` | Markdown renderer |
478
478
 
479
+ `ContentList` retry handlers must return a new job attempt with a distinct
480
+ `jobId`. The controller retains the failed attempt as immutable history so a
481
+ late event from it cannot overwrite the retry result.
482
+
479
483
  Applications that compose their own article editor can use
480
484
  `createContentEditorState`, `getContentEditorAssetImageSource`, and
481
485
  `resolveContentEditorImageSelection` to share the same form normalization,
@@ -7,6 +7,43 @@ adapter (`src/svelte/content-list-controller.ts`) over a `DataTableController`,
7
7
  and can source those rows either from a client array or from the bounded
8
8
  content query endpoint. This doc covers both modes end to end.
9
9
 
10
+ ## Realtime, freshness, and background workflows (#2455)
11
+
12
+ A server-backed list consumes the complete reactive seam exposed by
13
+ `remoteQuery(...)`: initial loading, stale-while-refreshing rows, error, retry,
14
+ last-updated time, and an optional query-shaped live subscription. ContentList
15
+ subscribes after its first request. The remote-query controller carries that
16
+ live intent across query changes, so search/filter/page changes rebind to the
17
+ new exact query rather than subscribing to the whole collection. Browser
18
+ `offline` keeps usable rows on screen and announces their freshness; `online`
19
+ calls the live handle's `reconnect()` (which refreshes the exact request before
20
+ resubscribing), or falls back to `refresh()` when the transport has no live
21
+ handle. A refresh failure over existing rows is an inline error and never
22
+ replaces them with an empty/error-only screen.
23
+
24
+ Long-running actions share a framework-free
25
+ `createContentListJobController()`. Give that controller to action controls and
26
+ pass it to ContentList as `jobs`. Its `submit({ actionId, submissionKey,
27
+ target }, start)` method coalesces duplicate active submission keys before
28
+ calling `start`, publishes the accepted job id/progress, and leaves a rejected
29
+ submission failed until an explicit retry. Server progress enters through
30
+ `update(job)`; terminal state cannot be reverted by an out-of-order progress
31
+ event. Row-targeted pending work disables that row's selection/edit/delete
32
+ controls.
33
+
34
+ Job targets are deliberately precise:
35
+
36
+ - `{ kind: 'rows', rowIds }` refreshes only when at least one affected row is
37
+ visible;
38
+ - `{ kind: 'query', queryKey }` refreshes only when the key equals
39
+ `contentListQueryRequestKey(activeRequest)`.
40
+
41
+ Only a transition to `succeeded` triggers that refresh. Failed jobs remain
42
+ visible with their error and retry affordance, so error recovery cannot report
43
+ success or refresh as though the action applied. The tracker is exported from
44
+ `@happyvertical/smrt-content/svelte` for the bulk-action slice to reuse rather
45
+ than creating a second pending-state machine.
46
+
10
47
  ## ContentList migration (#2451)
11
48
 
12
49
  `ContentList` no longer holds bespoke local state. `src/svelte/content-list-controller.ts`