@remit/ui 0.0.221 → 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 (209) hide show
  1. package/package.json +14 -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 +55 -3
  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-reading-pane.stories.tsx +78 -0
  99. package/src/components/mobile-reading-pane.tsx +55 -41
  100. package/src/components/mobile-search-view.render.test.ts +0 -16
  101. package/src/components/mobile-search-view.stories.tsx +8 -11
  102. package/src/components/mobile-search-view.tsx +1 -1
  103. package/src/components/nav-sidebar.keyboard.test.ts +0 -8
  104. package/src/components/nav-sidebar.render.test.ts +2 -133
  105. package/src/components/new-folder-form.render.test.ts +0 -26
  106. package/src/components/outbox-row.render.test.ts +0 -9
  107. package/src/components/pane-layout.render.test.ts +0 -18
  108. package/src/components/plain-text-editor.mount.test.ts +0 -16
  109. package/src/components/popover-menu.render.test.ts +0 -11
  110. package/src/components/progress-bar.render.test.ts +0 -14
  111. package/src/components/quarantine-report.test.ts +0 -8
  112. package/src/components/quarantine-section.render.test.ts +16 -13
  113. package/src/components/quarantine-section.stories.tsx +11 -8
  114. package/src/components/reading-pane.render.test.ts +2 -106
  115. package/src/components/reading-pane.stories.tsx +3 -0
  116. package/src/components/refresh-button.render.test.ts +0 -9
  117. package/src/components/rescue-from-spam-flow.render.test.ts +0 -24
  118. package/src/components/rich-text-editor.mount.test.ts +0 -19
  119. package/src/components/rich-text-image-node.ts +11 -9
  120. package/src/components/role-appointment-list.render.test.ts +0 -49
  121. package/src/components/role-appointment-prompt.render.test.ts +0 -79
  122. package/src/components/row-actions.render.test.ts +0 -34
  123. package/src/components/search-bar.render.test.ts +0 -44
  124. package/src/components/search-chip-input.render.test.ts +0 -71
  125. package/src/components/search-conversion-notice.stories.tsx +0 -6
  126. package/src/components/search-conversion-notice.tsx +3 -9
  127. package/src/components/search-conversion.render.test.ts +0 -52
  128. package/src/components/search-conversion.ts +2 -18
  129. package/src/components/search-result-row.tsx +5 -26
  130. package/src/components/search-results.render.test.ts +0 -68
  131. package/src/components/search-results.stories.tsx +0 -30
  132. package/src/components/search-results.tsx +1 -1
  133. package/src/components/security-select.render.test.ts +1 -14
  134. package/src/components/selection-top-bar.render.test.ts +0 -180
  135. package/src/components/selection-wizard-fixtures.ts +0 -2
  136. package/src/components/selection-wizard.render.test.ts +7 -212
  137. package/src/components/selection-wizard.stories.tsx +24 -164
  138. package/src/components/selection-wizard.tsx +10 -86
  139. package/src/components/self-update.render.test.ts +0 -113
  140. package/src/components/sender-trust-indicator.render.test.ts +0 -30
  141. package/src/components/shell-top-bar.render.test.ts +0 -31
  142. package/src/components/shell-top-bar.stories.tsx +7 -0
  143. package/src/components/shell-top-bar.tsx +11 -2
  144. package/src/components/slide-panel.render.test.ts +0 -18
  145. package/src/components/suggest-list.render.test.ts +0 -6
  146. package/src/components/swipeable-row.gesture.test.ts +85 -40
  147. package/src/components/swipeable-row.render.test.ts +0 -7
  148. package/src/components/swipeable-row.stories.tsx +3 -2
  149. package/src/components/swipeable-row.tsx +65 -144
  150. package/src/components/sync-warning-fixtures.ts +22 -0
  151. package/src/components/sync-warning-report.ts +38 -0
  152. package/src/components/sync-warning-row.tsx +51 -0
  153. package/src/components/sync-warning-section.render.test.ts +19 -0
  154. package/src/components/sync-warning-section.stories.tsx +94 -0
  155. package/src/components/sync-warning-section.tsx +56 -0
  156. package/src/components/touch-list-body.render.test.ts +0 -29
  157. package/src/components/wizard.render.test.ts +0 -22
  158. package/src/filter-presets.test.ts +1 -107
  159. package/src/index.ts +40 -34
  160. package/src/lib/compose-language.test.ts +0 -11
  161. package/src/lib/email-render-treatment.test.ts +0 -21
  162. package/src/lib/keymap.test.ts +0 -32
  163. package/src/lib/property-prefill.ts +2 -2
  164. package/src/lib/search-rule.test.ts +0 -4
  165. package/src/lib/search-rule.ts +0 -9
  166. package/src/lib/sender-derivation.ts +3 -5
  167. package/src/lib/swipe-config.ts +11 -0
  168. package/src/lib/use-list-cursor.test.ts +0 -7
  169. package/src/lib/use-list-keyboard.test.ts +0 -14
  170. package/src/lib/use-long-press.test.ts +53 -36
  171. package/src/lib/use-long-press.ts +62 -56
  172. package/src/lib/use-modal-focus.test.ts +0 -20
  173. package/src/lib/use-selection.hook.test.ts +0 -13
  174. package/src/lib/use-selection.test.ts +0 -101
  175. package/src/lib/use-swipe-navigation.test.ts +162 -0
  176. package/src/lib/use-swipe-navigation.ts +90 -0
  177. package/src/lib/wizard-steps.test.ts +18 -79
  178. package/src/lib/wizard-steps.ts +27 -67
  179. package/src/mcp-pages.ts +36 -0
  180. package/src/category-presentation.test.ts +0 -76
  181. package/src/components/account-service-status.render.test.ts +0 -82
  182. package/src/components/app-password-hint.render.test.ts +0 -23
  183. package/src/components/app-top-bar.render.test.ts +0 -59
  184. package/src/components/auth-card.render.test.ts +0 -24
  185. package/src/components/auth-footer.render.test.ts +0 -17
  186. package/src/components/auth-hero.render.test.ts +0 -31
  187. package/src/components/auto-moved-badge.render.test.ts +0 -65
  188. package/src/components/button.render.test.ts +0 -29
  189. package/src/components/calendar-event-chip.render.test.ts +0 -67
  190. package/src/components/calendar-parse-badge.render.test.ts +0 -40
  191. package/src/components/checkbox.render.test.ts +0 -65
  192. package/src/components/compose-form-shell.render.test.ts +0 -106
  193. package/src/components/dialog.render.test.ts +0 -51
  194. package/src/components/field-label.render.test.ts +0 -16
  195. package/src/components/mail-action-toolbar.render.test.ts +0 -43
  196. package/src/components/nav-link-surface.render.test.ts +0 -126
  197. package/src/components/new-folder-action.render.test.ts +0 -44
  198. package/src/components/pane-header.render.test.ts +0 -22
  199. package/src/components/pull-to-refresh.render.test.ts +0 -46
  200. package/src/components/recurrence-scope-prompt.render.test.ts +0 -36
  201. package/src/components/rescue-banner.render.test.ts +0 -32
  202. package/src/components/rescue-candidate-row.render.test.ts +0 -68
  203. package/src/components/search-token-chip.render.test.ts +0 -42
  204. package/src/components/self-update-dot.tsx +0 -32
  205. package/src/components/settings-primitives.render.test.ts +0 -160
  206. package/src/lib/email-layout-clamp.test.ts +0 -139
  207. package/src/lib/label-color.test.ts +0 -25
  208. package/src/lib/semantic-off.ts +0 -20
  209. package/src/stories-viewport-globals.test.ts +0 -77
@@ -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
  />
@@ -19,7 +19,6 @@ import {
19
19
  } from "lucide-react";
20
20
  import { Fragment, type ReactNode, useEffect, useId, useRef } from "react";
21
21
  import { cn } from "../lib/cn.js";
22
- import { semanticOffReason } from "../lib/semantic-off.js";
23
22
  import {
24
23
  backExits,
25
24
  crossAccountMatchReason,
@@ -39,9 +38,8 @@ import {
39
38
  type RunOutcome,
40
39
  type RunState,
41
40
  runCopy,
42
- type SampleEmptyReason,
41
+ SAMPLE_EMPTY_COPY,
43
42
  type StepId,
44
- sampleEmptyCopy,
45
43
  stepIndex,
46
44
  stepLabel,
47
45
  unreadableDraftClauses,
@@ -210,12 +208,10 @@ export interface SelectionSampleProps {
210
208
  /**
211
209
  * The server's count of what the match covers (#477 5.3), carrying whether it
212
210
  * is still moving so nothing commits against a number that is about to change.
213
- * `uncounted` is the widened door, which carries no count until it has run.
211
+ * `uncounted` is the properties door, which carries no count until it has run.
214
212
  */
215
213
  count: MatchCount;
216
214
  label: string;
217
- /** Why there are no rows. Defaults to nothing matching, never to a bare empty state. */
218
- emptyReason?: SampleEmptyReason;
219
215
  /**
220
216
  * The rows are still being fetched. No rows yet is not the same answer as no
221
217
  * rows at all, and "nothing matches" beside a server count that says otherwise
@@ -239,18 +235,17 @@ const sampleFooter = (count: MatchCount, shown: number): string => {
239
235
  * count that came back empty may say nothing matches (#477 3.5).
240
236
  *
241
237
  * A body-text clause is the case that makes the difference load-bearing: the
242
- * vector-free matcher refuses to evaluate it, so there is no count and no rows,
238
+ * organize matcher refuses to evaluate it, so there is no count and no rows,
243
239
  * and "nothing matches this yet" is not merely unexplained but wrong — the rule
244
240
  * matches, once a saved rule is what runs it.
245
241
  */
246
242
  const sampleEmptyLine = (
247
243
  count: MatchCount,
248
- emptyReason: SampleEmptyReason | undefined,
249
244
  loading: boolean | undefined,
250
245
  ): string => {
251
246
  if (loading) return "Fetching the messages this covers…";
252
247
  if (count.status === "error") return count.reason;
253
- return sampleEmptyCopy(emptyReason ?? "noMatch");
248
+ return SAMPLE_EMPTY_COPY;
254
249
  };
255
250
 
256
251
  /**
@@ -262,7 +257,6 @@ export function SelectionSample({
262
257
  messages,
263
258
  count,
264
259
  label,
265
- emptyReason,
266
260
  loading,
267
261
  }: SelectionSampleProps) {
268
262
  return (
@@ -272,7 +266,7 @@ export function SelectionSample({
272
266
  </h2>
273
267
  {messages.length === 0 ? (
274
268
  <p className="px-3 py-4 text-xs text-fg-muted">
275
- {sampleEmptyLine(count, emptyReason, loading)}
269
+ {sampleEmptyLine(count, loading)}
276
270
  </p>
277
271
  ) : (
278
272
  <>
@@ -369,40 +363,20 @@ export interface MatchStepProps {
369
363
  mode: MatchMode;
370
364
  /**
371
365
  * The one account this selection belongs to, absent when it spans several
372
- * (#523). Both widened doors are counted through a preview that account
373
- * answers, so without one they are withheld and the step states the
366
+ * (#523). The properties door is counted through a preview that account
367
+ * answers, so without one it is withheld and the step states the
374
368
  * restriction — the ticked rows are their own match and stay on offer.
375
369
  */
376
370
  accountId?: string;
377
371
  /**
378
- * Answers the door. Typed to the three doors rather than to every mode, so
372
+ * Answers the door. Typed to the doors rather than to every mode, so
379
373
  * no driver can set `escalated` from a screen — the list escalates a
380
374
  * selection, the wizard never does.
381
375
  */
382
376
  onModeChange: (mode: MatchDoor) => void;
383
- /**
384
- * Similar-mail matching cannot run right now. A runtime state, not a property
385
- * of the deployment: the door stays pressable and dimmed.
386
- */
387
- semanticUnavailable?: boolean;
388
- /**
389
- * Semantic search is off on this instance (#1068) — a deployment setting, so
390
- * the door is dimmed for a reason an operator can act on rather than a
391
- * failure the user should retry. It supersedes the runtime copy above.
392
- */
393
- semanticOff?: boolean;
394
- /**
395
- * What the mail server said when the widen was asked to run and failed. A
396
- * failure is a reason the door cannot run, so it dims the door like any other
397
- * — with the server's own words under it rather than a generic line.
398
- */
399
- semanticErrorDetail?: string;
400
- /** The dimmed door was pressed and the senders were filled in instead. */
401
- semanticFallbackTaken?: boolean;
402
- onSemanticFallback: () => void;
403
377
  /**
404
378
  * What the escalated predicate covers, in the words the list escalated it
405
- * with. Read only while the mode is `escalated`, where it replaces the three
379
+ * with. Read only while the mode is `escalated`, where it replaces the
406
380
  * doors: the predicate is the match already.
407
381
  */
408
382
  escalatedScope?: string;
@@ -414,11 +388,6 @@ export function MatchStepBody({
414
388
  mode,
415
389
  accountId,
416
390
  onModeChange,
417
- semanticUnavailable,
418
- semanticOff,
419
- semanticErrorDetail,
420
- semanticFallbackTaken,
421
- onSemanticFallback,
422
391
  escalatedScope,
423
392
  sample,
424
393
  }: MatchStepProps) {
@@ -439,7 +408,6 @@ export function MatchStepBody({
439
408
  }
440
409
  const doors = matchDoorsFor(accountId);
441
410
  const widened = doors.length > 1;
442
- const widenBlocked = semanticOff || semanticUnavailable;
443
411
  return (
444
412
  <>
445
413
  <div className="space-y-2">
@@ -454,38 +422,6 @@ export function MatchStepBody({
454
422
  title={matchDoorLabel("selected", selectedCount)}
455
423
  description={matchDoorHint("selected")}
456
424
  />
457
- {widened && (
458
- <ChoiceCard
459
- selected={mode === "similar"}
460
- unavailable={widenBlocked}
461
- onSelect={
462
- widenBlocked ? onSemanticFallback : () => onModeChange("similar")
463
- }
464
- title={matchDoorLabel("similar", selectedCount)}
465
- description={matchDoorHint("similar")}
466
- >
467
- {semanticOff ? (
468
- <p role="status" className="px-1 text-2xs text-fg-subtle">
469
- {semanticOffReason}
470
- {semanticFallbackTaken && " Matching on the senders instead."}
471
- </p>
472
- ) : (
473
- <>
474
- {semanticErrorDetail && (
475
- <p role="status" className="px-1 text-2xs text-danger">
476
- Couldn't find similar messages: {semanticErrorDetail}
477
- </p>
478
- )}
479
- {semanticFallbackTaken && (
480
- <p role="status" className="px-1 text-2xs text-fg-subtle">
481
- Similar-mail matching is unavailable right now — matching on
482
- the senders instead.
483
- </p>
484
- )}
485
- </>
486
- )}
487
- </ChoiceCard>
488
- )}
489
425
  {widened && (
490
426
  <ChoiceCard
491
427
  selected={mode === "properties"}
@@ -525,8 +461,6 @@ export interface PropertiesStepProps {
525
461
  clauseSuggestions?: readonly Suggestion[];
526
462
  /** What converting a search left behind, when a query is what opened this. */
527
463
  conversionNotice?: SearchConversionNotice;
528
- /** The similar door was dimmed and these are the senders it fell back to. */
529
- semanticFallbackTaken?: boolean;
530
464
  sample: SelectionSampleProps;
531
465
  }
532
466
 
@@ -549,19 +483,11 @@ export function PropertiesStepBody({
549
483
  clauseFields,
550
484
  clauseSuggestions,
551
485
  conversionNotice,
552
- semanticFallbackTaken,
553
486
  sample,
554
487
  }: PropertiesStepProps) {
555
488
  const join = matchJoinWord(matchOperator);
556
489
  return (
557
490
  <div className="space-y-4">
558
- {semanticFallbackTaken && (
559
- <p role="status" className="px-1 text-xs text-fg-muted">
560
- Similar-mail matching is unavailable right now. These are the senders
561
- of the messages you picked.
562
- </p>
563
- )}
564
-
565
491
  {conversionNotice && (
566
492
  <SearchConversionNoticeView notice={conversionNotice} />
567
493
  )}
@@ -701,9 +627,7 @@ export function FolderStepBody({
701
627
  export interface RuleStepProps {
702
628
  /**
703
629
  * The rule so far. The scope and its stop date are answered here; the rest is
704
- * read, because whether a one-time apply can serve this rule depends on what
705
- * is matching it — a body-text clause is unreadable under the literal matcher
706
- * and perfectly readable under the semantic widen.
630
+ * read, because a body-text clause is unreadable to a one-time apply.
707
631
  */
708
632
  draft: WizardDraft;
709
633
  onScopeChange: (scope: RuleScope) => void;