@remit/ui 0.0.222 → 0.0.223

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 (200) hide show
  1. package/package.json +12 -3
  2. package/src/components/DropdownMenu.tsx +100 -0
  3. package/src/components/EmptyState.tsx +11 -0
  4. package/src/components/ErrorBanner.render.test.ts +107 -0
  5. package/src/components/ErrorBanner.stories.tsx +132 -0
  6. package/src/components/ErrorBanner.tsx +122 -0
  7. package/src/components/ErrorBannerStack.tsx +34 -0
  8. package/src/components/ErrorState.render.test.ts +82 -0
  9. package/src/components/ErrorState.tsx +80 -0
  10. package/src/components/KeyboardShortcutsModal.tsx +111 -0
  11. package/src/components/account-service-change-dialog.render.test.ts +1 -41
  12. package/src/components/account-service-choice.render.test.ts +0 -26
  13. package/src/components/account-service-toggles.render.test.ts +0 -6
  14. package/src/components/address-display.render.test.ts +1 -38
  15. package/src/components/address-tag.render.test.ts +0 -11
  16. package/src/components/agenda-flow.reach.test.ts +0 -8
  17. package/src/components/agenda-flow.render.test.ts +0 -31
  18. package/src/components/agenda-panels.render.test.ts +0 -5
  19. package/src/components/app-shell-slotted.render.test.ts +0 -118
  20. package/src/components/attachment-list.render.test.ts +41 -24
  21. package/src/components/attachment-list.stories.tsx +67 -0
  22. package/src/components/attachment-list.tsx +112 -35
  23. package/src/components/attendee-row.render.test.ts +0 -41
  24. package/src/components/attention-dot.stories.tsx +46 -0
  25. package/src/components/attention-dot.tsx +23 -0
  26. package/src/components/banner.render.test.ts +0 -7
  27. package/src/components/bottom-sheet.render.test.ts +0 -42
  28. package/src/components/brief-section.render.test.ts +0 -13
  29. package/src/components/brief-sections.keyboard.test.ts +0 -13
  30. package/src/components/brief-sections.render.test.ts +0 -22
  31. package/src/components/calendar-clash-strip.render.test.ts +0 -19
  32. package/src/components/calendar-grid.render.test.ts +0 -79
  33. package/src/components/calendar-invite-card.render.test.ts +0 -19
  34. package/src/components/calendar-list.render.test.ts +0 -21
  35. package/src/components/calendar-slot-offers.render.test.ts +0 -24
  36. package/src/components/calendar-suggestion-deck.render.test.ts +0 -18
  37. package/src/components/calendar-toolbar.render.test.ts +1 -53
  38. package/src/components/category-badge.render.test.ts +1 -24
  39. package/src/components/compose-action-bar.render.test.ts +0 -5
  40. package/src/components/compose-attachments.render.test.ts +0 -38
  41. package/src/components/event-detail.render.test.ts +0 -27
  42. package/src/components/event-editor.render.test.ts +0 -4
  43. package/src/components/event-suggestion-card.render.test.ts +0 -61
  44. package/src/components/event-suggestion-card.zone-gate.test.ts +1 -7
  45. package/src/components/filter-clause-chip.tsx +1 -60
  46. package/src/components/filter-rule-editor.create.test.ts +0 -6
  47. package/src/components/filter-rule-editor.stories.tsx +24 -138
  48. package/src/components/filter-rule-editor.tsx +7 -93
  49. package/src/components/filter-rule.render.test.ts +9 -299
  50. package/src/components/filter-rule.ts +20 -85
  51. package/src/components/filter-sheet.render.test.ts +0 -7
  52. package/src/components/folder-manage-actions.render.test.ts +0 -13
  53. package/src/components/folder-manager.render.test.ts +0 -31
  54. package/src/components/folder-mutation-dialog.render.test.ts +0 -83
  55. package/src/components/folder-rename-dialog.render.test.ts +0 -14
  56. package/src/components/folder-row.render.test.ts +0 -30
  57. package/src/components/folder-sync-state.test.ts +0 -61
  58. package/src/components/folder-tree-picker.create.test.ts +0 -30
  59. package/src/components/folder-tree-picker.render.test.ts +0 -35
  60. package/src/components/intelligence-calendar-fixtures.ts +0 -2
  61. package/src/components/intelligence-calendar.render.test.ts +0 -4
  62. package/src/components/intelligence-panel.render.test.ts +1 -62
  63. package/src/components/intelligence-panel.stories.tsx +0 -76
  64. package/src/components/intelligence-panel.tab-strip.test.ts +0 -1
  65. package/src/components/intelligence-panel.tsx +6 -176
  66. package/src/components/intelligence-toggle.render.test.ts +0 -5
  67. package/src/components/isolated-email-frame.render.test.ts +0 -122
  68. package/src/components/isolated-email-frame.tsx +1 -1
  69. package/src/components/keyboard-hint-bar.render.test.ts +0 -7
  70. package/src/components/label-chip.render.test.ts +0 -28
  71. package/src/components/label-chip.tsx +1 -1
  72. package/src/components/mail-header.render.test.ts +0 -20
  73. package/src/components/mcp-connected-apps-page.stories.tsx +58 -0
  74. package/src/components/mcp-connected-apps-page.tsx +79 -0
  75. package/src/components/mcp-consent-page.stories.tsx +39 -0
  76. package/src/components/mcp-consent-page.tsx +47 -0
  77. package/src/components/mcp-device-page.stories.tsx +57 -0
  78. package/src/components/mcp-device-page.tsx +107 -0
  79. package/src/components/mcp-error-notice.stories.tsx +34 -0
  80. package/src/components/mcp-error-notice.tsx +23 -0
  81. package/src/components/mcp-error-page.stories.tsx +17 -0
  82. package/src/components/mcp-error-page.tsx +15 -0
  83. package/src/components/mcp-fixtures.ts +16 -0
  84. package/src/components/mcp-login-page.stories.tsx +37 -0
  85. package/src/components/mcp-login-page.tsx +58 -0
  86. package/src/components/mcp-page.stories.tsx +27 -0
  87. package/src/components/mcp-page.tsx +35 -0
  88. package/src/components/mcp-permission-list.stories.tsx +21 -0
  89. package/src/components/mcp-permission-list.tsx +22 -0
  90. package/src/components/message-body-view.render.test.ts +0 -21
  91. package/src/components/message-list-pane.brief-filter.test.ts +0 -6
  92. package/src/components/message-list-pane.render.test.ts +0 -54
  93. package/src/components/message-list-state.render.test.ts +0 -84
  94. package/src/components/{quarantine-bug-dialog.tsx → message-report-dialog.tsx} +9 -14
  95. package/src/components/message-row.render.test.ts +1 -98
  96. package/src/components/mobile-message-action-bar.render.test.ts +0 -59
  97. package/src/components/mobile-reading-pane.render.test.ts +0 -48
  98. package/src/components/mobile-search-view.render.test.ts +0 -16
  99. package/src/components/mobile-search-view.stories.tsx +8 -11
  100. package/src/components/mobile-search-view.tsx +1 -1
  101. package/src/components/nav-sidebar.keyboard.test.ts +0 -8
  102. package/src/components/nav-sidebar.render.test.ts +2 -133
  103. package/src/components/new-folder-form.render.test.ts +0 -26
  104. package/src/components/outbox-row.render.test.ts +0 -9
  105. package/src/components/pane-layout.render.test.ts +0 -18
  106. package/src/components/plain-text-editor.mount.test.ts +0 -16
  107. package/src/components/popover-menu.render.test.ts +0 -11
  108. package/src/components/progress-bar.render.test.ts +0 -14
  109. package/src/components/quarantine-report.test.ts +0 -8
  110. package/src/components/quarantine-section.render.test.ts +16 -13
  111. package/src/components/quarantine-section.stories.tsx +11 -8
  112. package/src/components/reading-pane.render.test.ts +2 -106
  113. package/src/components/reading-pane.stories.tsx +3 -0
  114. package/src/components/refresh-button.render.test.ts +0 -9
  115. package/src/components/rescue-from-spam-flow.render.test.ts +0 -24
  116. package/src/components/rich-text-editor.mount.test.ts +0 -19
  117. package/src/components/rich-text-image-node.ts +11 -9
  118. package/src/components/role-appointment-list.render.test.ts +0 -49
  119. package/src/components/role-appointment-prompt.render.test.ts +0 -79
  120. package/src/components/row-actions.render.test.ts +0 -34
  121. package/src/components/search-bar.render.test.ts +0 -44
  122. package/src/components/search-chip-input.render.test.ts +0 -71
  123. package/src/components/search-conversion-notice.stories.tsx +0 -6
  124. package/src/components/search-conversion-notice.tsx +3 -9
  125. package/src/components/search-conversion.render.test.ts +0 -52
  126. package/src/components/search-conversion.ts +2 -18
  127. package/src/components/search-result-row.tsx +5 -26
  128. package/src/components/search-results.render.test.ts +0 -68
  129. package/src/components/search-results.stories.tsx +0 -30
  130. package/src/components/search-results.tsx +1 -1
  131. package/src/components/security-select.render.test.ts +1 -14
  132. package/src/components/selection-top-bar.render.test.ts +0 -180
  133. package/src/components/selection-wizard-fixtures.ts +0 -2
  134. package/src/components/selection-wizard.render.test.ts +7 -212
  135. package/src/components/selection-wizard.stories.tsx +24 -164
  136. package/src/components/selection-wizard.tsx +10 -86
  137. package/src/components/self-update.render.test.ts +0 -113
  138. package/src/components/sender-trust-indicator.render.test.ts +0 -30
  139. package/src/components/shell-top-bar.render.test.ts +0 -31
  140. package/src/components/shell-top-bar.stories.tsx +7 -0
  141. package/src/components/shell-top-bar.tsx +11 -2
  142. package/src/components/slide-panel.render.test.ts +0 -18
  143. package/src/components/suggest-list.render.test.ts +0 -6
  144. package/src/components/swipeable-row.gesture.test.ts +0 -15
  145. package/src/components/swipeable-row.render.test.ts +0 -7
  146. package/src/components/sync-warning-fixtures.ts +22 -0
  147. package/src/components/sync-warning-report.ts +38 -0
  148. package/src/components/sync-warning-row.tsx +51 -0
  149. package/src/components/sync-warning-section.render.test.ts +19 -0
  150. package/src/components/sync-warning-section.stories.tsx +94 -0
  151. package/src/components/sync-warning-section.tsx +56 -0
  152. package/src/components/touch-list-body.render.test.ts +0 -29
  153. package/src/components/wizard.render.test.ts +0 -22
  154. package/src/filter-presets.test.ts +1 -107
  155. package/src/index.ts +40 -30
  156. package/src/lib/compose-language.test.ts +0 -11
  157. package/src/lib/email-render-treatment.test.ts +0 -21
  158. package/src/lib/keymap.test.ts +0 -32
  159. package/src/lib/property-prefill.ts +2 -2
  160. package/src/lib/search-rule.test.ts +0 -4
  161. package/src/lib/search-rule.ts +0 -9
  162. package/src/lib/sender-derivation.ts +3 -5
  163. package/src/lib/use-list-cursor.test.ts +0 -7
  164. package/src/lib/use-list-keyboard.test.ts +0 -14
  165. package/src/lib/use-modal-focus.test.ts +0 -20
  166. package/src/lib/use-selection.hook.test.ts +0 -13
  167. package/src/lib/use-selection.test.ts +0 -101
  168. package/src/lib/wizard-steps.test.ts +18 -79
  169. package/src/lib/wizard-steps.ts +27 -67
  170. package/src/mcp-pages.ts +36 -0
  171. package/src/category-presentation.test.ts +0 -76
  172. package/src/components/account-service-status.render.test.ts +0 -82
  173. package/src/components/app-password-hint.render.test.ts +0 -23
  174. package/src/components/app-top-bar.render.test.ts +0 -59
  175. package/src/components/auth-card.render.test.ts +0 -24
  176. package/src/components/auth-footer.render.test.ts +0 -17
  177. package/src/components/auth-hero.render.test.ts +0 -31
  178. package/src/components/auto-moved-badge.render.test.ts +0 -65
  179. package/src/components/button.render.test.ts +0 -29
  180. package/src/components/calendar-event-chip.render.test.ts +0 -67
  181. package/src/components/calendar-parse-badge.render.test.ts +0 -40
  182. package/src/components/checkbox.render.test.ts +0 -65
  183. package/src/components/compose-form-shell.render.test.ts +0 -106
  184. package/src/components/dialog.render.test.ts +0 -51
  185. package/src/components/field-label.render.test.ts +0 -16
  186. package/src/components/mail-action-toolbar.render.test.ts +0 -43
  187. package/src/components/nav-link-surface.render.test.ts +0 -126
  188. package/src/components/new-folder-action.render.test.ts +0 -44
  189. package/src/components/pane-header.render.test.ts +0 -22
  190. package/src/components/pull-to-refresh.render.test.ts +0 -46
  191. package/src/components/recurrence-scope-prompt.render.test.ts +0 -36
  192. package/src/components/rescue-banner.render.test.ts +0 -32
  193. package/src/components/rescue-candidate-row.render.test.ts +0 -68
  194. package/src/components/search-token-chip.render.test.ts +0 -42
  195. package/src/components/self-update-dot.tsx +0 -32
  196. package/src/components/settings-primitives.render.test.ts +0 -160
  197. package/src/lib/email-layout-clamp.test.ts +0 -139
  198. package/src/lib/label-color.test.ts +0 -25
  199. package/src/lib/semantic-off.ts +0 -20
  200. package/src/stories-viewport-globals.test.ts +0 -77
@@ -1,15 +1,9 @@
1
1
  import assert from "node:assert/strict";
2
- import { afterEach, describe, it } from "node:test";
2
+ import { describe, it } from "node:test";
3
3
  import { createElement } from "react";
4
4
  import { renderToString } from "react-dom/server";
5
5
  import type { NavAccount, NavLinkComponent } from "./app-shell-types.js";
6
- import {
7
- NAV_ACCOUNT_OPEN_KEY,
8
- NAV_FOLDER_OPEN_KEY,
9
- NavSidebar,
10
- readOpen,
11
- writeOpen,
12
- } from "./nav-sidebar.js";
6
+ import { NAV_FOLDER_OPEN_KEY, NavSidebar, readOpen } from "./nav-sidebar.js";
13
7
 
14
8
  const accounts: NavAccount[] = [
15
9
  {
@@ -25,23 +19,6 @@ const accounts: NavAccount[] = [
25
19
  },
26
20
  ];
27
21
 
28
- /** Minimal in-memory localStorage stub for the persistence contract tests. */
29
- class MemoryStorage {
30
- private store = new Map<string, string>();
31
- getItem(key: string): string | null {
32
- return this.store.has(key) ? (this.store.get(key) ?? null) : null;
33
- }
34
- setItem(key: string, value: string): void {
35
- this.store.set(key, value);
36
- }
37
- removeItem(key: string): void {
38
- this.store.delete(key);
39
- }
40
- clear(): void {
41
- this.store.clear();
42
- }
43
- }
44
-
45
22
  /** An anchor-rendering linkComponent so we can assert real <a href> output. */
46
23
  const hrefLink: NavLinkComponent = ({
47
24
  navId,
@@ -57,18 +34,6 @@ const hrefLink: NavLinkComponent = ({
57
34
  );
58
35
 
59
36
  describe("NavSidebar", () => {
60
- it("renders the daily brief item", () => {
61
- const html = renderToString(
62
- createElement(NavSidebar, {
63
- accounts,
64
- selectedNavId: "personal-inbox",
65
- briefUnseen: 7,
66
- onSelectNav: () => undefined,
67
- }),
68
- );
69
- assert.match(html, /Daily brief/);
70
- });
71
-
72
37
  it("labels the \\Flagged virtual mailbox 'Starred'", () => {
73
38
  const html = renderToString(
74
39
  createElement(NavSidebar, {
@@ -81,20 +46,6 @@ describe("NavSidebar", () => {
81
46
  assert.doesNotMatch(html, /Flagged/);
82
47
  });
83
48
 
84
- it("renders system and custom mailbox names", () => {
85
- const html = renderToString(
86
- createElement(NavSidebar, {
87
- accounts,
88
- selectedNavId: "personal-inbox",
89
- onSelectNav: () => undefined,
90
- }),
91
- );
92
- assert.match(html, /Inbox/);
93
- assert.match(html, /Sent/);
94
- assert.match(html, /Trash/);
95
- assert.match(html, /Travel/);
96
- });
97
-
98
49
  it("marks a folder whose last change failed and names the reason", () => {
99
50
  const html = renderToString(
100
51
  createElement(NavSidebar, {
@@ -119,18 +70,6 @@ describe("NavSidebar", () => {
119
70
  assert.match(html, /title="Locked — Permission denied"/);
120
71
  });
121
72
 
122
- it("gives the selected item its active accent styling", () => {
123
- const html = renderToString(
124
- createElement(NavSidebar, {
125
- accounts,
126
- selectedNavId: "personal-inbox",
127
- onSelectNav: () => undefined,
128
- }),
129
- );
130
- assert.match(html, /bg-accent-2-soft/);
131
- assert.match(html, /text-accent-2/);
132
- });
133
-
134
73
  it("carries no Settings entry — it lives in the top bar, by the avatar", () => {
135
74
  for (const variant of [undefined, "drawer" as const]) {
136
75
  const html = renderToString(
@@ -161,19 +100,6 @@ describe("NavSidebar", () => {
161
100
  assert.match(html, /<a href="\/mail\/personal-travel"/);
162
101
  });
163
102
 
164
- it("carries aria-label and the fullPath title on a mailbox link", () => {
165
- const html = renderToString(
166
- createElement(NavSidebar, {
167
- accounts,
168
- selectedNavId: "personal-inbox",
169
- onSelectNav: () => undefined,
170
- linkComponent: hrefLink,
171
- }),
172
- );
173
- assert.match(html, /aria-label="Inbox"/);
174
- assert.match(html, /title="Personal\/Travel"/);
175
- });
176
-
177
103
  it("renders an Outbox entry with its pending count when set", () => {
178
104
  const html = renderToString(
179
105
  createElement(NavSidebar, {
@@ -188,17 +114,6 @@ describe("NavSidebar", () => {
188
114
  assert.match(html, /3/);
189
115
  });
190
116
 
191
- it("omits the Outbox entry when outboxPending is undefined", () => {
192
- const html = renderToString(
193
- createElement(NavSidebar, {
194
- accounts,
195
- selectedNavId: "personal-inbox",
196
- onSelectNav: () => undefined,
197
- }),
198
- );
199
- assert.doesNotMatch(html, /Outbox/);
200
- });
201
-
202
117
  it("shows the empty state when no accounts are configured", () => {
203
118
  const html = renderToString(
204
119
  createElement(NavSidebar, {
@@ -290,25 +205,6 @@ describe("NavSidebar", () => {
290
205
  ],
291
206
  };
292
207
 
293
- it("pins Hostnet system folders with their role icons", () => {
294
- const html = renderToString(
295
- createElement(NavSidebar, {
296
- accounts: [hostnet],
297
- selectedNavId: "hn-inbox",
298
- onSelectNav: () => undefined,
299
- }),
300
- );
301
- assert.match(html, /lucide-inbox/);
302
- assert.match(html, /lucide-file-text/);
303
- assert.match(html, /lucide-send/);
304
- assert.match(html, /lucide-archive/);
305
- assert.match(html, /lucide-octagon-alert/);
306
- assert.match(html, /lucide-trash2/);
307
- // The real user folder lands in the collapsible Folders section.
308
- assert.match(html, /Nieuwsbrieven/);
309
- assert.match(html, /Folders/);
310
- });
311
-
312
208
  it("orders Hostnet system folders canonically and before custom folders", () => {
313
209
  const html = renderToString(
314
210
  createElement(NavSidebar, {
@@ -355,13 +251,6 @@ describe("NavSidebar with mail sync off", () => {
355
251
  }),
356
252
  );
357
253
 
358
- it("keeps the account and every mailbox it already synced", () => {
359
- const html = render(mailOff);
360
- assert.match(html, /Personal/);
361
- assert.match(html, /Inbox/);
362
- assert.match(html, /Travel/);
363
- });
364
-
365
254
  it("labels the account rather than leaving it to be guessed at", () => {
366
255
  assert.match(render(mailOff), /mail sync off/);
367
256
  });
@@ -373,26 +262,6 @@ describe("NavSidebar with mail sync off", () => {
373
262
  });
374
263
 
375
264
  describe("NavSidebar collapse persistence", () => {
376
- afterEach(() => {
377
- Reflect.deleteProperty(globalThis, "localStorage");
378
- });
379
-
380
- it("defaults to open when nothing is stored", () => {
381
- (globalThis as { localStorage?: Storage }).localStorage =
382
- new MemoryStorage() as unknown as Storage;
383
- assert.equal(readOpen(NAV_FOLDER_OPEN_KEY, "acct-1", true), true);
384
- assert.equal(readOpen(NAV_ACCOUNT_OPEN_KEY, "acct-1", true), true);
385
- });
386
-
387
- it("round-trips a stored collapsed flag per id", () => {
388
- (globalThis as { localStorage?: Storage }).localStorage =
389
- new MemoryStorage() as unknown as Storage;
390
- writeOpen(NAV_ACCOUNT_OPEN_KEY, "acct-1", false);
391
- assert.equal(readOpen(NAV_ACCOUNT_OPEN_KEY, "acct-1", true), false);
392
- // A different id is unaffected — collapse is keyed per account.
393
- assert.equal(readOpen(NAV_ACCOUNT_OPEN_KEY, "acct-2", true), true);
394
- });
395
-
396
265
  it("honours the supplied fallback with no storage available", () => {
397
266
  // No localStorage on globalThis → return fallback verbatim.
398
267
  assert.equal(readOpen(NAV_FOLDER_OPEN_KEY, "acct-1", false), false);
@@ -17,15 +17,6 @@ const render = (props: Partial<NewFolderFormProps>) =>
17
17
  );
18
18
 
19
19
  describe("NewFolderForm", () => {
20
- it("asks for a name and states where the folder goes", () => {
21
- const html = render({ name: "Car hire" });
22
- assert.match(html, /Folder name/);
23
- assert.match(html, /value="Car hire"/);
24
- assert.match(html, /placeholder="Hotels"/);
25
- assert.match(html, /Inside/);
26
- assert.match(html, />Travel</);
27
- });
28
-
29
20
  it("ties the label to the field it names", () => {
30
21
  const html = render({});
31
22
  const forId = html.match(/<label[^>]*for="([^"]+)"/)?.[1];
@@ -33,10 +24,6 @@ describe("NewFolderForm", () => {
33
24
  assert.match(html, new RegExp(`<input[^>]*id="${forId}"`));
34
25
  });
35
26
 
36
- it("states the parent as text rather than a second choice", () => {
37
- assert.doesNotMatch(render({}), /<select/);
38
- });
39
-
40
27
  it("holds the wait and refuses a second submit while it runs", () => {
41
28
  const html = render({ pending: true });
42
29
  assert.match(html, /Creating folder…/);
@@ -48,17 +35,4 @@ describe("NewFolderForm", () => {
48
35
  const html = render({ error: "The mail server refused that name." });
49
36
  assert.match(html, /role="alert"[^>]*>The mail server refused that name\./);
50
37
  });
51
-
52
- it("says nothing about a failure that has not happened", () => {
53
- assert.doesNotMatch(render({}), /role="alert"/);
54
- });
55
-
56
- it("applies caller-supplied labels", () => {
57
- const html = render({
58
- labels: { create: "Map maken", cancel: "Annuleren", insideLabel: "In" },
59
- });
60
- assert.match(html, />Map maken</);
61
- assert.match(html, />Annuleren</);
62
- assert.doesNotMatch(html, /Inside/);
63
- });
64
38
  });
@@ -14,15 +14,6 @@ const baseProps = {
14
14
  };
15
15
 
16
16
  describe("OutboxRow", () => {
17
- it("renders recipients, subject and the status label", () => {
18
- const html = renderToString(
19
- createElement(OutboxRow, { ...baseProps, status: "queued" }),
20
- );
21
- assert.match(html, /alex@example\.com/);
22
- assert.match(html, /Hello/);
23
- assert.match(html, /Queued/);
24
- });
25
-
26
17
  it("hides the action cluster for in-flight statuses", () => {
27
18
  const html = renderToString(
28
19
  createElement(OutboxRow, { ...baseProps, status: "sending" }),
@@ -27,12 +27,6 @@ describe("resolvePaneLayout — pane count by width", () => {
27
27
  assert.equal(paneCount(l), 1);
28
28
  });
29
29
 
30
- it("tablet portrait (834, iPad): still list alone", () => {
31
- const l = resolvePaneLayout(834);
32
- assert.equal(l.reading, false);
33
- assert.equal(paneCount(l), 1);
34
- });
35
-
36
30
  it("just below the reading boundary (1023): still list alone", () => {
37
31
  assert.equal(resolvePaneLayout(1023).reading, false);
38
32
  });
@@ -45,12 +39,6 @@ describe("resolvePaneLayout — pane count by width", () => {
45
39
  assert.equal(paneCount(l), 3);
46
40
  });
47
41
 
48
- it("iPad landscape (1112): two content panes, no rail", () => {
49
- const l = resolvePaneLayout(1112);
50
- assert.equal(l.reading, true);
51
- assert.equal(l.intelligence, false);
52
- });
53
-
54
42
  it("just below the rail boundary (1279): no rail", () => {
55
43
  assert.equal(resolvePaneLayout(1279).intelligence, false);
56
44
  });
@@ -96,10 +84,4 @@ describe("resolvePaneLayout — configurable thresholds (#900/#901)", () => {
96
84
  "at the custom intelligence boundary",
97
85
  );
98
86
  });
99
-
100
- it("defaults still match the module constants when no overrides given", () => {
101
- const withDefaults = resolvePaneLayout(1024);
102
- const withExplicit = resolvePaneLayout(1024, 1024, 1280);
103
- assert.deepEqual(withDefaults, withExplicit, "defaults are identical");
104
- });
105
87
  });
@@ -98,13 +98,6 @@ const mount = async (
98
98
  };
99
99
 
100
100
  describe("PlainTextEditor", () => {
101
- it("offers no formatting buttons, and says Markdown is read here", async () => {
102
- await mount();
103
-
104
- assert.equal(container.querySelectorAll("button").length, 0);
105
- assert.match(container.textContent ?? "", /Markdown/);
106
- });
107
-
108
101
  it("inserts a pasted web page as Markdown", async () => {
109
102
  const editor = await mount();
110
103
 
@@ -126,15 +119,6 @@ describe("PlainTextEditor", () => {
126
119
  assert.equal(editor.latest(), "| not | a | table |");
127
120
  });
128
121
 
129
- it("carries the mode toggle at the right of its toolbar", async () => {
130
- await mount("", { trailing: true });
131
-
132
- const toggle = container.querySelector("[data-testid=compose-mode-toggle]");
133
- assert.ok(toggle, "the toggle rides in the toolbar");
134
- assert.equal(toggle.getAttribute("aria-pressed"), "true");
135
- assert.equal(toggle.textContent, "Plain text");
136
- });
137
-
138
122
  it("takes focus with the caret at the end when it arrives on a switch", async () => {
139
123
  await mount("Everything written so far.", { initialCaret: "end" });
140
124
 
@@ -52,15 +52,4 @@ describe("PopoverMenu", () => {
52
52
  assert.match(html, /aria-label="Apply label[^>]*role="menuitem"/);
53
53
  assert.match(html, /role="none"/);
54
54
  });
55
-
56
- it("renders the trigger text beside its glyph", () => {
57
- const html = renderToString(
58
- createElement(PopoverMenu, {
59
- triggerLabel: "Apply label to selected messages",
60
- triggerText: "Apply label",
61
- items: [item],
62
- }),
63
- );
64
- assert.match(html, /Apply label</);
65
- });
66
55
  });
@@ -15,13 +15,6 @@ describe("ProgressBar", () => {
15
15
  assert.match(html, /aria-valuemax="3412"/);
16
16
  });
17
17
 
18
- it("computes the fill width as a percentage of value/max", () => {
19
- const html = renderToString(
20
- createElement(ProgressBar, { value: 25, max: 100 }),
21
- );
22
- assert.match(html, /width:25%/);
23
- });
24
-
25
18
  it("clamps the fill at 100% when value exceeds max", () => {
26
19
  const html = renderToString(
27
20
  createElement(ProgressBar, { value: 500, max: 100 }),
@@ -36,11 +29,4 @@ describe("ProgressBar", () => {
36
29
  assert.doesNotMatch(html, /aria-valuenow/);
37
30
  assert.doesNotMatch(html, /aria-valuemax/);
38
31
  });
39
-
40
- it("applies the tone's fill color", () => {
41
- const html = renderToString(
42
- createElement(ProgressBar, { value: 1, max: 2, tone: "danger" }),
43
- );
44
- assert.match(html, /bg-danger/);
45
- });
46
32
  });
@@ -7,7 +7,6 @@ import {
7
7
  type QuarantineEntry,
8
8
  quarantineIssueTitle,
9
9
  quarantineReportSections,
10
- quarantineSummary,
11
10
  } from "./quarantine-report.js";
12
11
 
13
12
  const entry: QuarantineEntry = {
@@ -191,10 +190,3 @@ describe("quarantineIssueTitle", () => {
191
190
  assert.doesNotMatch(title, /joan@/);
192
191
  });
193
192
  });
194
-
195
- describe("quarantineSummary", () => {
196
- it("explains the stage without parser jargon", () => {
197
- const summary = quarantineSummary("BodyParse");
198
- assert.doesNotMatch(summary, /MIME|RFC|mailparser|charset=/i);
199
- });
200
- });
@@ -2,9 +2,12 @@ import assert from "node:assert/strict";
2
2
  import { describe, it } from "node:test";
3
3
  import { createElement } from "react";
4
4
  import { renderToString } from "react-dom/server";
5
- import { QuarantineBugDialog } from "./quarantine-bug-dialog.js";
5
+ import { MessageReportDialog } from "./message-report-dialog.js";
6
6
  import { quarantineDemoEntries } from "./quarantine-fixtures.js";
7
- import type { QuarantineEntry } from "./quarantine-report.js";
7
+ import {
8
+ formatQuarantineReport,
9
+ type QuarantineEntry,
10
+ } from "./quarantine-report.js";
8
11
  import { QuarantineSection } from "./quarantine-section.js";
9
12
 
10
13
  const noop = () => {};
@@ -64,25 +67,25 @@ describe("QuarantineSection", () => {
64
67
  });
65
68
  });
66
69
 
67
- describe("QuarantineBugDialog", () => {
70
+ describe("MessageReportDialog", () => {
68
71
  it("shows the whole report before anything is filed", () => {
69
72
  const html = renderToString(
70
- createElement(QuarantineBugDialog, {
71
- entry: base,
73
+ createElement(MessageReportDialog, {
74
+ report: formatQuarantineReport(base),
72
75
  onClose: noop,
73
76
  onCopy: noop,
74
77
  issueUrl: ISSUE_URL,
75
78
  }),
76
79
  );
77
80
  assert.match(html, /UnreadableBody/);
78
- assert.match(html, /attachment names, or the parser&#x27;s own error text/);
81
+ assert.match(html, /folder name, or the parser&#x27;s own error text/);
79
82
  assert.match(html, /Copy report/);
80
83
  });
81
84
 
82
85
  it("never renders the parser's own error text into the report", () => {
83
86
  const html = renderToString(
84
- createElement(QuarantineBugDialog, {
85
- entry: base,
87
+ createElement(MessageReportDialog, {
88
+ report: formatQuarantineReport(base),
86
89
  onClose: noop,
87
90
  onCopy: noop,
88
91
  issueUrl: ISSUE_URL,
@@ -95,8 +98,8 @@ describe("QuarantineBugDialog", () => {
95
98
 
96
99
  it("files through the supplied url with hardened external rel", () => {
97
100
  const html = renderToString(
98
- createElement(QuarantineBugDialog, {
99
- entry: base,
101
+ createElement(MessageReportDialog, {
102
+ report: formatQuarantineReport(base),
100
103
  onClose: noop,
101
104
  onCopy: noop,
102
105
  issueUrl: ISSUE_URL,
@@ -106,10 +109,10 @@ describe("QuarantineBugDialog", () => {
106
109
  assert.match(html, /focus-visible:ring-2/);
107
110
  });
108
111
 
109
- it("renders nothing without an entry", () => {
112
+ it("renders nothing without a report", () => {
110
113
  const html = renderToString(
111
- createElement(QuarantineBugDialog, {
112
- entry: null,
114
+ createElement(MessageReportDialog, {
115
+ report: null,
113
116
  onClose: noop,
114
117
  onCopy: noop,
115
118
  issueUrl: ISSUE_URL,
@@ -1,8 +1,11 @@
1
1
  import type { Meta, StoryObj } from "@storybook/react-vite";
2
2
  import { useState } from "react";
3
- import { QuarantineBugDialog } from "./quarantine-bug-dialog.js";
3
+ import { MessageReportDialog } from "./message-report-dialog.js";
4
4
  import { quarantineDemoEntries } from "./quarantine-fixtures.js";
5
- import type { QuarantineEntry } from "./quarantine-report.js";
5
+ import {
6
+ formatQuarantineReport,
7
+ type QuarantineEntry,
8
+ } from "./quarantine-report.js";
6
9
  import { QuarantineSection } from "./quarantine-section.js";
7
10
 
8
11
  const [unterminatedBoundary, unknownCharset, truncatedBody, shapeUnread] =
@@ -51,8 +54,8 @@ export const CutABugFlow: Story = {
51
54
  <>
52
55
  <QuarantineSection entries={quarantineDemoEntries} onCutBug={setOpen} />
53
56
  {copied && <p className="mt-3 text-xs text-positive">Report copied.</p>}
54
- <QuarantineBugDialog
55
- entry={open}
57
+ <MessageReportDialog
58
+ report={open ? formatQuarantineReport(open) : null}
56
59
  issueUrl={demoIssueUrl}
57
60
  onClose={() => setOpen(null)}
58
61
  onCopy={() => setCopied(true)}
@@ -69,8 +72,8 @@ export const CutABugFlow: Story = {
69
72
  */
70
73
  export const BugReportWithoutMessageShape: Story = {
71
74
  render: () => (
72
- <QuarantineBugDialog
73
- entry={shapeUnread}
75
+ <MessageReportDialog
76
+ report={formatQuarantineReport(shapeUnread)}
74
77
  issueUrl={demoIssueUrl}
75
78
  onClose={() => {}}
76
79
  onCopy={() => {}}
@@ -80,8 +83,8 @@ export const BugReportWithoutMessageShape: Story = {
80
83
 
81
84
  export const BugReport: Story = {
82
85
  render: () => (
83
- <QuarantineBugDialog
84
- entry={unterminatedBoundary}
86
+ <MessageReportDialog
87
+ report={formatQuarantineReport(unterminatedBoundary)}
85
88
  issueUrl={demoIssueUrl}
86
89
  onClose={() => {}}
87
90
  onCopy={() => {}}
@@ -2,12 +2,8 @@ import assert from "node:assert/strict";
2
2
  import { describe, it } from "node:test";
3
3
  import { createElement } from "react";
4
4
  import { renderToString } from "react-dom/server";
5
- import type { ThreadData, ThreadMessageData } from "./app-shell-types.js";
6
- import {
7
- CollapsedMessage,
8
- ExpandedMessage,
9
- ReadingPane,
10
- } from "./reading-pane.js";
5
+ import type { ThreadMessageData } from "./app-shell-types.js";
6
+ import { CollapsedMessage } from "./reading-pane.js";
11
7
 
12
8
  const message: ThreadMessageData = {
13
9
  id: "m-1",
@@ -19,73 +15,6 @@ const message: ThreadMessageData = {
19
15
  bodyHtml: "<p>body</p>",
20
16
  };
21
17
 
22
- const thread: ThreadData = {
23
- subject: "Q3 planning notes",
24
- messages: [
25
- {
26
- id: "msg-1",
27
- fromName: "Alex Rivera",
28
- fromEmail: "alex@example.com",
29
- toLabel: "you",
30
- dateLabel: "Today, 09:11",
31
- snippet: "Here's where we landed after the call.",
32
- bodyHtml: "<p>The roadmap stands and the budget is locked.</p>",
33
- expanded: true,
34
- },
35
- ],
36
- };
37
-
38
- describe("ReadingPane", () => {
39
- it("renders the subject and the expanded message header with a thread", () => {
40
- const html = renderToString(createElement(ReadingPane, { thread }));
41
- assert.match(html, /Q3 planning notes/);
42
- // The email body now renders through the kit's sanitize → sandboxed
43
- // IsolatedEmailFrame pipeline (#940), which needs a DOM and so emits no
44
- // body text under SSR. Assert the expanded message's sender header
45
- // instead; body rendering is covered by the sanitizer + MessageBodyView
46
- // tests.
47
- assert.match(html, /Alex Rivera/);
48
- });
49
-
50
- it("renders the empty state with no thread", () => {
51
- const html = renderToString(createElement(ReadingPane, {}));
52
- assert.doesNotMatch(html, /Q3 planning notes/);
53
- assert.match(html, /Select a thread to read/);
54
- });
55
-
56
- it("renders the message verbs and no search field — search is the app top bar's", () => {
57
- const html = renderToString(createElement(ReadingPane, { thread }));
58
- assert.match(html, /title="Reply \(r\)"/);
59
- assert.doesNotMatch(html, /Search mail/);
60
- });
61
- });
62
-
63
- describe("CollapsedMessage row slots (#945)", () => {
64
- it("renders the fixture date label when no trailing slot is given", () => {
65
- const html = renderToString(createElement(CollapsedMessage, { message }));
66
- assert.match(html, /Today, 09:11/);
67
- assert.match(html, /Jamie Chen/);
68
- });
69
-
70
- it("renders the app's trailing cluster instead of the date label", () => {
71
- const html = renderToString(
72
- createElement(CollapsedMessage, {
73
- message,
74
- trailing: createElement("span", null, "STAR-DATE-SLOT"),
75
- }),
76
- );
77
- assert.match(html, /STAR-DATE-SLOT/);
78
- assert.doesNotMatch(html, /Today, 09:11/);
79
- });
80
-
81
- it("shows the unread dot and bolds the sender when isUnread", () => {
82
- const html = renderToString(
83
- createElement(CollapsedMessage, { message, isUnread: true }),
84
- );
85
- assert.match(html, /font-semibold/);
86
- });
87
- });
88
-
89
18
  describe("CollapsedMessage nested-button fix (#1232)", () => {
90
19
  it("renders the clickable row as a role=button div so a trailing button doesn't nest inside a button", () => {
91
20
  const html = renderToString(
@@ -114,36 +43,3 @@ describe("CollapsedMessage nested-button fix (#1232)", () => {
114
43
  assert.doesNotMatch(html, /tabindex=/);
115
44
  });
116
45
  });
117
-
118
- describe("ExpandedMessage row slots (#945)", () => {
119
- it("injects the app body slot instead of the fixture MessageBodyView", () => {
120
- const html = renderToString(
121
- createElement(ExpandedMessage, {
122
- message,
123
- body: createElement("div", null, "REAL-MESSAGE-BODY"),
124
- }),
125
- );
126
- assert.match(html, /REAL-MESSAGE-BODY/);
127
- });
128
-
129
- it("renders the sender badge, action menu and recipient slots", () => {
130
- const html = renderToString(
131
- createElement(ExpandedMessage, {
132
- message,
133
- senderBadge: createElement("span", null, "BADGE"),
134
- actionMenu: createElement("span", null, "ACTION-MENU"),
135
- to: createElement("span", null, "TO-LINE"),
136
- }),
137
- );
138
- assert.match(html, /BADGE/);
139
- assert.match(html, /ACTION-MENU/);
140
- assert.match(html, /TO-LINE/);
141
- });
142
-
143
- it("hides the recipient line when `to` is null", () => {
144
- const html = renderToString(
145
- createElement(ExpandedMessage, { message, to: null }),
146
- );
147
- assert.doesNotMatch(html, /to Alex Rivera/);
148
- });
149
- });
@@ -284,6 +284,7 @@ const ThreadAttachments = () => {
284
284
  const [rows, setRows] = useState<AttachmentItem[]>([
285
285
  {
286
286
  attachmentId: "part-2",
287
+ kind: "file",
287
288
  filename: "Q3 board pack.pdf",
288
289
  typeLabel: "PDF",
289
290
  sizeOctets: 2_411_724,
@@ -291,6 +292,7 @@ const ThreadAttachments = () => {
291
292
  },
292
293
  {
293
294
  attachmentId: "part-3",
295
+ kind: "file",
294
296
  filename: "headcount.csv",
295
297
  typeLabel: "CSV",
296
298
  sizeOctets: 4_180,
@@ -309,6 +311,7 @@ const ThreadAttachments = () => {
309
311
  <AttachmentList
310
312
  className="mt-4"
311
313
  attachments={rows}
314
+ onToggleOpen={() => {}}
312
315
  onDownload={(attachmentId) => {
313
316
  setStatus(attachmentId, { status: "downloading" });
314
317
  setTimeout(() => setStatus(attachmentId, { status: "idle" }), 900);
@@ -42,15 +42,6 @@ describe("RefreshButton", () => {
42
42
  assert.match(html, /aria-label="Refresh inbox — refreshing"/);
43
43
  });
44
44
 
45
- it("shows a quiet dot for new mail only at rest", () => {
46
- const idle = render({ hasUpdate: true });
47
- assert.match(idle, /aria-label="Refresh inbox — new mail"/);
48
- assert.match(idle, /bg-accent-2/);
49
-
50
- const refreshing = render({ state: "refreshing", hasUpdate: true });
51
- assert.doesNotMatch(refreshing, /bg-accent-2/);
52
- });
53
-
54
45
  it("confirms success without claiming a failure", () => {
55
46
  const html = render({ state: "success" });
56
47
  assert.equal(stateOf(html), "success");