@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.
- package/package.json +14 -3
- package/src/components/DropdownMenu.tsx +100 -0
- package/src/components/EmptyState.tsx +11 -0
- package/src/components/ErrorBanner.render.test.ts +107 -0
- package/src/components/ErrorBanner.stories.tsx +132 -0
- package/src/components/ErrorBanner.tsx +122 -0
- package/src/components/ErrorBannerStack.tsx +34 -0
- package/src/components/ErrorState.render.test.ts +82 -0
- package/src/components/ErrorState.tsx +80 -0
- package/src/components/KeyboardShortcutsModal.tsx +111 -0
- package/src/components/account-service-change-dialog.render.test.ts +1 -41
- package/src/components/account-service-choice.render.test.ts +0 -26
- package/src/components/account-service-toggles.render.test.ts +0 -6
- package/src/components/address-display.render.test.ts +1 -38
- package/src/components/address-tag.render.test.ts +0 -11
- package/src/components/agenda-flow.reach.test.ts +0 -8
- package/src/components/agenda-flow.render.test.ts +0 -31
- package/src/components/agenda-panels.render.test.ts +0 -5
- package/src/components/app-shell-slotted.render.test.ts +0 -118
- package/src/components/attachment-list.render.test.ts +41 -24
- package/src/components/attachment-list.stories.tsx +67 -0
- package/src/components/attachment-list.tsx +112 -35
- package/src/components/attendee-row.render.test.ts +0 -41
- package/src/components/attention-dot.stories.tsx +46 -0
- package/src/components/attention-dot.tsx +23 -0
- package/src/components/banner.render.test.ts +0 -7
- package/src/components/bottom-sheet.render.test.ts +0 -42
- package/src/components/brief-section.render.test.ts +0 -13
- package/src/components/brief-sections.keyboard.test.ts +0 -13
- package/src/components/brief-sections.render.test.ts +0 -22
- package/src/components/calendar-clash-strip.render.test.ts +0 -19
- package/src/components/calendar-grid.render.test.ts +0 -79
- package/src/components/calendar-invite-card.render.test.ts +0 -19
- package/src/components/calendar-list.render.test.ts +0 -21
- package/src/components/calendar-slot-offers.render.test.ts +0 -24
- package/src/components/calendar-suggestion-deck.render.test.ts +0 -18
- package/src/components/calendar-toolbar.render.test.ts +1 -53
- package/src/components/category-badge.render.test.ts +1 -24
- package/src/components/compose-action-bar.render.test.ts +0 -5
- package/src/components/compose-attachments.render.test.ts +0 -38
- package/src/components/event-detail.render.test.ts +0 -27
- package/src/components/event-editor.render.test.ts +0 -4
- package/src/components/event-suggestion-card.render.test.ts +0 -61
- package/src/components/event-suggestion-card.zone-gate.test.ts +1 -7
- package/src/components/filter-clause-chip.tsx +1 -60
- package/src/components/filter-rule-editor.create.test.ts +0 -6
- package/src/components/filter-rule-editor.stories.tsx +24 -138
- package/src/components/filter-rule-editor.tsx +7 -93
- package/src/components/filter-rule.render.test.ts +9 -299
- package/src/components/filter-rule.ts +20 -85
- package/src/components/filter-sheet.render.test.ts +0 -7
- package/src/components/folder-manage-actions.render.test.ts +0 -13
- package/src/components/folder-manager.render.test.ts +0 -31
- package/src/components/folder-mutation-dialog.render.test.ts +0 -83
- package/src/components/folder-rename-dialog.render.test.ts +0 -14
- package/src/components/folder-row.render.test.ts +0 -30
- package/src/components/folder-sync-state.test.ts +0 -61
- package/src/components/folder-tree-picker.create.test.ts +0 -30
- package/src/components/folder-tree-picker.render.test.ts +0 -35
- package/src/components/intelligence-calendar-fixtures.ts +0 -2
- package/src/components/intelligence-calendar.render.test.ts +0 -4
- package/src/components/intelligence-panel.render.test.ts +1 -62
- package/src/components/intelligence-panel.stories.tsx +0 -76
- package/src/components/intelligence-panel.tab-strip.test.ts +0 -1
- package/src/components/intelligence-panel.tsx +6 -176
- package/src/components/intelligence-toggle.render.test.ts +0 -5
- package/src/components/isolated-email-frame.render.test.ts +0 -122
- package/src/components/isolated-email-frame.tsx +55 -3
- package/src/components/keyboard-hint-bar.render.test.ts +0 -7
- package/src/components/label-chip.render.test.ts +0 -28
- package/src/components/label-chip.tsx +1 -1
- package/src/components/mail-header.render.test.ts +0 -20
- package/src/components/mcp-connected-apps-page.stories.tsx +58 -0
- package/src/components/mcp-connected-apps-page.tsx +79 -0
- package/src/components/mcp-consent-page.stories.tsx +39 -0
- package/src/components/mcp-consent-page.tsx +47 -0
- package/src/components/mcp-device-page.stories.tsx +57 -0
- package/src/components/mcp-device-page.tsx +107 -0
- package/src/components/mcp-error-notice.stories.tsx +34 -0
- package/src/components/mcp-error-notice.tsx +23 -0
- package/src/components/mcp-error-page.stories.tsx +17 -0
- package/src/components/mcp-error-page.tsx +15 -0
- package/src/components/mcp-fixtures.ts +16 -0
- package/src/components/mcp-login-page.stories.tsx +37 -0
- package/src/components/mcp-login-page.tsx +58 -0
- package/src/components/mcp-page.stories.tsx +27 -0
- package/src/components/mcp-page.tsx +35 -0
- package/src/components/mcp-permission-list.stories.tsx +21 -0
- package/src/components/mcp-permission-list.tsx +22 -0
- package/src/components/message-body-view.render.test.ts +0 -21
- package/src/components/message-list-pane.brief-filter.test.ts +0 -6
- package/src/components/message-list-pane.render.test.ts +0 -54
- package/src/components/message-list-state.render.test.ts +0 -84
- package/src/components/{quarantine-bug-dialog.tsx → message-report-dialog.tsx} +9 -14
- package/src/components/message-row.render.test.ts +1 -98
- package/src/components/mobile-message-action-bar.render.test.ts +0 -59
- package/src/components/mobile-reading-pane.render.test.ts +0 -48
- package/src/components/mobile-reading-pane.stories.tsx +78 -0
- package/src/components/mobile-reading-pane.tsx +55 -41
- package/src/components/mobile-search-view.render.test.ts +0 -16
- package/src/components/mobile-search-view.stories.tsx +8 -11
- package/src/components/mobile-search-view.tsx +1 -1
- package/src/components/nav-sidebar.keyboard.test.ts +0 -8
- package/src/components/nav-sidebar.render.test.ts +2 -133
- package/src/components/new-folder-form.render.test.ts +0 -26
- package/src/components/outbox-row.render.test.ts +0 -9
- package/src/components/pane-layout.render.test.ts +0 -18
- package/src/components/plain-text-editor.mount.test.ts +0 -16
- package/src/components/popover-menu.render.test.ts +0 -11
- package/src/components/progress-bar.render.test.ts +0 -14
- package/src/components/quarantine-report.test.ts +0 -8
- package/src/components/quarantine-section.render.test.ts +16 -13
- package/src/components/quarantine-section.stories.tsx +11 -8
- package/src/components/reading-pane.render.test.ts +2 -106
- package/src/components/reading-pane.stories.tsx +3 -0
- package/src/components/refresh-button.render.test.ts +0 -9
- package/src/components/rescue-from-spam-flow.render.test.ts +0 -24
- package/src/components/rich-text-editor.mount.test.ts +0 -19
- package/src/components/rich-text-image-node.ts +11 -9
- package/src/components/role-appointment-list.render.test.ts +0 -49
- package/src/components/role-appointment-prompt.render.test.ts +0 -79
- package/src/components/row-actions.render.test.ts +0 -34
- package/src/components/search-bar.render.test.ts +0 -44
- package/src/components/search-chip-input.render.test.ts +0 -71
- package/src/components/search-conversion-notice.stories.tsx +0 -6
- package/src/components/search-conversion-notice.tsx +3 -9
- package/src/components/search-conversion.render.test.ts +0 -52
- package/src/components/search-conversion.ts +2 -18
- package/src/components/search-result-row.tsx +5 -26
- package/src/components/search-results.render.test.ts +0 -68
- package/src/components/search-results.stories.tsx +0 -30
- package/src/components/search-results.tsx +1 -1
- package/src/components/security-select.render.test.ts +1 -14
- package/src/components/selection-top-bar.render.test.ts +0 -180
- package/src/components/selection-wizard-fixtures.ts +0 -2
- package/src/components/selection-wizard.render.test.ts +7 -212
- package/src/components/selection-wizard.stories.tsx +24 -164
- package/src/components/selection-wizard.tsx +10 -86
- package/src/components/self-update.render.test.ts +0 -113
- package/src/components/sender-trust-indicator.render.test.ts +0 -30
- package/src/components/shell-top-bar.render.test.ts +0 -31
- package/src/components/shell-top-bar.stories.tsx +7 -0
- package/src/components/shell-top-bar.tsx +11 -2
- package/src/components/slide-panel.render.test.ts +0 -18
- package/src/components/suggest-list.render.test.ts +0 -6
- package/src/components/swipeable-row.gesture.test.ts +85 -40
- package/src/components/swipeable-row.render.test.ts +0 -7
- package/src/components/swipeable-row.stories.tsx +3 -2
- package/src/components/swipeable-row.tsx +65 -144
- package/src/components/sync-warning-fixtures.ts +22 -0
- package/src/components/sync-warning-report.ts +38 -0
- package/src/components/sync-warning-row.tsx +51 -0
- package/src/components/sync-warning-section.render.test.ts +19 -0
- package/src/components/sync-warning-section.stories.tsx +94 -0
- package/src/components/sync-warning-section.tsx +56 -0
- package/src/components/touch-list-body.render.test.ts +0 -29
- package/src/components/wizard.render.test.ts +0 -22
- package/src/filter-presets.test.ts +1 -107
- package/src/index.ts +40 -34
- package/src/lib/compose-language.test.ts +0 -11
- package/src/lib/email-render-treatment.test.ts +0 -21
- package/src/lib/keymap.test.ts +0 -32
- package/src/lib/property-prefill.ts +2 -2
- package/src/lib/search-rule.test.ts +0 -4
- package/src/lib/search-rule.ts +0 -9
- package/src/lib/sender-derivation.ts +3 -5
- package/src/lib/swipe-config.ts +11 -0
- package/src/lib/use-list-cursor.test.ts +0 -7
- package/src/lib/use-list-keyboard.test.ts +0 -14
- package/src/lib/use-long-press.test.ts +53 -36
- package/src/lib/use-long-press.ts +62 -56
- package/src/lib/use-modal-focus.test.ts +0 -20
- package/src/lib/use-selection.hook.test.ts +0 -13
- package/src/lib/use-selection.test.ts +0 -101
- package/src/lib/use-swipe-navigation.test.ts +162 -0
- package/src/lib/use-swipe-navigation.ts +90 -0
- package/src/lib/wizard-steps.test.ts +18 -79
- package/src/lib/wizard-steps.ts +27 -67
- package/src/mcp-pages.ts +36 -0
- package/src/category-presentation.test.ts +0 -76
- package/src/components/account-service-status.render.test.ts +0 -82
- package/src/components/app-password-hint.render.test.ts +0 -23
- package/src/components/app-top-bar.render.test.ts +0 -59
- package/src/components/auth-card.render.test.ts +0 -24
- package/src/components/auth-footer.render.test.ts +0 -17
- package/src/components/auth-hero.render.test.ts +0 -31
- package/src/components/auto-moved-badge.render.test.ts +0 -65
- package/src/components/button.render.test.ts +0 -29
- package/src/components/calendar-event-chip.render.test.ts +0 -67
- package/src/components/calendar-parse-badge.render.test.ts +0 -40
- package/src/components/checkbox.render.test.ts +0 -65
- package/src/components/compose-form-shell.render.test.ts +0 -106
- package/src/components/dialog.render.test.ts +0 -51
- package/src/components/field-label.render.test.ts +0 -16
- package/src/components/mail-action-toolbar.render.test.ts +0 -43
- package/src/components/nav-link-surface.render.test.ts +0 -126
- package/src/components/new-folder-action.render.test.ts +0 -44
- package/src/components/pane-header.render.test.ts +0 -22
- package/src/components/pull-to-refresh.render.test.ts +0 -46
- package/src/components/recurrence-scope-prompt.render.test.ts +0 -36
- package/src/components/rescue-banner.render.test.ts +0 -32
- package/src/components/rescue-candidate-row.render.test.ts +0 -68
- package/src/components/search-token-chip.render.test.ts +0 -42
- package/src/components/self-update-dot.tsx +0 -32
- package/src/components/settings-primitives.render.test.ts +0 -160
- package/src/lib/email-layout-clamp.test.ts +0 -139
- package/src/lib/label-color.test.ts +0 -25
- package/src/lib/semantic-off.ts +0 -20
- package/src/stories-viewport-globals.test.ts +0 -77
|
@@ -31,11 +31,6 @@ const row = (html: string, name: "actions" | "select-all"): string => {
|
|
|
31
31
|
return next === -1 ? rest : rest.slice(0, next);
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
const hasRow = (html: string, name: "actions" | "select-all"): boolean =>
|
|
35
|
-
html.includes(`data-selection-bar-row="${name}"`);
|
|
36
|
-
|
|
37
|
-
const INLINE_SELECT_ALL = /hidden shrink-0 pr-2 md:flex/;
|
|
38
|
-
|
|
39
34
|
const selectAll = { checked: false, onChange: () => undefined };
|
|
40
35
|
|
|
41
36
|
describe("SelectionTopBar", () => {
|
|
@@ -47,21 +42,6 @@ describe("SelectionTopBar", () => {
|
|
|
47
42
|
assert.doesNotMatch(text(html), /messages selected/);
|
|
48
43
|
});
|
|
49
44
|
|
|
50
|
-
it("carries the list header's own chrome while nothing is ticked", () => {
|
|
51
|
-
const html = renderToString(
|
|
52
|
-
createElement(SelectionTopBar, {
|
|
53
|
-
...handlers,
|
|
54
|
-
count: 0,
|
|
55
|
-
navSlot: createElement("button", { type: "button" }, "Menu"),
|
|
56
|
-
titleMeta: createElement("span", null, "12 unread"),
|
|
57
|
-
searchSlot: createElement("button", { type: "button" }, "Search"),
|
|
58
|
-
}),
|
|
59
|
-
);
|
|
60
|
-
assert.match(text(html), /Menu/);
|
|
61
|
-
assert.match(text(html), /12 unread/);
|
|
62
|
-
assert.match(text(html), /Search/);
|
|
63
|
-
});
|
|
64
|
-
|
|
65
45
|
it("hands the row to the count and the verbs from the first ticked row", () => {
|
|
66
46
|
const html = renderToString(
|
|
67
47
|
createElement(SelectionTopBar, {
|
|
@@ -77,18 +57,6 @@ describe("SelectionTopBar", () => {
|
|
|
77
57
|
assert.doesNotMatch(text(html), /Search/);
|
|
78
58
|
});
|
|
79
59
|
|
|
80
|
-
it("lets the expanded search field take the title's place while idle", () => {
|
|
81
|
-
const html = renderToString(
|
|
82
|
-
createElement(SelectionTopBar, {
|
|
83
|
-
...handlers,
|
|
84
|
-
count: 0,
|
|
85
|
-
searchField: createElement("input", { "aria-label": "Search mail" }),
|
|
86
|
-
}),
|
|
87
|
-
);
|
|
88
|
-
assert.match(html, /aria-label="Search mail"/);
|
|
89
|
-
assert.doesNotMatch(text(html), /Inbox/);
|
|
90
|
-
});
|
|
91
|
-
|
|
92
60
|
it("carries the make-filter row while nothing is ticked, and drops it once something is", () => {
|
|
93
61
|
const idleSlot = createElement("button", { type: "button" }, "Make filter");
|
|
94
62
|
assert.match(
|
|
@@ -109,28 +77,6 @@ describe("SelectionTopBar", () => {
|
|
|
109
77
|
);
|
|
110
78
|
});
|
|
111
79
|
|
|
112
|
-
it("keeps Junk and Mark read in the overflow menu, never as glyphs", () => {
|
|
113
|
-
const html = renderToString(
|
|
114
|
-
createElement(SelectionTopBar, {
|
|
115
|
-
...handlers,
|
|
116
|
-
count: 2,
|
|
117
|
-
onJunk: () => undefined,
|
|
118
|
-
onMarkRead: () => undefined,
|
|
119
|
-
}),
|
|
120
|
-
);
|
|
121
|
-
assert.match(html, /aria-label="More actions"/);
|
|
122
|
-
assert.doesNotMatch(row(html, "actions"), /aria-label="Junk"/);
|
|
123
|
-
assert.doesNotMatch(row(html, "actions"), /aria-label="Mark read"/);
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
it("replaces the title with the count from the first ticked row", () => {
|
|
127
|
-
const html = renderToString(
|
|
128
|
-
createElement(SelectionTopBar, { ...handlers, count: 1 }),
|
|
129
|
-
);
|
|
130
|
-
assert.match(text(html), /1 message selected/);
|
|
131
|
-
assert.doesNotMatch(text(html), /Inbox/);
|
|
132
|
-
});
|
|
133
|
-
|
|
134
80
|
it("renders plural copy for many messages", () => {
|
|
135
81
|
const html = renderToString(
|
|
136
82
|
createElement(SelectionTopBar, { ...handlers, count: 3 }),
|
|
@@ -164,48 +110,11 @@ describe("SelectionTopBar", () => {
|
|
|
164
110
|
assert.match(actions, /aria-label="Organize selected messages"/);
|
|
165
111
|
});
|
|
166
112
|
|
|
167
|
-
it("puts select-all on a second row, out of the way of the verbs", () => {
|
|
168
|
-
assert.ok(hasRow(html, "select-all"));
|
|
169
|
-
const secondRow = row(html, "select-all");
|
|
170
|
-
assert.match(secondRow, /Select all/);
|
|
171
|
-
assert.match(
|
|
172
|
-
secondRow,
|
|
173
|
-
/md:hidden/,
|
|
174
|
-
"the second row exists only below 768px",
|
|
175
|
-
);
|
|
176
|
-
assert.match(
|
|
177
|
-
row(html, "actions"),
|
|
178
|
-
INLINE_SELECT_ALL,
|
|
179
|
-
"the inline copy is the one that stands down below 768px",
|
|
180
|
-
);
|
|
181
|
-
});
|
|
182
|
-
|
|
183
113
|
it("offers a back arrow to leave selection", () => {
|
|
184
114
|
assert.match(row(html, "actions"), /aria-label="Cancel selection"/);
|
|
185
115
|
});
|
|
186
116
|
});
|
|
187
117
|
|
|
188
|
-
describe("at 1024px", () => {
|
|
189
|
-
it("keeps select-all inline in the bar with zero rows ticked", () => {
|
|
190
|
-
const html = renderToString(
|
|
191
|
-
createElement(SelectionTopBar, { ...handlers, count: 0, selectAll }),
|
|
192
|
-
);
|
|
193
|
-
const actions = row(html, "actions");
|
|
194
|
-
assert.match(actions, /Select all/);
|
|
195
|
-
assert.match(actions, INLINE_SELECT_ALL, "inline from 768px up");
|
|
196
|
-
assert.doesNotMatch(
|
|
197
|
-
actions,
|
|
198
|
-
/aria-label="Cancel selection"/,
|
|
199
|
-
"nothing to leave with nothing ticked",
|
|
200
|
-
);
|
|
201
|
-
assert.equal(
|
|
202
|
-
hasRow(html, "select-all"),
|
|
203
|
-
false,
|
|
204
|
-
"no second row when nothing is ticked",
|
|
205
|
-
);
|
|
206
|
-
});
|
|
207
|
-
});
|
|
208
|
-
|
|
209
118
|
it("renders Junk and Mark read in the overflow menu, not the verb row", () => {
|
|
210
119
|
const html = renderToString(
|
|
211
120
|
createElement(SelectionTopBar, {
|
|
@@ -263,18 +172,6 @@ describe("SelectionTopBar", () => {
|
|
|
263
172
|
assert.doesNotMatch(html, /aria-label="More actions"/);
|
|
264
173
|
});
|
|
265
174
|
|
|
266
|
-
it("renders the verbs at the 44px touch size", () => {
|
|
267
|
-
const html = renderToString(
|
|
268
|
-
createElement(SelectionTopBar, {
|
|
269
|
-
...handlers,
|
|
270
|
-
count: 2,
|
|
271
|
-
onOrganize: () => undefined,
|
|
272
|
-
}),
|
|
273
|
-
);
|
|
274
|
-
const buttonCount = (html.match(/h-11 w-11/g) ?? []).length;
|
|
275
|
-
assert.equal(buttonCount, 3, "back, delete and organize are all 44px");
|
|
276
|
-
});
|
|
277
|
-
|
|
278
175
|
it("hides the verbs while counting", () => {
|
|
279
176
|
const html = renderToString(
|
|
280
177
|
createElement(SelectionTopBar, {
|
|
@@ -288,18 +185,6 @@ describe("SelectionTopBar", () => {
|
|
|
288
185
|
assert.doesNotMatch(html, /aria-label="Organize selected messages"/);
|
|
289
186
|
});
|
|
290
187
|
|
|
291
|
-
it("renders statusLabel in place of the count copy when provided", () => {
|
|
292
|
-
const html = renderToString(
|
|
293
|
-
createElement(SelectionTopBar, {
|
|
294
|
-
...handlers,
|
|
295
|
-
count: 3412,
|
|
296
|
-
statusLabel: "Deleting 1,200 of 3,412…",
|
|
297
|
-
}),
|
|
298
|
-
);
|
|
299
|
-
assert.match(text(html), /Deleting 1,200 of 3,412…/);
|
|
300
|
-
assert.doesNotMatch(text(html), /3,412 messages selected/);
|
|
301
|
-
});
|
|
302
|
-
|
|
303
188
|
it("marks the count/status line as a polite live region", () => {
|
|
304
189
|
const html = renderToString(
|
|
305
190
|
createElement(SelectionTopBar, { ...handlers, count: 2 }),
|
|
@@ -310,13 +195,6 @@ describe("SelectionTopBar", () => {
|
|
|
310
195
|
);
|
|
311
196
|
});
|
|
312
197
|
|
|
313
|
-
it("omits the select-all control when selectAll is absent", () => {
|
|
314
|
-
const html = renderToString(
|
|
315
|
-
createElement(SelectionTopBar, { ...handlers, count: 2 }),
|
|
316
|
-
);
|
|
317
|
-
assert.doesNotMatch(text(html), /Select all/);
|
|
318
|
-
});
|
|
319
|
-
|
|
320
198
|
it("renders select-all unchecked in the some-selected state", () => {
|
|
321
199
|
const html = renderToString(
|
|
322
200
|
createElement(SelectionTopBar, {
|
|
@@ -364,33 +242,6 @@ describe("SelectionTopBar", () => {
|
|
|
364
242
|
assert.match(text(html), /All 47 loaded selected/);
|
|
365
243
|
});
|
|
366
244
|
|
|
367
|
-
it("lets statusLabel override the scoped default for an escalated selection", () => {
|
|
368
|
-
const html = renderToString(
|
|
369
|
-
createElement(SelectionTopBar, {
|
|
370
|
-
...handlers,
|
|
371
|
-
count: 3412,
|
|
372
|
-
selectAll: { checked: true, onChange: () => undefined },
|
|
373
|
-
statusLabel: 'All 3,412 matching "npm" selected',
|
|
374
|
-
}),
|
|
375
|
-
);
|
|
376
|
-
assert.match(text(html), /All 3,412 matching "npm" selected/);
|
|
377
|
-
});
|
|
378
|
-
|
|
379
|
-
it("renders the notice text and tone", () => {
|
|
380
|
-
const html = renderToString(
|
|
381
|
-
createElement(SelectionTopBar, {
|
|
382
|
-
...handlers,
|
|
383
|
-
count: 2,
|
|
384
|
-
notice: {
|
|
385
|
-
tone: "warning",
|
|
386
|
-
text: "Move only works within one account",
|
|
387
|
-
},
|
|
388
|
-
}),
|
|
389
|
-
);
|
|
390
|
-
assert.match(text(html), /Move only works within one account/);
|
|
391
|
-
assert.match(html, /role="status"/);
|
|
392
|
-
});
|
|
393
|
-
|
|
394
245
|
it("renders the notice's action as a real button, not prose", () => {
|
|
395
246
|
const html = renderToString(
|
|
396
247
|
createElement(SelectionTopBar, {
|
|
@@ -405,35 +256,4 @@ describe("SelectionTopBar", () => {
|
|
|
405
256
|
);
|
|
406
257
|
assert.match(html, /<button[^>]*>Retry 340<\/button>/);
|
|
407
258
|
});
|
|
408
|
-
|
|
409
|
-
it("omits the notice when absent", () => {
|
|
410
|
-
const html = renderToString(
|
|
411
|
-
createElement(SelectionTopBar, { ...handlers, count: 2 }),
|
|
412
|
-
);
|
|
413
|
-
// Only the count/status line carries role="status" — no second one for
|
|
414
|
-
// an absent notice.
|
|
415
|
-
const statusRoles = (html.match(/role="status"/g) ?? []).length;
|
|
416
|
-
assert.equal(statusRoles, 1);
|
|
417
|
-
});
|
|
418
|
-
|
|
419
|
-
it("renders a determinate progress bar when progress is provided", () => {
|
|
420
|
-
const html = renderToString(
|
|
421
|
-
createElement(SelectionTopBar, {
|
|
422
|
-
...handlers,
|
|
423
|
-
count: 3412,
|
|
424
|
-
statusLabel: "Deleting 1,200 of 3,412…",
|
|
425
|
-
isBusy: true,
|
|
426
|
-
progress: { value: 1200, max: 3412 },
|
|
427
|
-
}),
|
|
428
|
-
);
|
|
429
|
-
assert.match(html, /role="progressbar"/);
|
|
430
|
-
assert.match(html, /aria-valuenow="1200"/);
|
|
431
|
-
});
|
|
432
|
-
|
|
433
|
-
it("omits the progress bar when progress is absent", () => {
|
|
434
|
-
const html = renderToString(
|
|
435
|
-
createElement(SelectionTopBar, { ...handlers, count: 2 }),
|
|
436
|
-
);
|
|
437
|
-
assert.doesNotMatch(html, /role="progressbar"/);
|
|
438
|
-
});
|
|
439
259
|
});
|
|
@@ -323,7 +323,6 @@ export const RICH_CONVERSION: SearchConversion = {
|
|
|
323
323
|
{ type: "before", label: "Before 2026-01-01" },
|
|
324
324
|
],
|
|
325
325
|
keptTerms: true,
|
|
326
|
-
droppedSemantic: true,
|
|
327
326
|
};
|
|
328
327
|
|
|
329
328
|
export const PLAIN_CONVERSION: SearchConversion = {
|
|
@@ -331,5 +330,4 @@ export const PLAIN_CONVERSION: SearchConversion = {
|
|
|
331
330
|
matchOperator: "all",
|
|
332
331
|
droppedFacets: [],
|
|
333
332
|
keptTerms: true,
|
|
334
|
-
droppedSemantic: false,
|
|
335
333
|
};
|
|
@@ -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
|
|
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
|
|
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).
|
|
334
|
-
*
|
|
335
|
-
* walks the user to a review waiting on a count nobody can take, with Back the
|
|
336
|
-
* only way on.
|
|
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: "
|
|
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
|
() =>
|