@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
@@ -16,7 +16,6 @@ import {
16
16
  import {
17
17
  FolderStepBody,
18
18
  MatchStepBody,
19
- NameStepBody,
20
19
  PropertiesStepBody,
21
20
  ReviewStepBody,
22
21
  RuleStepBody,
@@ -64,7 +63,6 @@ const matchProps = {
64
63
  mode: "selected" as const,
65
64
  accountId: "acc-personal",
66
65
  onModeChange: noop,
67
- onSemanticFallback: noop,
68
66
  sample,
69
67
  };
70
68
 
@@ -153,31 +151,6 @@ describe("SelectionSample", () => {
153
151
  messages: [],
154
152
  count: counted(0),
155
153
  label: "What this matches",
156
- emptyReason: "noMatch",
157
- }),
158
- );
159
- assert.match(html, /Nothing matches this yet/);
160
- });
161
-
162
- it("says the mail is not indexed yet, the other reason for no rows", () => {
163
- const html = renderToString(
164
- createElement(SelectionSample, {
165
- messages: [],
166
- count: counted(0),
167
- label: "What this matches",
168
- emptyReason: "notIndexed",
169
- }),
170
- );
171
- assert.match(html, /isn't indexed yet/);
172
- assert.doesNotMatch(html, /Nothing matches this yet/);
173
- });
174
-
175
- it("still explains itself when no reason was given", () => {
176
- const html = renderToString(
177
- createElement(SelectionSample, {
178
- messages: [],
179
- count: counted(0),
180
- label: "Sample",
181
154
  }),
182
155
  );
183
156
  assert.match(html, /Nothing matches this yet/);
@@ -193,7 +166,6 @@ describe("SelectionSample", () => {
193
166
  messages: [],
194
167
  count: { status: "error", reason: UNCOUNTABLE_PREDICATE_REASON },
195
168
  label: "What this matches",
196
- emptyReason: "noMatch",
197
169
  }),
198
170
  );
199
171
  assert.match(text(html), /only a saved rule does/);
@@ -246,58 +218,12 @@ describe("SelectionSample", () => {
246
218
  });
247
219
 
248
220
  describe("MatchStepBody", () => {
249
- it("offers the three doors with the ticked count on them", () => {
221
+ it("offers both doors with the ticked count on them", () => {
250
222
  const html = renderToString(createElement(MatchStepBody, matchProps));
251
223
  assert.match(html, /These 2 messages/);
252
- assert.match(html, /Similar to these 2/);
253
224
  assert.match(html, /Its properties/);
254
225
  });
255
226
 
256
- it("leaves the similar door pressable and dimmed when it cannot run", () => {
257
- const html = renderToString(
258
- createElement(MatchStepBody, {
259
- ...matchProps,
260
- semanticUnavailable: true,
261
- semanticFallbackTaken: true,
262
- }),
263
- );
264
- assert.match(html, /opacity-55/);
265
- assert.doesNotMatch(html, /disabled=""/);
266
- assert.match(html, /matching on the\s+senders instead/);
267
- });
268
-
269
- // Off is a property of the deployment, so the door says what an operator can
270
- // do about it rather than "unavailable right now", which invites a retry that
271
- // cannot succeed (#1068).
272
- it("names the setting and the command when semantic search is off", () => {
273
- const html = renderToString(
274
- createElement(MatchStepBody, {
275
- ...matchProps,
276
- semanticOff: true,
277
- }),
278
- );
279
- assert.match(html, /opacity-55/);
280
- assert.doesNotMatch(html, /disabled=""/);
281
- assert.match(text(html), /Semantic search is off on this instance/);
282
- assert.match(text(html), /remit semantic on/);
283
- assert.doesNotMatch(text(html), /unavailable right now/);
284
- });
285
-
286
- it("supersedes the runtime failure copy, which would tell the user to retry", () => {
287
- const html = renderToString(
288
- createElement(MatchStepBody, {
289
- ...matchProps,
290
- semanticOff: true,
291
- semanticUnavailable: true,
292
- semanticErrorDetail: "no vector index",
293
- semanticFallbackTaken: true,
294
- }),
295
- );
296
- assert.doesNotMatch(text(html), /no vector index/);
297
- assert.match(text(html), /Semantic search is off on this instance/);
298
- assert.match(text(html), /Matching on the senders instead/);
299
- });
300
-
301
227
  it("names what an escalated predicate covers instead of offering doors", () => {
302
228
  const html = renderToString(
303
229
  createElement(MatchStepBody, {
@@ -313,9 +239,8 @@ describe("MatchStepBody", () => {
313
239
  );
314
240
  assert.match(html, /Every message matching "npm"/);
315
241
  assert.match(html, /nothing to widen/);
316
- // The three doors are gone: a predicate is the match already.
242
+ // The doors are gone: a predicate is the match already.
317
243
  assert.doesNotMatch(html, /These 2 messages/);
318
- assert.doesNotMatch(html, /Similar to these/);
319
244
  assert.doesNotMatch(html, /Its properties/);
320
245
  // The members of the match still close the screen (#477 2.3).
321
246
  assert.match(html, /Booking confirmation/);
@@ -330,10 +255,10 @@ describe("MatchStepBody", () => {
330
255
  });
331
256
 
332
257
  /**
333
- * Starred, and any other surface whose rows span accounts (#523). Both widened
334
- * doors are counted through a preview one account answers, so offering them
335
- * walks the user to a review waiting on a count nobody can take, with Back the
336
- * only way on. They are withheld, and the step says why.
258
+ * Starred, and any other surface whose rows span accounts (#523). The
259
+ * properties door is counted through a preview one account answers, so offering
260
+ * it walks the user to a review waiting on a count nobody can take, with Back the
261
+ * only way on. It is withheld, and the step says why.
337
262
  */
338
263
  describe("MatchStepBody with no single account", () => {
339
264
  const spanning = { ...matchProps, accountId: undefined };
@@ -341,7 +266,6 @@ describe("MatchStepBody with no single account", () => {
341
266
  it("offers the ticked rows alone, and states the restriction", () => {
342
267
  const html = text(renderToString(createElement(MatchStepBody, spanning)));
343
268
  assert.match(html, /These 2 messages/);
344
- assert.doesNotMatch(html, /Similar to these/);
345
269
  assert.doesNotMatch(html, /Its properties/);
346
270
  assert.match(html, /only works within one account/);
347
271
  });
@@ -401,14 +325,11 @@ describe("PropertiesStepBody", () => {
401
325
  conversionNotice: {
402
326
  scopedOutFolder: "Archive",
403
327
  droppedFacets: ["Unread"],
404
- droppedSemantic: true,
405
328
  },
406
- semanticFallbackTaken: true,
407
329
  }),
408
330
  );
409
331
  assert.match(html, /From your search/);
410
332
  assert.match(html, /limited to Archive/);
411
- assert.match(html, /These are the senders/);
412
333
  });
413
334
 
414
335
  it("offers no combine control for a single clause", () => {
@@ -474,18 +395,6 @@ describe("RuleStepBody", () => {
474
395
  { id: "c1", field: "HasWords", value: "boarding pass" },
475
396
  ];
476
397
 
477
- it("offers the three scopes", () => {
478
- const html = renderToString(
479
- createElement(RuleStepBody, {
480
- ...ruleProps,
481
- draft: draft({ scope: "once" }),
482
- }),
483
- );
484
- assert.match(html, /Just once/);
485
- assert.match(html, /Keep doing this/);
486
- assert.match(html, /Until a date/);
487
- });
488
-
489
398
  it("says a one-time apply cannot read message bodies, where the scope is chosen", () => {
490
399
  const html = renderToString(
491
400
  createElement(RuleStepBody, {
@@ -496,29 +405,6 @@ describe("RuleStepBody", () => {
496
405
  assert.match(html, /can't read message bodies/);
497
406
  });
498
407
 
499
- it("says nothing about message bodies when the widen is the matcher", () => {
500
- const html = renderToString(
501
- createElement(RuleStepBody, {
502
- ...ruleProps,
503
- draft: draft({ clauses: bodyTextClause, widen: { anchorCount: 3 } }),
504
- }),
505
- );
506
- assert.doesNotMatch(html, /can't read message bodies/);
507
- });
508
-
509
- it("warns again once the widen the rule carried cannot be evaluated", () => {
510
- const html = renderToString(
511
- createElement(RuleStepBody, {
512
- ...ruleProps,
513
- draft: draft({
514
- clauses: bodyTextClause,
515
- widen: { anchorCount: 3, inactive: true },
516
- }),
517
- }),
518
- );
519
- assert.match(html, /can't read message bodies/);
520
- });
521
-
522
408
  it("asks for the stop date on the step that offered the scope", () => {
523
409
  const html = renderToString(
524
410
  createElement(RuleStepBody, {
@@ -531,21 +417,6 @@ describe("RuleStepBody", () => {
531
417
  });
532
418
  });
533
419
 
534
- describe("NameStepBody", () => {
535
- it("prefills the suggested name and offers to clear it", () => {
536
- const html = renderToString(createElement(NameStepBody, nameProps));
537
- assert.match(html, /Travel confirmations/);
538
- assert.match(html, /Clear name/);
539
- });
540
-
541
- it("offers no clear control when the field is empty", () => {
542
- const html = renderToString(
543
- createElement(NameStepBody, { ...nameProps, name: "" }),
544
- );
545
- assert.doesNotMatch(html, /Clear name/);
546
- });
547
- });
548
-
549
420
  describe("ReviewStepBody", () => {
550
421
  it("states the whole thing as one sentence, then as a list, then the sample", () => {
551
422
  const html = renderToString(createElement(ReviewStepBody, reviewProps));
@@ -559,7 +430,7 @@ describe("ReviewStepBody", () => {
559
430
  const html = renderToString(
560
431
  createElement(ReviewStepBody, {
561
432
  ...reviewProps,
562
- mode: "similar",
433
+ mode: "properties",
563
434
  sample: {
564
435
  messages,
565
436
  count: UNCOUNTED,
@@ -851,33 +722,6 @@ describe("RunFooter", () => {
851
722
  });
852
723
 
853
724
  describe("SelectionWizard", () => {
854
- it("renders the header, the rail and the footer around every step", () => {
855
- for (const step of stepsFor({
856
- verb: "organize",
857
- mode: "properties",
858
- scope: "standing",
859
- })) {
860
- const html = renderToString(
861
- createElement(
862
- SelectionWizard,
863
- wizardProps({
864
- verb: "organize",
865
- steps: stepsFor({
866
- verb: "organize",
867
- mode: "properties",
868
- scope: "standing",
869
- }),
870
- step,
871
- review: { ...reviewProps, verb: "organize", scope: "standing" },
872
- }),
873
- ),
874
- );
875
- assert.match(html, /aria-label="Back"/, step);
876
- assert.match(html, /aria-label="Cancel"/, step);
877
- assert.match(html, /aria-label="Progress"/, step);
878
- }
879
- });
880
-
881
725
  it("counts the step out of the list the rail is rendering", () => {
882
726
  const steps = stepsFor({ verb: "move", mode: "properties" });
883
727
  const html = renderToString(
@@ -886,21 +730,6 @@ describe("SelectionWizard", () => {
886
730
  assert.match(text(html), /Step 3 of 5 · Folder/);
887
731
  });
888
732
 
889
- it("renders the header, the rail and the body from one resolved step", () => {
890
- const steps = stepsFor({ verb: "organize", mode: "selected" });
891
- const html = renderToString(
892
- createElement(
893
- SelectionWizard,
894
- wizardProps({ verb: "organize", steps, step: "properties" }),
895
- ),
896
- );
897
- assert.match(text(html), /Step 1 of 5 · Apply to/);
898
- assert.match(html, /What should this apply to\?/);
899
- assert.match(html, /These 2 messages/);
900
- assert.doesNotMatch(html, /Match properties/);
901
- assert.doesNotMatch(html, /Add clause/);
902
- });
903
-
904
733
  it("leaves the wizard on Back from the opening step and from the run", () => {
905
734
  const steps = stepsFor({ verb: "move", mode: "selected" });
906
735
  let backs = 0;
@@ -1009,40 +838,6 @@ describe("SelectionWizard", () => {
1009
838
  assert.doesNotMatch(nudged, /<p id="[^"]*"[^>]*sr-only/);
1010
839
  });
1011
840
 
1012
- it("commits under the scope's own label, in the verb's own tone", () => {
1013
- const html = renderToString(
1014
- createElement(
1015
- SelectionWizard,
1016
- wizardProps({
1017
- verb: "delete",
1018
- step: "review",
1019
- review: { ...reviewProps, verb: "delete", scope: undefined },
1020
- }),
1021
- ),
1022
- );
1023
- assert.match(html, /Delete/);
1024
- assert.match(html, /bg-danger/);
1025
- });
1026
-
1027
- it("uses the scope's commit label once a rule is being saved", () => {
1028
- const html = renderToString(
1029
- createElement(
1030
- SelectionWizard,
1031
- wizardProps({
1032
- verb: "organize",
1033
- steps: stepsFor({
1034
- verb: "organize",
1035
- mode: "selected",
1036
- scope: "standing",
1037
- }),
1038
- step: "review",
1039
- review: { ...reviewProps, verb: "organize", scope: "standing" },
1040
- }),
1041
- ),
1042
- );
1043
- assert.match(html, /Save rule/);
1044
- });
1045
-
1046
841
  it("fails loudly rather than rendering a step with no answers", () => {
1047
842
  assert.throws(
1048
843
  () =>
@@ -15,7 +15,6 @@ import {
15
15
  type MatchMode,
16
16
  type RunState,
17
17
  ruleRestrictionFor,
18
- type SampleEmptyReason,
19
18
  type SelectionRestriction,
20
19
  type StepId,
21
20
  stepBlockedReason,
@@ -54,15 +53,12 @@ interface WizardEntry {
54
53
  escalatedScope?: string;
55
54
  escalatedTotal?: number;
56
55
  scope?: RuleScope;
57
- semanticUnavailable?: boolean;
58
- semanticOff?: boolean;
59
- semanticError?: string;
60
56
  restriction?: SelectionRestriction;
61
57
  runState?: RunState;
62
58
  runFailureReason?: string;
63
59
  failedBeyondNamed?: number;
64
60
  bodyTextClause?: boolean;
65
- sampleEmpty?: SampleEmptyReason;
61
+ sampleEmpty?: boolean;
66
62
  sampleLoading?: boolean;
67
63
  folderCreate?: "confirms" | "never confirms" | "fails";
68
64
  }
@@ -169,10 +165,6 @@ function WizardDriver({
169
165
  );
170
166
  const [until, setUntil] = useState("");
171
167
  const [typedName, setTypedName] = useState<string>();
172
- const [semanticFallbackTaken, setSemanticFallbackTaken] = useState(
173
- Boolean(entry.semanticUnavailable || entry.semanticOff) &&
174
- (entry.startMode === "properties" || entry.startAt === "properties"),
175
- );
176
168
  const [nudged, setNudged] = useState(false);
177
169
  const [clauseSeq, setClauseSeq] = useState(0);
178
170
  const [runState, setRunState] = useState<RunState>(
@@ -211,7 +203,6 @@ function WizardDriver({
211
203
  const draft: WizardDraft = {
212
204
  clauses,
213
205
  matchOperator,
214
- widen: mode === "similar" ? { anchorCount: selected.length } : undefined,
215
206
  moveMailboxId: mailboxId,
216
207
  scope,
217
208
  until,
@@ -236,7 +227,6 @@ function WizardDriver({
236
227
  uncountable || entry.sampleEmpty || entry.sampleLoading ? [] : covered,
237
228
  count,
238
229
  label: mode === "selected" ? "Your selection" : "A sample of what matches",
239
- emptyReason: entry.sampleEmpty,
240
230
  loading: entry.sampleLoading,
241
231
  };
242
232
  const failures =
@@ -262,12 +252,6 @@ function WizardDriver({
262
252
  }
263
253
  };
264
254
 
265
- const fallBackToProperties = () => {
266
- setSemanticFallbackTaken(true);
267
- setClauses(seedPropertyClauses());
268
- setMode("properties");
269
- };
270
-
271
255
  const submitClause = () => {
272
256
  if (!clauseEdit) return;
273
257
  if (clauseEdit.clauseId) {
@@ -325,14 +309,6 @@ function WizardDriver({
325
309
  mode,
326
310
  accountId: wizardScope.accountId,
327
311
  onModeChange: changeMode,
328
- semanticUnavailable:
329
- entry.semanticUnavailable ||
330
- entry.semanticOff ||
331
- !!entry.semanticError,
332
- semanticOff: entry.semanticOff,
333
- semanticErrorDetail: entry.semanticError,
334
- semanticFallbackTaken,
335
- onSemanticFallback: fallBackToProperties,
336
312
  escalatedScope: escalated,
337
313
  sample,
338
314
  }}
@@ -368,7 +344,6 @@ function WizardDriver({
368
344
  fromSearch && conversion
369
345
  ? searchConversionNotice(conversion)
370
346
  : undefined,
371
- semanticFallbackTaken,
372
347
  sample: { ...sample, label: "What this matches" },
373
348
  }}
374
349
  folder={{
@@ -506,7 +481,7 @@ export const OrganizeApplyToDesktop: Story = {
506
481
  play: shows([
507
482
  "What should this apply to?",
508
483
  "These 3 messages",
509
- "Similar to these 3",
484
+ "Its properties",
510
485
  ]),
511
486
  globals: { viewport: { value: "desktop" } },
512
487
  render: () => (
@@ -639,16 +614,13 @@ export const DeleteReviewTablet: Story = {
639
614
  ),
640
615
  };
641
616
 
642
- export const DeleteReviewSimilar: Story = {
643
- name: "Delete — review, similar to these",
644
- play: shows([
645
- "Delete mail similar to these 3.",
646
- "This covers messages not shown in the list.",
647
- ]),
617
+ export const DeleteReviewProperties: Story = {
618
+ name: "Delete — review, matching properties",
619
+ play: shows(["This covers messages not shown in the list."]),
648
620
  render: () => (
649
621
  <Flow
650
622
  preselected={3}
651
- openAt={{ verb: "delete", startAt: "review", startMode: "similar" }}
623
+ openAt={{ verb: "delete", startAt: "review", startMode: "properties" }}
652
624
  />
653
625
  ),
654
626
  };
@@ -765,20 +737,6 @@ export const OrganizeApplyTo: Story = {
765
737
  ),
766
738
  };
767
739
 
768
- export const OrganizeSimilarDoor: Story = {
769
- name: "Organize — similar to these",
770
- play: shows([
771
- "Similar to these 3",
772
- "The first matches. The total is not known until the run finishes.",
773
- ]),
774
- render: () => (
775
- <Flow
776
- preselected={3}
777
- openAt={{ verb: "organize", startAt: "match", startMode: "similar" }}
778
- />
779
- ),
780
- };
781
-
782
740
  export const OrganizePropertyDoor: Story = {
783
741
  name: "Organize — match on properties",
784
742
  play: shows([
@@ -793,86 +751,25 @@ export const OrganizePropertyDoor: Story = {
793
751
  ),
794
752
  };
795
753
 
796
- export const OrganizeSemanticUnavailable: Story = {
797
- name: "Organize — similar unavailable",
798
- render: () => (
799
- <Flow
800
- preselected={3}
801
- openAt={{ verb: "organize", startAt: "match", semanticUnavailable: true }}
802
- />
803
- ),
804
- play: async ({ canvasElement }) => {
805
- const canvas = within(canvasElement);
806
- await userEvent.click(canvas.getByText("Similar to these 3"));
807
- await expect(
808
- await canvas.findByText(
809
- "Similar-mail matching is unavailable right now — matching on the senders instead.",
810
- ),
811
- ).toBeVisible();
812
- },
813
- };
814
-
815
- export const OrganizeSemanticOff: Story = {
816
- name: "Organize — semantic search off",
817
- play: shows([/Semantic search is off on this instance/, /remit semantic on/]),
818
- render: () => (
819
- <Flow
820
- preselected={3}
821
- openAt={{ verb: "organize", startAt: "match", semanticOff: true }}
822
- />
823
- ),
824
- };
825
-
826
- export const OrganizeSenderFallback: Story = {
827
- name: "Organize — sender fallback, addresses",
828
- play: shows([
829
- "Similar-mail matching is unavailable right now. These are the senders of the messages you picked.",
830
- "automated@airbnb.com",
831
- ]),
754
+ export const OrganizePropertiesAddresses: Story = {
755
+ name: "Organize — properties, addresses",
756
+ play: shows(["automated@airbnb.com"]),
832
757
  render: () => (
833
758
  <Flow
834
759
  preselected={3}
835
- openAt={{
836
- verb: "organize",
837
- startAt: "properties",
838
- semanticUnavailable: true,
839
- }}
760
+ openAt={{ verb: "organize", startAt: "properties" }}
840
761
  />
841
762
  ),
842
763
  };
843
764
 
844
- export const OrganizeSenderFallbackDomain: Story = {
845
- name: "Organize — sender fallback, one domain",
846
- play: shows([
847
- "npmjs.com",
848
- "Similar-mail matching is unavailable right now. These are the senders of the messages you picked.",
849
- ]),
765
+ export const OrganizePropertiesDomain: Story = {
766
+ name: "Organize — properties, one domain",
767
+ play: shows(["npmjs.com"]),
850
768
  render: () => (
851
769
  <Flow
852
770
  messages={SELECTION_SEARCH_SAMPLE}
853
771
  preselected={2}
854
- openAt={{
855
- verb: "organize",
856
- startAt: "properties",
857
- semanticUnavailable: true,
858
- }}
859
- />
860
- ),
861
- };
862
-
863
- export const OrganizeSenderFallbackStanding: Story = {
864
- name: "Organize — sender fallback, standing",
865
- play: shows(["So you can find it later", "Rule name"]),
866
- render: () => (
867
- <Flow
868
- preselected={4}
869
- openAt={{
870
- verb: "organize",
871
- startAt: "name",
872
- startMode: "properties",
873
- scope: "standing",
874
- semanticUnavailable: true,
875
- }}
772
+ openAt={{ verb: "organize", startAt: "properties" }}
876
773
  />
877
774
  ),
878
775
  };
@@ -911,7 +808,7 @@ export const OrganizeNothingMatches: Story = {
911
808
  openAt={{
912
809
  verb: "organize",
913
810
  startAt: "properties",
914
- sampleEmpty: "noMatch",
811
+ sampleEmpty: true,
915
812
  }}
916
813
  />
917
814
  ),
@@ -938,30 +835,13 @@ export const OrganizeUncountable: Story = {
938
835
  ),
939
836
  };
940
837
 
941
- export const OrganizeNothingIndexed: Story = {
942
- name: "Organize — nothing indexed",
943
- play: shows([
944
- "This mail isn't indexed yet, so nothing can be counted. The rule still matches once indexing catches up.",
945
- ]),
946
- render: () => (
947
- <Flow
948
- preselected={3}
949
- openAt={{
950
- verb: "organize",
951
- startAt: "properties",
952
- sampleEmpty: "notIndexed",
953
- }}
954
- />
955
- ),
956
- };
957
-
958
838
  export const OrganizeScope: Story = {
959
839
  name: "Organize — scope",
960
840
  play: shows(["How long should this hold?", "Choose one of the three first."]),
961
841
  render: () => (
962
842
  <Flow
963
843
  preselected={3}
964
- openAt={{ verb: "organize", startAt: "rule", startMode: "similar" }}
844
+ openAt={{ verb: "organize", startAt: "rule", startMode: "properties" }}
965
845
  />
966
846
  ),
967
847
  };
@@ -978,7 +858,7 @@ export const OrganizeStanding: Story = {
978
858
  openAt={{
979
859
  verb: "organize",
980
860
  startAt: "rule",
981
- startMode: "similar",
861
+ startMode: "properties",
982
862
  scope: "standing",
983
863
  }}
984
864
  />
@@ -994,7 +874,7 @@ export const OrganizeUntil: Story = {
994
874
  openAt={{
995
875
  verb: "organize",
996
876
  startAt: "rule",
997
- startMode: "similar",
877
+ startMode: "properties",
998
878
  scope: "until",
999
879
  }}
1000
880
  />
@@ -1038,24 +918,21 @@ export const OrganizeName: Story = {
1038
918
  render: () => (
1039
919
  <Flow
1040
920
  preselected={3}
1041
- openAt={{ verb: "organize", startAt: "name", startMode: "similar" }}
921
+ openAt={{ verb: "organize", startAt: "name", startMode: "properties" }}
1042
922
  />
1043
923
  ),
1044
924
  };
1045
925
 
1046
926
  export const OrganizeReviewStanding: Story = {
1047
927
  name: "Organize — review, standing",
1048
- play: shows([
1049
- "Organize mail similar to these 3 and save a rule that keeps doing it.",
1050
- "Mail from Booking.com",
1051
- ]),
928
+ play: shows([/that keeps doing it/]),
1052
929
  render: () => (
1053
930
  <Flow
1054
931
  preselected={3}
1055
932
  openAt={{
1056
933
  verb: "organize",
1057
934
  startAt: "review",
1058
- startMode: "similar",
935
+ startMode: "properties",
1059
936
  scope: "standing",
1060
937
  }}
1061
938
  />
@@ -1318,7 +1195,7 @@ export const CrossAccountMatch: Story = {
1318
1195
  name: "Apply to — selection spans accounts",
1319
1196
  play: shows(
1320
1197
  [/Matching beyond the messages you picked only works within one account/],
1321
- ["Similar to these 3"],
1198
+ ["Its properties"],
1322
1199
  ),
1323
1200
  render: () => (
1324
1201
  <Flow
@@ -1334,7 +1211,7 @@ export const CrossAccountMatch: Story = {
1334
1211
 
1335
1212
  export const CrossFolderMatch: Story = {
1336
1213
  name: "Apply to — selection spans folders",
1337
- play: shows(["Similar to these 3", "Its properties"], [/only works within/]),
1214
+ play: shows(["These 3 messages", "Its properties"], [/only works within/]),
1338
1215
  render: () => (
1339
1216
  <Flow
1340
1217
  preselected={3}
@@ -1379,23 +1256,6 @@ export const CrossFolderRule: Story = {
1379
1256
  ),
1380
1257
  };
1381
1258
 
1382
- export const MatchWidenFailed: Story = {
1383
- name: "Apply to — the widen failed",
1384
- play: shows([
1385
- "Couldn't find similar messages: The matcher is not reachable right now.",
1386
- ]),
1387
- render: () => (
1388
- <Flow
1389
- preselected={3}
1390
- openAt={{
1391
- verb: "organize",
1392
- startAt: "match",
1393
- semanticError: "The matcher is not reachable right now.",
1394
- }}
1395
- />
1396
- ),
1397
- };
1398
-
1399
1259
  export const MatchSampleLoading: Story = {
1400
1260
  name: "Apply to — the sample is still arriving",
1401
1261
  play: shows(["Fetching the messages this covers…"]),
@@ -1405,7 +1265,7 @@ export const MatchSampleLoading: Story = {
1405
1265
  openAt={{
1406
1266
  verb: "organize",
1407
1267
  startAt: "match",
1408
- startMode: "similar",
1268
+ startMode: "properties",
1409
1269
  sampleLoading: true,
1410
1270
  }}
1411
1271
  />