@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
@@ -9,31 +9,11 @@ import {
9
9
  } from "./keymap.js";
10
10
 
11
11
  describe("keymap module", () => {
12
- test("exposes the documented groups in reading order", () => {
13
- const titles = KEY_HINT_GROUPS.map((g) => g.title);
14
- assert.deepStrictEqual(titles, [
15
- "Navigation",
16
- "Selection",
17
- "Actions",
18
- "Sender",
19
- "Go to",
20
- "View & global",
21
- ]);
22
- });
23
-
24
12
  test("keysForAction returns the first hint's tokens", () => {
25
13
  assert.deepStrictEqual(keysForAction("reply"), ["r"]);
26
14
  assert.deepStrictEqual(keysForAction("goBrief"), ["g", "b"]);
27
15
  });
28
16
 
29
- test("keysForAction is undefined for an action with no hint", () => {
30
- // `back` has a hint; a contrived missing lookup returns undefined.
31
- assert.strictEqual(
32
- keysForAction("totallyMissing" as Parameters<typeof keysForAction>[0]),
33
- undefined,
34
- );
35
- });
36
-
37
17
  test("tooltipForAction renders single keys, sequences and combos", () => {
38
18
  assert.strictEqual(tooltipForAction("reply"), "(r)");
39
19
  assert.strictEqual(tooltipForAction("goBrief"), "(g then b)");
@@ -76,16 +56,4 @@ describe("keymap module", () => {
76
56
  assert.ok(keysForAction(action), `${action} has keys`);
77
57
  }
78
58
  });
79
-
80
- test("every hint's action is a non-empty key list", () => {
81
- for (const group of KEY_HINT_GROUPS) {
82
- for (const hint of group.hints) {
83
- assert.ok(hint.keys.length > 0, `${hint.action} has keys`);
84
- assert.ok(
85
- hint.description.length > 0,
86
- `${hint.action} has a description`,
87
- );
88
- }
89
- }
90
- });
91
59
  });
@@ -2,8 +2,8 @@ import type { RuleClause } from "../components/filter-rule.js";
2
2
  import { deriveSenderClauses, distinctSenders } from "./sender-derivation.js";
3
3
 
4
4
  /**
5
- * The opening clauses for a rule matched on properties alone — no semantic
6
- * anchor (RFC 038 D2/D4). The selection is the only evidence available, so the
5
+ * The opening clauses for a rule matched on properties (RFC 038 D2). The
6
+ * selection is the only evidence available, so the
7
7
  * prefill reads it in the order the evidence is strongest:
8
8
  *
9
9
  * 1. One sender across the whole selection, or several that collapse to one
@@ -13,7 +13,6 @@ const conversion = (
13
13
  matchOperator: "all",
14
14
  droppedFacets: [],
15
15
  keptTerms: false,
16
- droppedSemantic: false,
17
16
  ...overrides,
18
17
  });
19
18
 
@@ -51,13 +50,11 @@ describe("searchConversionNotice", () => {
51
50
  keptTerms: true,
52
51
  scopedOut: { mailboxId: "mbx-archive", label: "Archive" },
53
52
  droppedFacets: [{ type: "isUnread", label: "Unread" }],
54
- droppedSemantic: true,
55
53
  }),
56
54
  );
57
55
  assert.deepEqual(notice, {
58
56
  scopedOutFolder: "Archive",
59
57
  droppedFacets: ["Unread"],
60
- droppedSemantic: true,
61
58
  });
62
59
  });
63
60
 
@@ -68,7 +65,6 @@ describe("searchConversionNotice", () => {
68
65
  assert.deepEqual(notice, {
69
66
  scopedOutFolder: undefined,
70
67
  droppedFacets: [],
71
- droppedSemantic: false,
72
68
  });
73
69
  });
74
70
  });
@@ -46,14 +46,6 @@ export interface SearchConversion {
46
46
  targetAccountId?: string;
47
47
  /** The search carried free-text terms, kept as a `HasWords` clause. */
48
48
  keptTerms: boolean;
49
- /**
50
- * The filter this conversion builds is always literal-only — free text has no
51
- * anchor message for a semantic widen — so the search's semantic "similar mail"
52
- * reach is dropped whenever the search had one (RFC 038 D5). True exactly when
53
- * free text was kept AND the search surfaced semantically-similar mail; on a
54
- * deployment with no semantic reach there was nothing to drop, so no note.
55
- */
56
- droppedSemantic: boolean;
57
49
  }
58
50
 
59
51
  /**
@@ -74,5 +66,4 @@ export const searchConversionNotice = (
74
66
  ): SearchConversionNotice => ({
75
67
  scopedOutFolder: conversion.scopedOut?.label,
76
68
  droppedFacets: conversion.droppedFacets.map((facet) => facet.label),
77
- droppedSemantic: conversion.droppedSemantic,
78
69
  });
@@ -1,11 +1,9 @@
1
1
  /**
2
2
  * Senders in a selection turned into clauses (RFC 038 D2).
3
3
  *
4
- * The widen fallback for a deployment that ships no vector pipeline reaches for
5
- * this: the semantic anchor matches nothing there, so a widen degrades to the
6
- * literal vocabulary RFC 031 already matches vector-free — one `From` clause per
7
- * distinct sender, or a single `FromDomain` clause when they all sit on one
8
- * registrable domain. The same predicate matches at index time (RFC 034), so a
4
+ * The literal vocabulary RFC 031 matches — one `From` clause per distinct
5
+ * sender, or a single `FromDomain` clause when they all sit on one registrable
6
+ * domain. The same predicate matches at index time (RFC 034), so a
9
7
  * standing filter built from it keeps working on future mail.
10
8
  */
11
9
 
@@ -90,13 +90,6 @@ describe("useListCursor — the roving cursor", () => {
90
90
  act(() => cursor().focusLast());
91
91
  assert.equal(cursor().focusedMessageId, undefined);
92
92
  });
93
-
94
- it("asks for DOM focus on its own moves, not on a pointer move", () => {
95
- const cursor = mountCursor({ initialFocusedId: "m1" });
96
- act(() => cursor().focusNext());
97
- assert.equal(cursor().pendingDomFocusRef.current, "m2");
98
- assert.equal(cursor().cursorMovedByPointerRef.current, false);
99
- });
100
93
  });
101
94
 
102
95
  describe("useListCursor — selection", () => {
@@ -102,20 +102,6 @@ afterEach(() => {
102
102
  });
103
103
 
104
104
  describe("useListKeyboard", () => {
105
- it("registers the keys the footer may offer and no others", () => {
106
- assert.deepEqual(Object.keys(list.keyboard.handlers).sort(), [
107
- "back",
108
- "extendSelectDown",
109
- "extendSelectUp",
110
- "focusFirst",
111
- "focusLast",
112
- "focusNext",
113
- "focusPrevious",
114
- "selectAll",
115
- "toggleSelect",
116
- ]);
117
- });
118
-
119
105
  it("moves the cursor the pane draws", () => {
120
106
  press("j");
121
107
  press("j");
@@ -54,11 +54,6 @@ describe("useModalFocus", () => {
54
54
  assert.equal(document.activeElement?.textContent, "First action");
55
55
  });
56
56
 
57
- it("leaves focus on the body while closed", () => {
58
- act(() => root.render(createElement(Panel, { open: false })));
59
- assert.equal(document.activeElement, document.body);
60
- });
61
-
62
57
  it("moves focus in when an already-mounted panel opens", () => {
63
58
  act(() => root.render(createElement(Panel, { open: false })));
64
59
  assert.equal(document.activeElement, document.body);
@@ -144,21 +139,6 @@ describe("useModalFocus", () => {
144
139
  outside.remove();
145
140
  });
146
141
 
147
- it("leaves focus outside the panel alone on Shift+Tab too", () => {
148
- const outside = document.createElement("button");
149
- outside.textContent = "Behind the panel";
150
- document.body.appendChild(outside);
151
-
152
- act(() => root.render(createElement(Panel, { open: true })));
153
- outside.focus();
154
-
155
- const event = tab(true);
156
-
157
- assert.equal(event.defaultPrevented, false);
158
- assert.equal(document.activeElement, outside);
159
- outside.remove();
160
- });
161
-
162
142
  /**
163
143
  * Clicking the title of a dialog — a region no control owns — leaves focus on
164
144
  * the body, and the next Tab has to land back inside the surface rather than
@@ -49,13 +49,6 @@ afterEach(() => {
49
49
  const ids = ["a", "b", "c", "d"];
50
50
 
51
51
  describe("useSelection", () => {
52
- it("starts empty", () => {
53
- assert.deepEqual(selected(), []);
54
- assert.equal(api.selectedCount, 0);
55
- assert.equal(api.hasSelection, false);
56
- assert.equal(api.anchorId, undefined);
57
- });
58
-
59
52
  it("toggles a row on and off, anchoring on it either way", () => {
60
53
  run(() => api.toggle("b"));
61
54
  assert.deepEqual(selected(), ["b"]);
@@ -101,12 +94,6 @@ describe("useSelection", () => {
101
94
  assert.deepEqual(selected(), ids);
102
95
  });
103
96
 
104
- it("seeds the anchor without touching the selection", () => {
105
- run(() => api.setAnchor("c"));
106
- assert.deepEqual(selected(), []);
107
- assert.equal(api.anchorId, "c");
108
- });
109
-
110
97
  it("extends a range from the anchor, and keeps extending from it", () => {
111
98
  run(() => api.toggle("b"));
112
99
  run(() => api.selectRange(ids, "d"));
@@ -5,7 +5,6 @@ import {
5
5
  deriveIsMultiSelectMode,
6
6
  intersectSelectedIds,
7
7
  isModified,
8
- modifiersOf,
9
8
  nextFocusId,
10
9
  resolveRangeAnchor,
11
10
  rowSelectIntent,
@@ -13,38 +12,6 @@ import {
13
12
 
14
13
  const ids = ["a", "b", "c", "d", "e"];
15
14
 
16
- // Mirrors the hook's `selectRange` state transition (anchor + selection) using
17
- // the same pure helpers it runs, so the mouse/keyboard sequences below exercise
18
- // the real logic without an interactive DOM. Returns the next {selected, anchor}.
19
- const applyRange = (
20
- state: { selected: Set<string>; anchor: string | undefined },
21
- orderedIds: string[],
22
- targetId: string,
23
- fallbackAnchor?: string,
24
- ): { selected: Set<string>; anchor: string | undefined } => {
25
- const anchor = resolveRangeAnchor(
26
- orderedIds,
27
- state.anchor,
28
- fallbackAnchor,
29
- targetId,
30
- );
31
- const range = computeRange(orderedIds, anchor, targetId);
32
- const selected = new Set(state.selected);
33
- for (const id of range) selected.add(id);
34
- return { selected, anchor };
35
- };
36
-
37
- // Mirrors a cmd/ctrl-click: toggle membership and re-anchor on the clicked row.
38
- const applyToggle = (
39
- state: { selected: Set<string>; anchor: string | undefined },
40
- targetId: string,
41
- ): { selected: Set<string>; anchor: string | undefined } => {
42
- const selected = new Set(state.selected);
43
- if (selected.has(targetId)) selected.delete(targetId);
44
- else selected.add(targetId);
45
- return { selected, anchor: targetId };
46
- };
47
-
48
15
  describe("computeRange", () => {
49
16
  test("forward range: anchor above target selects the inclusive slice", () => {
50
17
  assert.deepStrictEqual(computeRange(ids, "b", "d"), ["b", "c", "d"]);
@@ -105,57 +72,6 @@ describe("resolveRangeAnchor", () => {
105
72
  });
106
73
  });
107
74
 
108
- describe("shift-click range over a filtered/search-narrowed list (#142, #144)", () => {
109
- test("shift-click range with an active filter builds the range within the visible rows", () => {
110
- // Full inbox is a..h; the "Automated" filter leaves only these rows.
111
- const filtered = ["b", "d", "f", "g"];
112
- // The open row "d" is visible; nothing selected yet, no stored anchor.
113
- let state = {
114
- selected: new Set<string>(),
115
- anchor: undefined as string | undefined,
116
- };
117
- // Shift-click "g": ranges from the open/focused row "d" to "g".
118
- state = applyRange(state, filtered, "g", "d");
119
- assert.deepStrictEqual([...state.selected], ["d", "f", "g"]);
120
- assert.strictEqual(state.anchor, "d");
121
- });
122
-
123
- test("range where the anchor left the visible set re-anchors instead of no-oping", () => {
124
- const filtered = ["b", "d", "f", "g"];
125
- // Stored anchor "a" was selected before the filter narrowed the list and is
126
- // no longer visible; there is no open/focused fallback row.
127
- let state = {
128
- selected: new Set<string>(),
129
- anchor: "a" as string | undefined,
130
- };
131
- // First shift-click adopts the clicked row as the new visible anchor.
132
- state = applyRange(state, filtered, "f");
133
- assert.deepStrictEqual([...state.selected], ["f"]);
134
- assert.strictEqual(state.anchor, "f");
135
- // Second shift-click now builds a real range from that adopted anchor.
136
- state = applyRange(state, filtered, "b");
137
- assert.deepStrictEqual([...state.selected].sort(), ["b", "d", "f"]);
138
- assert.strictEqual(state.anchor, "f");
139
- });
140
-
141
- test("multi-select across a search-results list: cmd-click then shift-click", () => {
142
- // Search "npm" yields these results; the inbox anchor is gone from this set.
143
- const results = ["m1", "m2", "m3", "m4", "m5"];
144
- let state = {
145
- selected: new Set<string>(),
146
- anchor: "inbox-row" as string | undefined,
147
- };
148
- // Cmd-click "m2": toggles it in and re-anchors on it (a visible row).
149
- state = applyToggle(state, "m2");
150
- assert.deepStrictEqual([...state.selected], ["m2"]);
151
- assert.strictEqual(state.anchor, "m2");
152
- // Shift-click "m4": ranges from the cmd-clicked anchor across the results.
153
- state = applyRange(state, results, "m4");
154
- assert.deepStrictEqual([...state.selected].sort(), ["m2", "m3", "m4"]);
155
- assert.strictEqual(state.anchor, "m2");
156
- });
157
- });
158
-
159
75
  describe("nextFocusId", () => {
160
76
  test("moves down one row", () => {
161
77
  assert.strictEqual(nextFocusId(ids, "b", 1), "c");
@@ -247,23 +163,6 @@ describe("intersectSelectedIds", () => {
247
163
  });
248
164
  });
249
165
 
250
- describe("modifiersOf", () => {
251
- test("keeps only the three keys a selection reads off an event", () => {
252
- const event = {
253
- shiftKey: true,
254
- metaKey: false,
255
- ctrlKey: true,
256
- altKey: true,
257
- button: 0,
258
- };
259
- assert.deepStrictEqual(modifiersOf(event), {
260
- shiftKey: true,
261
- metaKey: false,
262
- ctrlKey: true,
263
- });
264
- });
265
- });
266
-
267
166
  describe("isModified", () => {
268
167
  test("is true for any of the three keys a keyboard can add", () => {
269
168
  assert.equal(
@@ -27,8 +27,8 @@ import {
27
27
  type RunState,
28
28
  ruleRestrictionFor,
29
29
  runCopy,
30
+ SAMPLE_EMPTY_COPY,
30
31
  type StepId,
31
- sampleEmptyCopy,
32
32
  stepBlockedReason,
33
33
  stepIndex,
34
34
  stepLabel,
@@ -42,7 +42,7 @@ import {
42
42
  } from "./wizard-steps.js";
43
43
 
44
44
  const VERBS: Verb[] = ["delete", "move", "junk", "markRead", "organize"];
45
- const MODES: MatchMode[] = ["selected", "similar", "properties", "escalated"];
45
+ const MODES: MatchMode[] = ["selected", "properties", "escalated"];
46
46
  const SCOPES: (RuleScope | undefined)[] = [
47
47
  undefined,
48
48
  "once",
@@ -63,11 +63,6 @@ describe("stepsFor — the step ids for every verb × match mode × scope", () =
63
63
  "review",
64
64
  "run",
65
65
  ]);
66
- assert.deepEqual(stepsFor({ verb: "junk", mode: "similar" }), [
67
- "match",
68
- "review",
69
- "run",
70
- ]);
71
66
  assert.deepEqual(stepsFor({ verb: "markRead", mode: "properties" }), [
72
67
  "match",
73
68
  "properties",
@@ -105,7 +100,7 @@ describe("stepsFor — the step ids for every verb × match mode × scope", () =
105
100
  ["match", "folder", "rule", "review", "run"],
106
101
  );
107
102
  assert.deepEqual(
108
- stepsFor({ verb: "organize", mode: "similar", scope: "standing" }),
103
+ stepsFor({ verb: "organize", mode: "selected", scope: "standing" }),
109
104
  ["match", "folder", "rule", "name", "review", "run"],
110
105
  );
111
106
  assert.deepEqual(
@@ -412,38 +407,19 @@ describe("stepBlockedReason", () => {
412
407
  );
413
408
  });
414
409
 
415
- it("waits on no count where a widened door never had one", () => {
410
+ it("waits on no count where the properties door never had one", () => {
416
411
  assert.equal(stepBlockedReason("review", draft(), UNCOUNTED), undefined);
417
412
  });
418
413
 
419
- it("lets the semantic widen carry a clause the literal matcher cannot read", () => {
420
- // The clause was added on the property door, then the user went back and
421
- // took "Similar to these". The widen is the matcher now and it reads
422
- // bodies, so a one-off apply is fine — and the property step is not even in
423
- // this step list, so a block here would name a clause on no reachable
424
- // screen.
425
- const clauses = [clause("HasWords", "boarding pass")];
426
- const similar = draft({
427
- clauses,
428
- scope: "once",
429
- widen: { anchorCount: 3 },
430
- });
431
- assert.equal(
432
- stepsFor({ verb: "organize", mode: "similar", scope: "once" }).includes(
433
- "properties",
434
- ),
435
- false,
436
- );
437
- assert.deepEqual(unreadableDraftClauses(similar), []);
438
- assert.equal(stepBlockedReason("rule", similar, UNCOUNTED), undefined);
439
- });
440
-
441
- it("holds a one-off apply again once the widen cannot be evaluated", () => {
414
+ it("holds a one-off apply with a clause the literal matcher cannot read", () => {
442
415
  const blocked = draft({
443
416
  clauses: [clause("HasWords", "boarding pass")],
444
417
  scope: "once",
445
- widen: { anchorCount: 3, inactive: true },
446
418
  });
419
+ assert.deepEqual(
420
+ unreadableDraftClauses(blocked).map((c) => c.field),
421
+ ["HasWords"],
422
+ );
447
423
  assert.equal(
448
424
  stepBlockedReason("rule", blocked, UNCOUNTED),
449
425
  ruleBlockedCopy.bodyTextOnce,
@@ -452,7 +428,7 @@ describe("stepBlockedReason", () => {
452
428
 
453
429
  it("refuses a standing rule the ticked-rows door built no predicate for", () => {
454
430
  // The ticked rows are a list of ids, not a predicate: a rule saved through
455
- // that door has no anchor and no clause, so it matches nothing now and
431
+ // that door has no clause, so it matches nothing now and
456
432
  // nothing later (#1193).
457
433
  const ticked = draft({ scope: "standing", name: "Receipts" });
458
434
  assert.equal(
@@ -473,7 +449,7 @@ describe("stepBlockedReason", () => {
473
449
  );
474
450
  });
475
451
 
476
- it("takes either matcher as the predicate a saved rule needs", () => {
452
+ it("takes a clause as the predicate a saved rule needs", () => {
477
453
  const named = { scope: "standing" as const, name: "Receipts" };
478
454
  assert.equal(
479
455
  stepBlockedReason(
@@ -483,23 +459,6 @@ describe("stepBlockedReason", () => {
483
459
  ),
484
460
  undefined,
485
461
  );
486
- assert.equal(
487
- stepBlockedReason(
488
- "review",
489
- draft({ ...named, widen: { anchorCount: 3 } }),
490
- { status: "ready", count: 3 },
491
- ),
492
- undefined,
493
- );
494
- // A widen the probe could not evaluate is no matcher at all.
495
- assert.equal(
496
- stepBlockedReason(
497
- "review",
498
- draft({ ...named, widen: { anchorCount: 3, inactive: true } }),
499
- { status: "ready", count: 3 },
500
- ),
501
- ruleBlockedCopy.noMatch,
502
- );
503
462
  });
504
463
 
505
464
  it("leaves the one-off scopes to the door that already resolved them", () => {
@@ -754,8 +713,7 @@ describe("runCopy", () => {
754
713
 
755
714
  describe("sample and door vocabulary", () => {
756
715
  it("explains an empty sample rather than leaving it bare", () => {
757
- assert.match(sampleEmptyCopy("noMatch"), /Nothing matches/);
758
- assert.match(sampleEmptyCopy("notIndexed"), /isn't indexed yet/);
716
+ assert.match(SAMPLE_EMPTY_COPY, /Nothing matches/);
759
717
  });
760
718
 
761
719
  it("states what an escalated predicate covers instead of a door", () => {
@@ -767,10 +725,10 @@ describe("sample and door vocabulary", () => {
767
725
  assert.match(ESCALATED_REVIEW_WARNING, /by the time it runs/);
768
726
  });
769
727
 
770
- it("withholds the widened doors where there is no single account", () => {
728
+ it("withholds the properties door where there is no single account", () => {
771
729
  assert.deepEqual(
772
730
  [...matchDoorsFor("acc-personal")],
773
- ["selected", "similar", "properties"],
731
+ ["selected", "properties"],
774
732
  );
775
733
  assert.deepEqual([...matchDoorsFor(undefined)], ["selected"]);
776
734
  assert.match(crossAccountMatchReason, /within one account/);
@@ -778,7 +736,6 @@ describe("sample and door vocabulary", () => {
778
736
 
779
737
  it("names each door and what it does", () => {
780
738
  assert.equal(matchDoorLabel("selected", 3), "These 3 messages");
781
- assert.equal(matchDoorLabel("similar", 3), "Similar to these 3");
782
739
  assert.equal(matchDoorLabel("properties", 3), "Its properties");
783
740
  assert.match(matchDoorHint("selected"), /ticked in the list/);
784
741
  assert.match(matchDoorHint("properties"), /No reading involved/);
@@ -832,15 +789,6 @@ describe("the match as words", () => {
832
789
  }),
833
790
  "These 4 messages",
834
791
  );
835
- assert.equal(
836
- matchSummary({
837
- mode: "similar",
838
- selectedCount: 4,
839
- clauses,
840
- matchOperator: "all",
841
- }),
842
- "Similar to these 4",
843
- );
844
792
  assert.equal(
845
793
  matchSummary({
846
794
  mode: "properties",
@@ -911,15 +859,6 @@ describe("the match as words", () => {
911
859
  }),
912
860
  "4 messages",
913
861
  );
914
- assert.equal(
915
- matchPhrase({
916
- mode: "similar",
917
- selectedCount: 4,
918
- clauses,
919
- matchOperator: "all",
920
- }),
921
- "mail similar to these 4",
922
- );
923
862
  assert.equal(
924
863
  matchPhrase({
925
864
  mode: "properties",
@@ -957,13 +896,13 @@ describe("the restriction a selection walks the wizard with", () => {
957
896
  });
958
897
 
959
898
  it("keeps the account a folder-spanning selection has", () => {
960
- // The widened doors are counted through a preview that account answers, so
961
- // there is nothing to withhold them for.
899
+ // The properties door is counted through a preview that account answers,
900
+ // so there is nothing to withhold it for.
962
901
  const scope = wizardScopeFor("acc-personal", "spansFolders");
963
902
  assert.equal(scope.accountId, "acc-personal");
964
903
  assert.deepEqual(
965
904
  [...matchDoorsFor(scope.accountId)],
966
- ["selected", "similar", "properties"],
905
+ ["selected", "properties"],
967
906
  );
968
907
  });
969
908
 
@@ -1011,7 +950,7 @@ describe("the restriction the rule step states", () => {
1011
950
  });
1012
951
 
1013
952
  it("restricts nothing on a door that can carry a predicate", () => {
1014
- for (const mode of ["selected", "similar", "properties"] as const) {
953
+ for (const mode of ["selected", "properties"] as const) {
1015
954
  assert.equal(ruleRestrictionFor(mode, unrestricted), undefined);
1016
955
  }
1017
956
  });