@dloizides/ui-feedback 1.15.2 → 1.16.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.
package/CHANGELOG.md CHANGED
@@ -1,215 +1,235 @@
1
- # Changelog
2
-
3
- ## 1.15.2
4
-
5
- - **ErrorState buttons take the kit hit-target floor from `@dloizides/a11y`** (`MIN_TOUCH_TARGET_PX`,
6
- 48px) instead of a local 44px constant, matching `ui-buttons`. `@dloizides/a11y` is now a dependency
7
- (JOBS-LIVE-1 "Live job updates").
8
-
9
- ## 1.15.1
10
-
11
- - **ErrorState retry and secondary buttons now have a 44px minimum height** (`MIN_TOUCH_TARGET`),
12
- content centred. Padding alone rendered them 34px tall, below the mobile-first hit-box standard
13
- (JOBS-LIVE-1 "Live job updates").
14
-
15
- ## 1.15.0
16
-
17
- - **New `ProgressBar`** (promoted from aml-v2 `JobProgressBar`, RUPEP-5 "Upload a RuPEP file from the
18
- Jobs tab"): determinate fill clamped to 0-100 (`clampPercent`, also exported) with an optional
19
- right-aligned caption, or an indeterminate scanning bar. `role="progressbar"` with
20
- `aria-valuemin/max/now/text` (`aria-valuenow` omitted and `aria-busy` set when indeterminate).
21
- Colours default to the UiProvider theme (`palette.primary.500`, `colors.border`,
22
- `colors.textSecondary`) and accept overrides. Default testID `progress-bar`, fill `<testID>-fill`.
23
-
24
- ## 1.14.0
25
-
26
- - **`ToastHost` portals to `document.body` on web (`position: fixed`, `Z_INDEX.toast`).** In-tree,
27
- the layer sat inside RN-web Views that each carry `position: relative; z-index: 0`, so its 10100
28
- was trapped and an open `ConfirmDialog` / RN `Modal` (9999, body-level) painted over the toast
29
- (measured on ui.dloizides.com/feedback: `elementFromPoint` at the toast centre returned the
30
- dialog). Same mechanism as `ui-forms` `menuPortal` and `ui-tables` `SizeDropdown`. Native is
31
- unchanged (in-tree). `react-dom` is now an optional peer dependency.
32
-
33
- ## 1.13.0
34
-
35
- Overlay stacking now comes from the shared `@dloizides/design-tokens` `Z_INDEX` scale
36
- (added as a dependency, `^1.13.0`) instead of local literals.
37
-
38
- - **`ToastHost` layer: 9999 -> `Z_INDEX.toast` (10100).** A toast now paints above an open
39
- portalled menu (`Z_INDEX.popover`, 10000) and above an RN-web `Modal` (9999). At 9999 an open
40
- dropdown covered the toast. Pinned by a `ToastHost.test.tsx` case that reads the computed
41
- `z-index` of the toast layer.
42
- - **`WarmingOverlay`: literal 100000 -> `Z_INDEX.blocking`.** Same value, so nothing changes visually.
43
-
44
- ## 1.12.0
45
-
46
- Opt-in additions to `ErrorState` for full-screen error surfaces (an import-error or
47
- load-error screen that needs a heading, an icon and a way out other than retry). Every
48
- prop is optional: a caller passing none of them renders the same element tree as 1.11.0,
49
- pinned by `ErrorState.test.tsx` baseline snapshots recorded before the change.
50
-
51
- - **Add `title?: string`** — rendered above the message with `accessibilityRole="header"`
52
- (`role="heading"` on web), testID `${testID}-title`. When a title is present the message
53
- uses `theme.colors.textSecondary` instead of the error colour.
54
- - **Add `icon?: React.ReactNode`** — rendered inside a circular well tinted with
55
- `theme.semantic.error['500']` at low opacity; the well is `aria-hidden`, testID `${testID}-icon`.
56
- - **Add `secondaryAction?: ErrorStateAction`** (`{ label, hint, onPress, testID }`) — an
57
- outline button (`theme.colors.border`) laid out in a row beside retry.
58
- - **Export type `ErrorStateAction`.** No new colour literals; no new dependencies.
59
-
60
- ## 1.11.0
61
-
62
- Adopts `@dloizides/ui-motion` for `PageSkeleton`: the loader now shows a moving
63
- **shimmer** (a highlight band sweeping across each block) instead of an opacity pulse,
64
- so loading states read as modern/ant-design-like. There is now ONE shimmer
65
- implementation in the kit — the ui-motion `<Skeleton>` primitive — and `PageSkeleton`
66
- owns only the page LAYOUT (how many bars/blocks, their sizes and spacing).
67
-
68
- - **Add runtime dependency `@dloizides/ui-motion` (`^1.0.1`).**
69
- - **`PageSkeleton` internals reimplemented on ui-motion `<Skeleton>`.** Each placeholder
70
- block (header bar, list-row avatar + text lines, card) is now a `<Skeleton>` with the
71
- same `width`/`height`/`borderRadius`/base colour it had before. The bespoke
72
- `Animated.loop` opacity pulse (and its `Animated`/`Easing`/`Platform` imports) is gone.
73
- - **Reduced-motion is now handled by `<Skeleton>`** (via `@dloizides/rn-web-hooks`
74
- `useReducedMotion`): the sweep is suppressed and a static block is shown.
75
- - **Public API unchanged.** `PageSkeletonProps` (`rows`, `showHeader`, `variant`), the
76
- rendered layout, and the `page-skeleton` testID are identical to 1.9.0. Only the
77
- internal animated primitive was swapped.
78
- - `ToastHost` (fade+slide) is intentionally left as-is — it remains the reference
79
- enter/exit pattern.
80
-
81
- ## 1.7.0
82
-
83
- Closes the API gap that kept `kefi-web`, `erevna-web` and `katalogos-web` on their
84
- local `ErrorBoundary` copies. Those three vary the boundary **by error class** — a
85
- stale-chunk failure after a deploy needs different wording, no retry button, and no
86
- stack dump — which 1.6.0's static `labels` / boolean `showDetails` could not express.
87
- Every addition is opt-in; the pre-1.7.0 test suite passes unmodified.
88
-
89
- **The kit still does not know what a "chunk" is.** Apps inject the classification;
90
- the boundary only learns *whether retry is meaningful* and *what to say*.
91
-
92
- - **Add `retryable?: (error) => boolean`.** When it returns `false` the retry action is
93
- not rendered at all. Offering a button that re-renders straight back into the same
94
- missing chunk is worse than offering nothing. Default: every error is retryable
95
- (1.6.0 behaviour).
96
- - **Add `labelsFor?: (error) => Partial<ErrorBoundaryLabels>`,** merged OVER the static
97
- `labels`. Lets an app say "Update available" for a stale chunk without the kit knowing
98
- why — it sees only the resulting strings.
99
- - **Widen `showDetails` to `boolean | ((error) => boolean)`.** A predicate can suppress
100
- the dev-only block per error class (a hashed filename is noise, not signal). **A plain
101
- boolean behaves exactly as before.**
102
- - **Add `onMount?: () => void`,** called from `componentDidMount` ONLY when the mount was
103
- clean. The three apps release their one-shot reload guard here: a clean mount proves the
104
- current chunks loaded, so a FUTURE deploy may auto-recover again. Deliberately not called
105
- on an errored mount — that would re-arm the guard during the very failure it bounds.
106
- - **Add `reloadIsPrimary?: boolean`** (default `false`). Gives Reload the filled emphasis
107
- and the first position instead of Try Again.
108
-
109
- **Why a flag rather than an unconditional swap:** `agora-web` and `zygos-web` both pass
110
- `onReload`, so simply inverting the priority would have silently restyled and reordered
111
- their error screens too. They have no chunk-recovery path, so retry is still the right
112
- primary there. The default preserves their rendering exactly; the three chunk-aware apps
113
- opt in.
114
-
115
- **Notably, `DEFAULT_ERROR_BOUNDARY_LABELS` gains no `updateTitle`/`updateMessage`.** Those
116
- are domain vocabulary — "an update is available" is a fact about the app's deploy model, not
117
- about error boundaries. `labelsFor` supplies them as ordinary `title`/`message` overrides,
118
- which keeps the kit's label bag domain-free.
119
-
120
- ### Fixed
121
-
122
- - **`AppErrorBoundary.test.tsx` had never actually run.** `jest.setup.ts` imports
123
- `@testing-library/jest-dom`, which registers matchers at runtime, but `tsconfig.test.json`
124
- listed no `types`, so ts-jest failed every `toBeInTheDocument()` with TS2339 and aborted the
125
- whole suite at compile time. It was the only suite using those matchers, so `npm test`
126
- reported a red SUITE while the other five stayed green and the true test count read 34.
127
- Adding `"types": ["jest", "node", "@testing-library/jest-dom"]` brings its 14 assertions
128
- online for the first time — unmodified, and passing against the 1.7.0 source.
129
-
130
- ## 1.6.0
131
-
132
- Two fleet-wide duplicates extracted (W1.2 + W1.3). Both are purely additive — every
133
- existing export is unchanged.
134
-
135
- - **Add `createToastBus()` — the shared toast EMIT half (W1.2).** Promoted from the three
136
- hand-rolled ~25-line twins in `aml-v2` (`components/toast.ts` — `emitToast`/`subscribeToasts`),
137
- `agora-web` and `zygos-web` (`lib/toastBus.ts` — `toastSuccess`/`toastError`). The returned
138
- bus is a superset: `subscribe` (the `<ToastHost>` port), `emit(text, type?)`, and the
139
- `success`/`error`/`info` shorthands.
140
-
141
- **Deliberately framework-agnostic — no React import, no hook, no provider.** Call sites are
142
- React Query mutation `onSuccess`/`onError` callbacks with no component context in scope, so a
143
- hook-based API would break every one of them. It carries no styling: `<ToastHost>` themes each
144
- toast from `UiProvider`. Text passed in is already localized by the caller.
145
-
146
- New exports: `createToastBus`, `ToastBus`, `ToastPush`.
147
-
148
- - **Add `<AppErrorBoundary>` — the shared top-level error boundary (W1.3).** Promoted from the
149
- SIX app-local copies (`agora-web` + `zygos-web` byte-identical, `kefi-web`, `erevna-web`,
150
- `katalogos-web`, `ichnos-web`); `aml-v2` had none at all. The axes that actually varied are now
151
- injected rather than baked in: `onError` (Sentry/logger), `recover` (the apps' chunk-load
152
- retry), `showDetails` (dev-only error text), `labels` (pre-localized bag), `testIDPrefix`,
153
- and `fallback` (escape hatch). An optional `onReload` renders the manual **Reload** action
154
- that kefi/erevna/katalogos shipped alongside **Try Again**.
155
-
156
- Two behaviour fixes come with the extraction:
157
- - **Themed.** The fallback renders through the shared `<ErrorState>`, so it reads
158
- `UiProvider` colours — this removes the 40+ hardcoded Bootstrap-4 hex literals
159
- (`#f8f9fa`, `#212529`, `#6c757d`, `#fff3cd`, `#856404`, `#007bff`, …) three copies carried.
160
- - **Announced.** The fallback ships `role="alert"` + `accessibilityLiveRegion="assertive"`;
161
- none of the six announced anything to a screen reader, and agora/zygos rendered only the
162
- app *name* with no message and no retry.
163
-
164
- New exports: `AppErrorBoundary`, `AppErrorBoundaryProps`, `ErrorFallbackState`,
165
- `ErrorBoundaryLabels`, `DEFAULT_ERROR_BOUNDARY_LABELS`, plus the `errorBoundary` id in
166
- `FEEDBACK_TEST_IDS` (default prefix `error-boundary`, preserving the existing
167
- `error-boundary-retry-button` / `-reload-button` / `-updating` Playwright selectors).
168
-
169
- ## 1.5.0
170
-
171
- - **Accessibility (WCAG 2.1 AA) — `ToastHost` announcements.** Each toast is now a live region so
172
- a screen reader announces it (WCAG 4.1.3): success/info toasts render as `role="status"` with
173
- `aria-live="polite"`, error toasts escalate to `role="alert"` with `aria-live="assertive"`
174
- (`accessibilityLiveRegion` set for native parity). Rendering, timing and testIDs are unchanged —
175
- additive + backward-compatible.
176
-
177
- ## 1.3.0
178
-
179
- - Add `ToastHost` — the shared, tokenized transient-toast overlay promoted from the
180
- byte-identical erevna-web / katalogos-web `ToastContainer` twins. Rendering (animated
181
- fade, positioning, theming) lives here; the emit pipeline stays in the app and is wired
182
- in via the `subscribe` port (`(push) => unsubscribe`). Colours come from the UiProvider
183
- theme. New exports: `ToastHost`, `ToastHostProps`, `ToastInput`, `ToastType`, plus the
184
- `notificationToast` id in `FEEDBACK_TEST_IDS` (default toast testID `notification-toast`,
185
- preserving existing Playwright selectors).
186
-
187
- ## 1.2.0
188
-
189
- - Broaden the injected theme so the settings-hub kit can consume it: colour scales are now
190
- addressable at any step (`[step]`), and `palette`/`semantic` accept named scales beyond
191
- `primary`/`error` (e.g. `secondary`, `accent`, `success`, `warning`, `info`) via index signatures.
192
- Purely additive — existing `{primary}`/`{error}` themes still satisfy the types. Default value now
193
- includes the common extra scales so no-provider rendering never reads `undefined`.
194
-
195
- ## 1.1.0
196
-
197
- - Add `colors.surface` to the injected theme (needed by the ui-forms kit; apps already pass it).
198
- - Export neutral aliases `UiProvider` / `useUi` (+ `Ui*` types) for the feedback-specific
199
- `FeedbackUiProvider` / `useFeedbackUi`. ui-feedback is now the shared UI context for the kit;
200
- sibling packages (ui-forms, ui-tables, …) consume `useUi` instead of duplicating the provider.
201
-
202
- ## 1.0.2
203
-
204
- - `useFeedbackUi` now falls back to a neutral default theme + identity translate when no
205
- `FeedbackUiProvider` is mounted (graceful degradation), instead of throwing. Apps still
206
- mount a provider for the real theme/i18n; isolated tests render without one.
207
-
208
- ## 1.0.0
209
-
210
- Initial release. Extracted the proven duplicated feedback components from erevna-web ↔
211
- katalogos-web (Capability Wave C1, batch 1).
212
-
213
- - `FeedbackUiProvider` + `useFeedbackUi` — injectable theme/translate/navigate context.
214
- - `ErrorState`, `EmptyListState`, `LoadingFallback`, `PageSkeleton`, `ConfirmDialog`.
215
- - `FEEDBACK_TEST_IDS`, `MODAL_OVERLAY_COLOR`, `DISABLED_OPACITY` constants.
1
+ # Changelog
2
+
3
+ ## 1.16.1
4
+
5
+ - **LiveRunCard step names wrap to two lines instead of truncating** ("Phase A2: resolving offi..."). At wide
6
+ layouts the name column takes a 35% share with a 220px floor; the time no longer wraps onto its own line.
7
+ - **Compact step rows stack**: the name with its time right-aligned on the same line, then a full-width bar.
8
+ - **Compact summary chips hide while step timings are open**, so the done/open chips no longer show twice.
9
+
10
+ ## 1.16.0
11
+
12
+ - **New `LiveRunCard`** (JOBS-LAYOUT-1 "Live run card above the table", owner decision D-JOBS-LAYOUT-1): a
13
+ presentational card for one active run - status pill, title, started/elapsed line, current step,
14
+ `ProgressBar` with an app-supplied caption, one chip per step group (done / running / pending / failed),
15
+ and step-time bars scaled to the longest step with the shorter ones behind "+N shorter steps". Below
16
+ `LIVE_RUN_CARD_COMPACT_MAX_PX` (640) it renders compact: finished groups fold into one chip and step
17
+ timings sit behind a toggle. Optional Cancel. Every button and tappable chip is 48px
18
+ (`MIN_TOUCH_TARGET_PX`); colours come from the UiProvider theme; all text comes from the `labels` prop.
19
+ - **Pure helpers** `mergeRunSteps` (flat steps to groups in first-seen order, 0s done rows dropped, group
20
+ time summed, worst state wins), `splitShorterSteps`, `defaultGroupId`, `summariseDoneGroups`,
21
+ `barFraction`, `progressPercent`, `runToneColor`.
22
+
23
+ ## 1.15.2
24
+
25
+ - **ErrorState buttons take the kit hit-target floor from `@dloizides/a11y`** (`MIN_TOUCH_TARGET_PX`,
26
+ 48px) instead of a local 44px constant, matching `ui-buttons`. `@dloizides/a11y` is now a dependency
27
+ (JOBS-LIVE-1 "Live job updates").
28
+
29
+ ## 1.15.1
30
+
31
+ - **ErrorState retry and secondary buttons now have a 44px minimum height** (`MIN_TOUCH_TARGET`),
32
+ content centred. Padding alone rendered them 34px tall, below the mobile-first hit-box standard
33
+ (JOBS-LIVE-1 "Live job updates").
34
+
35
+ ## 1.15.0
36
+
37
+ - **New `ProgressBar`** (promoted from aml-v2 `JobProgressBar`, RUPEP-5 "Upload a RuPEP file from the
38
+ Jobs tab"): determinate fill clamped to 0-100 (`clampPercent`, also exported) with an optional
39
+ right-aligned caption, or an indeterminate scanning bar. `role="progressbar"` with
40
+ `aria-valuemin/max/now/text` (`aria-valuenow` omitted and `aria-busy` set when indeterminate).
41
+ Colours default to the UiProvider theme (`palette.primary.500`, `colors.border`,
42
+ `colors.textSecondary`) and accept overrides. Default testID `progress-bar`, fill `<testID>-fill`.
43
+
44
+ ## 1.14.0
45
+
46
+ - **`ToastHost` portals to `document.body` on web (`position: fixed`, `Z_INDEX.toast`).** In-tree,
47
+ the layer sat inside RN-web Views that each carry `position: relative; z-index: 0`, so its 10100
48
+ was trapped and an open `ConfirmDialog` / RN `Modal` (9999, body-level) painted over the toast
49
+ (measured on ui.dloizides.com/feedback: `elementFromPoint` at the toast centre returned the
50
+ dialog). Same mechanism as `ui-forms` `menuPortal` and `ui-tables` `SizeDropdown`. Native is
51
+ unchanged (in-tree). `react-dom` is now an optional peer dependency.
52
+
53
+ ## 1.13.0
54
+
55
+ Overlay stacking now comes from the shared `@dloizides/design-tokens` `Z_INDEX` scale
56
+ (added as a dependency, `^1.13.0`) instead of local literals.
57
+
58
+ - **`ToastHost` layer: 9999 -> `Z_INDEX.toast` (10100).** A toast now paints above an open
59
+ portalled menu (`Z_INDEX.popover`, 10000) and above an RN-web `Modal` (9999). At 9999 an open
60
+ dropdown covered the toast. Pinned by a `ToastHost.test.tsx` case that reads the computed
61
+ `z-index` of the toast layer.
62
+ - **`WarmingOverlay`: literal 100000 -> `Z_INDEX.blocking`.** Same value, so nothing changes visually.
63
+
64
+ ## 1.12.0
65
+
66
+ Opt-in additions to `ErrorState` for full-screen error surfaces (an import-error or
67
+ load-error screen that needs a heading, an icon and a way out other than retry). Every
68
+ prop is optional: a caller passing none of them renders the same element tree as 1.11.0,
69
+ pinned by `ErrorState.test.tsx` baseline snapshots recorded before the change.
70
+
71
+ - **Add `title?: string`** — rendered above the message with `accessibilityRole="header"`
72
+ (`role="heading"` on web), testID `${testID}-title`. When a title is present the message
73
+ uses `theme.colors.textSecondary` instead of the error colour.
74
+ - **Add `icon?: React.ReactNode`** — rendered inside a circular well tinted with
75
+ `theme.semantic.error['500']` at low opacity; the well is `aria-hidden`, testID `${testID}-icon`.
76
+ - **Add `secondaryAction?: ErrorStateAction`** (`{ label, hint, onPress, testID }`) — an
77
+ outline button (`theme.colors.border`) laid out in a row beside retry.
78
+ - **Export type `ErrorStateAction`.** No new colour literals; no new dependencies.
79
+
80
+ ## 1.11.0
81
+
82
+ Adopts `@dloizides/ui-motion` for `PageSkeleton`: the loader now shows a moving
83
+ **shimmer** (a highlight band sweeping across each block) instead of an opacity pulse,
84
+ so loading states read as modern/ant-design-like. There is now ONE shimmer
85
+ implementation in the kit — the ui-motion `<Skeleton>` primitive — and `PageSkeleton`
86
+ owns only the page LAYOUT (how many bars/blocks, their sizes and spacing).
87
+
88
+ - **Add runtime dependency `@dloizides/ui-motion` (`^1.0.1`).**
89
+ - **`PageSkeleton` internals reimplemented on ui-motion `<Skeleton>`.** Each placeholder
90
+ block (header bar, list-row avatar + text lines, card) is now a `<Skeleton>` with the
91
+ same `width`/`height`/`borderRadius`/base colour it had before. The bespoke
92
+ `Animated.loop` opacity pulse (and its `Animated`/`Easing`/`Platform` imports) is gone.
93
+ - **Reduced-motion is now handled by `<Skeleton>`** (via `@dloizides/rn-web-hooks`
94
+ `useReducedMotion`): the sweep is suppressed and a static block is shown.
95
+ - **Public API unchanged.** `PageSkeletonProps` (`rows`, `showHeader`, `variant`), the
96
+ rendered layout, and the `page-skeleton` testID are identical to 1.9.0. Only the
97
+ internal animated primitive was swapped.
98
+ - `ToastHost` (fade+slide) is intentionally left as-is — it remains the reference
99
+ enter/exit pattern.
100
+
101
+ ## 1.7.0
102
+
103
+ Closes the API gap that kept `kefi-web`, `erevna-web` and `katalogos-web` on their
104
+ local `ErrorBoundary` copies. Those three vary the boundary **by error class** — a
105
+ stale-chunk failure after a deploy needs different wording, no retry button, and no
106
+ stack dump — which 1.6.0's static `labels` / boolean `showDetails` could not express.
107
+ Every addition is opt-in; the pre-1.7.0 test suite passes unmodified.
108
+
109
+ **The kit still does not know what a "chunk" is.** Apps inject the classification;
110
+ the boundary only learns *whether retry is meaningful* and *what to say*.
111
+
112
+ - **Add `retryable?: (error) => boolean`.** When it returns `false` the retry action is
113
+ not rendered at all. Offering a button that re-renders straight back into the same
114
+ missing chunk is worse than offering nothing. Default: every error is retryable
115
+ (1.6.0 behaviour).
116
+ - **Add `labelsFor?: (error) => Partial<ErrorBoundaryLabels>`,** merged OVER the static
117
+ `labels`. Lets an app say "Update available" for a stale chunk without the kit knowing
118
+ why — it sees only the resulting strings.
119
+ - **Widen `showDetails` to `boolean | ((error) => boolean)`.** A predicate can suppress
120
+ the dev-only block per error class (a hashed filename is noise, not signal). **A plain
121
+ boolean behaves exactly as before.**
122
+ - **Add `onMount?: () => void`,** called from `componentDidMount` ONLY when the mount was
123
+ clean. The three apps release their one-shot reload guard here: a clean mount proves the
124
+ current chunks loaded, so a FUTURE deploy may auto-recover again. Deliberately not called
125
+ on an errored mount — that would re-arm the guard during the very failure it bounds.
126
+ - **Add `reloadIsPrimary?: boolean`** (default `false`). Gives Reload the filled emphasis
127
+ and the first position instead of Try Again.
128
+
129
+ **Why a flag rather than an unconditional swap:** `agora-web` and `zygos-web` both pass
130
+ `onReload`, so simply inverting the priority would have silently restyled and reordered
131
+ their error screens too. They have no chunk-recovery path, so retry is still the right
132
+ primary there. The default preserves their rendering exactly; the three chunk-aware apps
133
+ opt in.
134
+
135
+ **Notably, `DEFAULT_ERROR_BOUNDARY_LABELS` gains no `updateTitle`/`updateMessage`.** Those
136
+ are domain vocabulary — "an update is available" is a fact about the app's deploy model, not
137
+ about error boundaries. `labelsFor` supplies them as ordinary `title`/`message` overrides,
138
+ which keeps the kit's label bag domain-free.
139
+
140
+ ### Fixed
141
+
142
+ - **`AppErrorBoundary.test.tsx` had never actually run.** `jest.setup.ts` imports
143
+ `@testing-library/jest-dom`, which registers matchers at runtime, but `tsconfig.test.json`
144
+ listed no `types`, so ts-jest failed every `toBeInTheDocument()` with TS2339 and aborted the
145
+ whole suite at compile time. It was the only suite using those matchers, so `npm test`
146
+ reported a red SUITE while the other five stayed green and the true test count read 34.
147
+ Adding `"types": ["jest", "node", "@testing-library/jest-dom"]` brings its 14 assertions
148
+ online for the first time — unmodified, and passing against the 1.7.0 source.
149
+
150
+ ## 1.6.0
151
+
152
+ Two fleet-wide duplicates extracted (W1.2 + W1.3). Both are purely additive — every
153
+ existing export is unchanged.
154
+
155
+ - **Add `createToastBus()` — the shared toast EMIT half (W1.2).** Promoted from the three
156
+ hand-rolled ~25-line twins in `aml-v2` (`components/toast.ts` — `emitToast`/`subscribeToasts`),
157
+ `agora-web` and `zygos-web` (`lib/toastBus.ts` — `toastSuccess`/`toastError`). The returned
158
+ bus is a superset: `subscribe` (the `<ToastHost>` port), `emit(text, type?)`, and the
159
+ `success`/`error`/`info` shorthands.
160
+
161
+ **Deliberately framework-agnostic — no React import, no hook, no provider.** Call sites are
162
+ React Query mutation `onSuccess`/`onError` callbacks with no component context in scope, so a
163
+ hook-based API would break every one of them. It carries no styling: `<ToastHost>` themes each
164
+ toast from `UiProvider`. Text passed in is already localized by the caller.
165
+
166
+ New exports: `createToastBus`, `ToastBus`, `ToastPush`.
167
+
168
+ - **Add `<AppErrorBoundary>` — the shared top-level error boundary (W1.3).** Promoted from the
169
+ SIX app-local copies (`agora-web` + `zygos-web` byte-identical, `kefi-web`, `erevna-web`,
170
+ `katalogos-web`, `ichnos-web`); `aml-v2` had none at all. The axes that actually varied are now
171
+ injected rather than baked in: `onError` (Sentry/logger), `recover` (the apps' chunk-load
172
+ retry), `showDetails` (dev-only error text), `labels` (pre-localized bag), `testIDPrefix`,
173
+ and `fallback` (escape hatch). An optional `onReload` renders the manual **Reload** action
174
+ that kefi/erevna/katalogos shipped alongside **Try Again**.
175
+
176
+ Two behaviour fixes come with the extraction:
177
+ - **Themed.** The fallback renders through the shared `<ErrorState>`, so it reads
178
+ `UiProvider` colours — this removes the 40+ hardcoded Bootstrap-4 hex literals
179
+ (`#f8f9fa`, `#212529`, `#6c757d`, `#fff3cd`, `#856404`, `#007bff`, …) three copies carried.
180
+ - **Announced.** The fallback ships `role="alert"` + `accessibilityLiveRegion="assertive"`;
181
+ none of the six announced anything to a screen reader, and agora/zygos rendered only the
182
+ app *name* with no message and no retry.
183
+
184
+ New exports: `AppErrorBoundary`, `AppErrorBoundaryProps`, `ErrorFallbackState`,
185
+ `ErrorBoundaryLabels`, `DEFAULT_ERROR_BOUNDARY_LABELS`, plus the `errorBoundary` id in
186
+ `FEEDBACK_TEST_IDS` (default prefix `error-boundary`, preserving the existing
187
+ `error-boundary-retry-button` / `-reload-button` / `-updating` Playwright selectors).
188
+
189
+ ## 1.5.0
190
+
191
+ - **Accessibility (WCAG 2.1 AA) — `ToastHost` announcements.** Each toast is now a live region so
192
+ a screen reader announces it (WCAG 4.1.3): success/info toasts render as `role="status"` with
193
+ `aria-live="polite"`, error toasts escalate to `role="alert"` with `aria-live="assertive"`
194
+ (`accessibilityLiveRegion` set for native parity). Rendering, timing and testIDs are unchanged —
195
+ additive + backward-compatible.
196
+
197
+ ## 1.3.0
198
+
199
+ - Add `ToastHost` — the shared, tokenized transient-toast overlay promoted from the
200
+ byte-identical erevna-web / katalogos-web `ToastContainer` twins. Rendering (animated
201
+ fade, positioning, theming) lives here; the emit pipeline stays in the app and is wired
202
+ in via the `subscribe` port (`(push) => unsubscribe`). Colours come from the UiProvider
203
+ theme. New exports: `ToastHost`, `ToastHostProps`, `ToastInput`, `ToastType`, plus the
204
+ `notificationToast` id in `FEEDBACK_TEST_IDS` (default toast testID `notification-toast`,
205
+ preserving existing Playwright selectors).
206
+
207
+ ## 1.2.0
208
+
209
+ - Broaden the injected theme so the settings-hub kit can consume it: colour scales are now
210
+ addressable at any step (`[step]`), and `palette`/`semantic` accept named scales beyond
211
+ `primary`/`error` (e.g. `secondary`, `accent`, `success`, `warning`, `info`) via index signatures.
212
+ Purely additive — existing `{primary}`/`{error}` themes still satisfy the types. Default value now
213
+ includes the common extra scales so no-provider rendering never reads `undefined`.
214
+
215
+ ## 1.1.0
216
+
217
+ - Add `colors.surface` to the injected theme (needed by the ui-forms kit; apps already pass it).
218
+ - Export neutral aliases `UiProvider` / `useUi` (+ `Ui*` types) for the feedback-specific
219
+ `FeedbackUiProvider` / `useFeedbackUi`. ui-feedback is now the shared UI context for the kit;
220
+ sibling packages (ui-forms, ui-tables, …) consume `useUi` instead of duplicating the provider.
221
+
222
+ ## 1.0.2
223
+
224
+ - `useFeedbackUi` now falls back to a neutral default theme + identity translate when no
225
+ `FeedbackUiProvider` is mounted (graceful degradation), instead of throwing. Apps still
226
+ mount a provider for the real theme/i18n; isolated tests render without one.
227
+
228
+ ## 1.0.0
229
+
230
+ Initial release. Extracted the proven duplicated feedback components from erevna-web ↔
231
+ katalogos-web (Capability Wave C1, batch 1).
232
+
233
+ - `FeedbackUiProvider` + `useFeedbackUi` — injectable theme/translate/navigate context.
234
+ - `ErrorState`, `EmptyListState`, `LoadingFallback`, `PageSkeleton`, `ConfirmDialog`.
235
+ - `FEEDBACK_TEST_IDS`, `MODAL_OVERLAY_COLOR`, `DISABLED_OPACITY` constants.
package/dist/index.d.mts CHANGED
@@ -560,4 +560,88 @@ declare function ProgressBar(props: ProgressBarProps): React.ReactElement;
560
560
  /** Clamps a possibly missing or non-finite percent into the 0-100 range. */
561
561
  declare function clampPercent(value: number | null | undefined): number;
562
562
 
563
- export { AppErrorBoundary, type AppErrorBoundaryProps, AsyncSurface, type AsyncSurfaceProps, ConfirmDialog, type ConfirmDialogProps, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, EmptyListState, type EmptyListStateProps, type ErrorBoundaryLabels, type ErrorFallbackState, ErrorState, type ErrorStateAction, type ErrorStateProps, FEEDBACK_TEST_IDS, type FeedbackColorScale, type FeedbackNavigate, type FeedbackTheme, type FeedbackThemeColors, type FeedbackThemePalette, type FeedbackThemeSemantic, type FeedbackTranslate, FeedbackUiProvider, type FeedbackUiProviderProps, type FeedbackUiValue, LoadingFallback, type LoadingFallbackProps, MODAL_OVERLAY_COLOR, PageSkeleton, type PageSkeletonProps, ProgressBar, type ProgressBarProps, type ToastBus, ToastHost, type ToastHostProps, type ToastInput, type ToastPush, type ToastType, type FeedbackColorScale as UiColorScale, type FeedbackNavigate as UiNavigate, FeedbackUiProvider as UiProvider, type FeedbackUiProviderProps as UiProviderProps, type FeedbackTheme as UiTheme, type FeedbackThemeColors as UiThemeColors, type FeedbackThemePalette as UiThemePalette, type FeedbackThemeSemantic as UiThemeSemantic, type FeedbackTranslate as UiTranslate, type FeedbackUiValue as UiValue, WARMING_QUIET_PERIOD_MS, type WarmingInfo, WarmingOverlay, type WarmingOverlayLabels, type WarmingOverlayProps, type WarmingSnapshot, clampPercent, createToastBus, getWarmingSnapshot, notifyWarming, settleWarming, subscribeWarming, useFeedbackUi, useFeedbackUi as useUi };
563
+ type RunStepState = 'done' | 'running' | 'pending' | 'failed';
564
+ interface RunStep {
565
+ label: string;
566
+ durationSec: number;
567
+ state: RunStepState;
568
+ }
569
+ interface RunGroup {
570
+ id: string;
571
+ label: string;
572
+ state: RunStepState;
573
+ durationSec: number;
574
+ steps: RunStep[];
575
+ }
576
+ interface FlatRunStep extends RunStep {
577
+ groupId: string;
578
+ groupLabel: string;
579
+ }
580
+ interface StepSplit {
581
+ visible: RunStep[];
582
+ hiddenCount: number;
583
+ }
584
+ interface DoneSummary {
585
+ count: number;
586
+ durationSec: number;
587
+ }
588
+ /** Folds flat steps into groups in first-seen order: sums each group's time, drops 0s done rows, worst state wins. */
589
+ declare function mergeRunSteps(flat: readonly FlatRunStep[]): RunGroup[];
590
+ /** Keeps the `keep` longest steps (and any running one) in their original order; counts the rest. */
591
+ declare function splitShorterSteps(steps: readonly RunStep[], keep: number): StepSplit;
592
+ /** The group whose steps show first: the running one, else a failed one, else the last. */
593
+ declare function defaultGroupId(groups: readonly RunGroup[]): string | null;
594
+ /** How many groups finished and their total time, for the compact one-chip summary. */
595
+ declare function summariseDoneGroups(groups: readonly RunGroup[]): DoneSummary;
596
+ /** A step bar's width as a 0-1 fraction of the longest step; a non-zero step never draws invisibly thin. */
597
+ declare function barFraction(durationSec: number, maxSec: number): number;
598
+ /** 0-100 from done/total, or null when the total is unknown. */
599
+ declare function progressPercent(progress: {
600
+ done: number;
601
+ total: number;
602
+ } | null | undefined): number | null;
603
+
604
+ interface LiveRunCardLabels {
605
+ status: string;
606
+ meta: string;
607
+ progress?: string;
608
+ progressA11y: string;
609
+ cancel: string;
610
+ cancelHint: string;
611
+ stepTimings: string;
612
+ stepTimingsHint: string;
613
+ groupHint: string;
614
+ moreStepsHint: string;
615
+ fewerSteps: string;
616
+ formatDuration: (sec: number) => string;
617
+ moreSteps: (count: number) => string;
618
+ doneSummary: (count: number, duration: string) => string;
619
+ groupA11y: (label: string, state: RunStepState, duration: string) => string;
620
+ stepA11y: (label: string, duration: string) => string;
621
+ }
622
+ interface LiveRunCardProps {
623
+ title: string;
624
+ status?: RunStepState;
625
+ currentStep?: string | null;
626
+ progress?: {
627
+ done: number;
628
+ total: number;
629
+ } | null;
630
+ groups: readonly RunGroup[];
631
+ labels: LiveRunCardLabels;
632
+ onCancel?: () => void;
633
+ cancelDisabled?: boolean;
634
+ compact?: boolean;
635
+ maxBars?: number;
636
+ testID?: string;
637
+ }
638
+
639
+ /** Below this window width the card renders compact: summary chips, step timings behind a toggle. */
640
+ declare const LIVE_RUN_CARD_COMPACT_MAX_PX = 640;
641
+ /** Presentational card for one active run: status, progress, per-group chips and step-time bars. */
642
+ declare function LiveRunCard(props: LiveRunCardProps): React.ReactElement;
643
+
644
+ /** The theme colour for a step or group state; falls back to primary/text when a semantic scale is absent. */
645
+ declare function runToneColor(theme: FeedbackTheme, state: RunStepState): string;
646
+
647
+ export { AppErrorBoundary, type AppErrorBoundaryProps, AsyncSurface, type AsyncSurfaceProps, ConfirmDialog, type ConfirmDialogProps, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, type DoneSummary, EmptyListState, type EmptyListStateProps, type ErrorBoundaryLabels, type ErrorFallbackState, ErrorState, type ErrorStateAction, type ErrorStateProps, FEEDBACK_TEST_IDS, type FeedbackColorScale, type FeedbackNavigate, type FeedbackTheme, type FeedbackThemeColors, type FeedbackThemePalette, type FeedbackThemeSemantic, type FeedbackTranslate, FeedbackUiProvider, type FeedbackUiProviderProps, type FeedbackUiValue, type FlatRunStep, LIVE_RUN_CARD_COMPACT_MAX_PX, LiveRunCard, type LiveRunCardLabels, type LiveRunCardProps, LoadingFallback, type LoadingFallbackProps, MODAL_OVERLAY_COLOR, PageSkeleton, type PageSkeletonProps, ProgressBar, type ProgressBarProps, type RunGroup, type RunStep, type RunStepState, type StepSplit, type ToastBus, ToastHost, type ToastHostProps, type ToastInput, type ToastPush, type ToastType, type FeedbackColorScale as UiColorScale, type FeedbackNavigate as UiNavigate, FeedbackUiProvider as UiProvider, type FeedbackUiProviderProps as UiProviderProps, type FeedbackTheme as UiTheme, type FeedbackThemeColors as UiThemeColors, type FeedbackThemePalette as UiThemePalette, type FeedbackThemeSemantic as UiThemeSemantic, type FeedbackTranslate as UiTranslate, type FeedbackUiValue as UiValue, WARMING_QUIET_PERIOD_MS, type WarmingInfo, WarmingOverlay, type WarmingOverlayLabels, type WarmingOverlayProps, type WarmingSnapshot, barFraction, clampPercent, createToastBus, defaultGroupId, getWarmingSnapshot, mergeRunSteps, notifyWarming, progressPercent, runToneColor, settleWarming, splitShorterSteps, subscribeWarming, summariseDoneGroups, useFeedbackUi, useFeedbackUi as useUi };