@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
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Check } from "lucide-react";
|
|
2
|
+
import type { McpPermission } from "./mcp-page.js";
|
|
3
|
+
|
|
4
|
+
export interface McpPermissionListProps {
|
|
5
|
+
permissions: readonly McpPermission[];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function McpPermissionList({ permissions }: McpPermissionListProps) {
|
|
9
|
+
return (
|
|
10
|
+
<ul className="flex flex-col gap-2 text-sm">
|
|
11
|
+
{permissions.map((permission) => (
|
|
12
|
+
<li key={permission.scope} className="flex items-start gap-2 text-fg">
|
|
13
|
+
<Check
|
|
14
|
+
className="mt-0.5 size-4 shrink-0 text-positive"
|
|
15
|
+
aria-hidden="true"
|
|
16
|
+
/>
|
|
17
|
+
<span>{permission.description}</span>
|
|
18
|
+
</li>
|
|
19
|
+
))}
|
|
20
|
+
</ul>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -14,19 +14,6 @@ import { MessageBodyView } from "./message-body-view.js";
|
|
|
14
14
|
* Storybook stories.
|
|
15
15
|
*/
|
|
16
16
|
describe("MessageBodyView", () => {
|
|
17
|
-
it("renders the empty state when there is no html or text", () => {
|
|
18
|
-
const html = renderToString(createElement(MessageBodyView, {}));
|
|
19
|
-
assert.match(html, /This message has no body content\./);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it("renders plain text in a pre block (no sanitizer needed)", () => {
|
|
23
|
-
const html = renderToString(
|
|
24
|
-
createElement(MessageBodyView, { text: "Just a plain note." }),
|
|
25
|
-
);
|
|
26
|
-
assert.match(html, /Just a plain note\./);
|
|
27
|
-
assert.match(html, /email-text/);
|
|
28
|
-
});
|
|
29
|
-
|
|
30
17
|
it("does not emit raw email HTML without a DOM to sanitize it", () => {
|
|
31
18
|
// No DOM ⇒ cannot DOMPurify ⇒ the component must NOT paint the HTML.
|
|
32
19
|
const html = renderToString(
|
|
@@ -48,12 +35,4 @@ describe("MessageBodyView", () => {
|
|
|
48
35
|
assert.doesNotMatch(html, /html body/);
|
|
49
36
|
assert.match(html, /plain fallback/);
|
|
50
37
|
});
|
|
51
|
-
|
|
52
|
-
it("applies the message-body wrapper class", () => {
|
|
53
|
-
const html = renderToString(
|
|
54
|
-
createElement(MessageBodyView, { text: "x", className: "px-4" }),
|
|
55
|
-
);
|
|
56
|
-
assert.match(html, /message-body/);
|
|
57
|
-
assert.match(html, /px-4/);
|
|
58
|
-
});
|
|
59
38
|
});
|
|
@@ -140,12 +140,6 @@ describe("the brief's filter panel inside the message list pane", () => {
|
|
|
140
140
|
assert.equal(picked, "acc_work");
|
|
141
141
|
});
|
|
142
142
|
|
|
143
|
-
it("offers no source row without pills", () => {
|
|
144
|
-
mount();
|
|
145
|
-
openPanel();
|
|
146
|
-
assert.doesNotMatch(container.textContent ?? "", /Work/);
|
|
147
|
-
});
|
|
148
|
-
|
|
149
143
|
it("draws the chips the caller holds and reports a toggle", () => {
|
|
150
144
|
let toggled: string | undefined;
|
|
151
145
|
mount({
|
|
@@ -40,15 +40,6 @@ const baseProps = {
|
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
describe("MessageListPane", () => {
|
|
43
|
-
it("renders the list title and the rows", () => {
|
|
44
|
-
const html = renderToString(
|
|
45
|
-
createElement(MessageListPane, { ...baseProps, isDesktop: true }),
|
|
46
|
-
);
|
|
47
|
-
assert.match(html, /Inbox/);
|
|
48
|
-
assert.match(html, /Q3 planning notes/);
|
|
49
|
-
assert.match(html, /Your invoice is ready/);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
43
|
it("shows the pull-to-refresh affordance on the narrow touch list", () => {
|
|
53
44
|
const html = renderToString(
|
|
54
45
|
createElement(MessageListPane, {
|
|
@@ -60,31 +51,6 @@ describe("MessageListPane", () => {
|
|
|
60
51
|
assert.match(html, /Pull to refresh/);
|
|
61
52
|
});
|
|
62
53
|
|
|
63
|
-
it("omits the pull-to-refresh affordance on the desktop list", () => {
|
|
64
|
-
const html = renderToString(
|
|
65
|
-
createElement(MessageListPane, { ...baseProps, isDesktop: true }),
|
|
66
|
-
);
|
|
67
|
-
assert.doesNotMatch(html, /Pull to refresh/);
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
it("renders the listBody slot instead of built-in rows when provided", () => {
|
|
71
|
-
const html = renderToString(
|
|
72
|
-
createElement(MessageListPane, {
|
|
73
|
-
...baseProps,
|
|
74
|
-
isDesktop: true,
|
|
75
|
-
listBody: createElement(
|
|
76
|
-
"div",
|
|
77
|
-
{ "data-testid": "custom-body" },
|
|
78
|
-
"virtualized rows here",
|
|
79
|
-
),
|
|
80
|
-
}),
|
|
81
|
-
);
|
|
82
|
-
// Custom body is rendered
|
|
83
|
-
assert.match(html, /virtualized rows here/);
|
|
84
|
-
// Built-in rows are NOT rendered when listBody is provided
|
|
85
|
-
assert.doesNotMatch(html, /Q3 planning notes/);
|
|
86
|
-
});
|
|
87
|
-
|
|
88
54
|
it("honors the listBody slot on the touch path so mobile rows stay real anchors", () => {
|
|
89
55
|
const html = renderToString(
|
|
90
56
|
createElement(MessageListPane, {
|
|
@@ -165,24 +131,4 @@ describe("MessageListPane", () => {
|
|
|
165
131
|
assert.match(html, /aria-label="Deselect message"/);
|
|
166
132
|
assert.match(html, /aria-label="Select message"/);
|
|
167
133
|
});
|
|
168
|
-
|
|
169
|
-
it("offers no checkbox at all when the consumer holds no selection", () => {
|
|
170
|
-
const html = renderToString(
|
|
171
|
-
createElement(MessageListPane, { ...baseProps, isDesktop: true }),
|
|
172
|
-
);
|
|
173
|
-
assert.doesNotMatch(html, /aria-label="Select message"/);
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
it("renders the selectionBar slot instead of the pane header when provided", () => {
|
|
177
|
-
const html = renderToString(
|
|
178
|
-
createElement(MessageListPane, {
|
|
179
|
-
...baseProps,
|
|
180
|
-
isDesktop: true,
|
|
181
|
-
selectionBar: createElement("div", null, "2 selected"),
|
|
182
|
-
}),
|
|
183
|
-
);
|
|
184
|
-
assert.match(html, /2 selected/);
|
|
185
|
-
// The mailbox title header is NOT rendered when selectionBar is provided
|
|
186
|
-
assert.doesNotMatch(html, /Inbox/);
|
|
187
|
-
});
|
|
188
134
|
});
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
MessageListLoading,
|
|
11
11
|
MessageListLoadingMore,
|
|
12
12
|
} from "./message-list-state.js";
|
|
13
|
-
import { EmptyStateComparison } from "./message-list-state.stories.js";
|
|
14
13
|
|
|
15
14
|
const COMPLETENESS = "Every message in this folder was checked.";
|
|
16
15
|
const BOUNDED = "Only the messages loaded so far were checked.";
|
|
@@ -28,11 +27,6 @@ const personal: MessageListFilter = {
|
|
|
28
27
|
describe("MessageListLoading", () => {
|
|
29
28
|
const html = renderToString(createElement(MessageListLoading));
|
|
30
29
|
|
|
31
|
-
it("renders eight skeleton rows", () => {
|
|
32
|
-
const rows = html.match(/animate-pulse/g) ?? [];
|
|
33
|
-
assert.equal(rows.length, 8, "eight pulse rows, like the live skeleton");
|
|
34
|
-
});
|
|
35
|
-
|
|
36
30
|
it("marks the region busy for assistive tech", () => {
|
|
37
31
|
assert.match(html, /aria-busy="true"/);
|
|
38
32
|
});
|
|
@@ -76,12 +70,6 @@ describe("MessageListEmpty under a filter", () => {
|
|
|
76
70
|
assert.match(html, new RegExp(COMPLETENESS));
|
|
77
71
|
});
|
|
78
72
|
|
|
79
|
-
it("keeps the completeness sentence without a scope label", () => {
|
|
80
|
-
const html = empty({ filter: personal });
|
|
81
|
-
assert.match(html, /No Personal mail/);
|
|
82
|
-
assert.match(html, new RegExp(COMPLETENESS));
|
|
83
|
-
});
|
|
84
|
-
|
|
85
73
|
it("carries a completeness sentence in every filtered variant", () => {
|
|
86
74
|
const variants: MessageListEmptyProps[] = [
|
|
87
75
|
{ filter: personal },
|
|
@@ -110,16 +98,6 @@ describe("MessageListEmpty under a filter", () => {
|
|
|
110
98
|
);
|
|
111
99
|
});
|
|
112
100
|
|
|
113
|
-
it("renders the two reaches distinguishably", () => {
|
|
114
|
-
const whole = empty({ filter: personal, scopeLabel: "Inbox" });
|
|
115
|
-
const bounded = empty({
|
|
116
|
-
filter: { ...personal, reach: "loaded-pages" },
|
|
117
|
-
scopeLabel: "Inbox",
|
|
118
|
-
});
|
|
119
|
-
assert.notEqual(whole, bounded);
|
|
120
|
-
assert.doesNotMatch(whole, new RegExp(BOUNDED));
|
|
121
|
-
});
|
|
122
|
-
|
|
123
101
|
it("leads with the query when searching inside a filter", () => {
|
|
124
102
|
const html = empty({
|
|
125
103
|
filter: personal,
|
|
@@ -152,58 +130,15 @@ describe("MessageListEmpty under a filter", () => {
|
|
|
152
130
|
assert.doesNotMatch(filtered, /No messages in this mailbox/);
|
|
153
131
|
assert.doesNotMatch(unfiltered, /Clear filter/);
|
|
154
132
|
});
|
|
155
|
-
|
|
156
|
-
it("renders distinguishably from the skeleton a restarted page shows", () => {
|
|
157
|
-
const filtered = empty({ filter: personal, scopeLabel: "Inbox" });
|
|
158
|
-
const loading = renderToString(createElement(MessageListLoading));
|
|
159
|
-
assert.notEqual(filtered, loading);
|
|
160
|
-
assert.doesNotMatch(filtered, /animate-pulse/);
|
|
161
|
-
assert.doesNotMatch(loading, new RegExp(COMPLETENESS));
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
it("renders unclassified as itself, never as personal (#45)", () => {
|
|
165
|
-
const unclassified = empty({
|
|
166
|
-
filter: { ...personal, label: "Unclassified mail" },
|
|
167
|
-
scopeLabel: "Inbox",
|
|
168
|
-
});
|
|
169
|
-
assert.match(unclassified, /No Unclassified mail in Inbox/);
|
|
170
|
-
assert.doesNotMatch(unclassified, /Personal/);
|
|
171
|
-
});
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
describe("the side-by-side comparison story", () => {
|
|
175
|
-
const html = renderToString(createElement(EmptyStateComparison));
|
|
176
|
-
|
|
177
|
-
it("renders both empty states, not one", () => {
|
|
178
|
-
assert.match(html, /No messages in this mailbox/);
|
|
179
|
-
assert.match(html, /No Personal mail in Inbox/);
|
|
180
|
-
assert.match(html, new RegExp(COMPLETENESS));
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
it("gives neither panel a fixed width, so a frame cannot clip one away", () => {
|
|
184
|
-
assert.doesNotMatch(html, /\bw-9\d\b/);
|
|
185
|
-
assert.equal((html.match(/flex-1/g) ?? []).length >= 2, true);
|
|
186
|
-
});
|
|
187
133
|
});
|
|
188
134
|
|
|
189
135
|
describe("MessageListLoadingMore", () => {
|
|
190
136
|
const html = renderToString(createElement(MessageListLoadingMore));
|
|
191
137
|
|
|
192
|
-
it("says another page is coming in words, not only a spinner", () => {
|
|
193
|
-
assert.match(html, /Loading more/);
|
|
194
|
-
});
|
|
195
|
-
|
|
196
138
|
it("announces itself to assistive tech", () => {
|
|
197
139
|
assert.match(html, /role="status"/);
|
|
198
140
|
assert.match(html, /aria-live="polite"/);
|
|
199
141
|
});
|
|
200
|
-
|
|
201
|
-
it("renders distinguishably from a filtered empty list", () => {
|
|
202
|
-
const filtered = empty({ filter: personal, scopeLabel: "Inbox" });
|
|
203
|
-
assert.notEqual(html, filtered);
|
|
204
|
-
assert.doesNotMatch(html, new RegExp(COMPLETENESS));
|
|
205
|
-
assert.doesNotMatch(filtered, /Loading more/);
|
|
206
|
-
});
|
|
207
142
|
});
|
|
208
143
|
|
|
209
144
|
describe("MessageListError", () => {
|
|
@@ -216,29 +151,10 @@ describe("MessageListError", () => {
|
|
|
216
151
|
assert.match(html, /Network unreachable/);
|
|
217
152
|
});
|
|
218
153
|
|
|
219
|
-
it("offers a way back and a report path when handlers are given", () => {
|
|
220
|
-
const html = renderToString(
|
|
221
|
-
createElement(MessageListError, {
|
|
222
|
-
onRetry: () => {},
|
|
223
|
-
onReport: () => {},
|
|
224
|
-
}),
|
|
225
|
-
);
|
|
226
|
-
assert.match(html, /Retry/);
|
|
227
|
-
assert.match(html, /Report a problem/);
|
|
228
|
-
});
|
|
229
|
-
|
|
230
154
|
it("never renders a disabled control", () => {
|
|
231
155
|
const html = renderToString(
|
|
232
156
|
createElement(MessageListError, { onRetry: () => {} }),
|
|
233
157
|
);
|
|
234
158
|
assert.doesNotMatch(html, /\sdisabled[\s=>]/);
|
|
235
159
|
});
|
|
236
|
-
|
|
237
|
-
it("reads as a failure, never as an empty result", () => {
|
|
238
|
-
const html = renderToString(
|
|
239
|
-
createElement(MessageListError, { message: "Network unreachable" }),
|
|
240
|
-
);
|
|
241
|
-
assert.doesNotMatch(html, new RegExp(COMPLETENESS));
|
|
242
|
-
assert.doesNotMatch(html, /No messages/);
|
|
243
|
-
});
|
|
244
160
|
});
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { Copy, ExternalLink } from "lucide-react";
|
|
2
2
|
import { Button, ButtonLink } from "./button.js";
|
|
3
3
|
import { Dialog } from "./dialog.js";
|
|
4
|
-
import {
|
|
5
|
-
formatQuarantineReport,
|
|
6
|
-
type QuarantineEntry,
|
|
7
|
-
} from "./quarantine-report.js";
|
|
8
4
|
|
|
9
|
-
export interface
|
|
10
|
-
|
|
5
|
+
export interface MessageReportDialogProps {
|
|
6
|
+
report: string | null;
|
|
11
7
|
onClose: () => void;
|
|
12
8
|
/**
|
|
13
9
|
* Prefilled new-issue URL, built by the app's shared bug-report helper so
|
|
@@ -22,14 +18,13 @@ export interface QuarantineBugDialogProps {
|
|
|
22
18
|
* GitHub session with the issue prefilled — Remit never posts on their behalf,
|
|
23
19
|
* and nothing is sent that is not on this screen.
|
|
24
20
|
*/
|
|
25
|
-
export function
|
|
26
|
-
|
|
21
|
+
export function MessageReportDialog({
|
|
22
|
+
report,
|
|
27
23
|
onClose,
|
|
28
24
|
issueUrl,
|
|
29
25
|
onCopy,
|
|
30
|
-
}:
|
|
31
|
-
if (
|
|
32
|
-
const report = formatQuarantineReport(entry);
|
|
26
|
+
}: MessageReportDialogProps) {
|
|
27
|
+
if (report === null) return null;
|
|
33
28
|
|
|
34
29
|
return (
|
|
35
30
|
<Dialog open onClose={onClose} title="Report this message">
|
|
@@ -37,9 +32,9 @@ export function QuarantineBugDialog({
|
|
|
37
32
|
<header className="space-y-1 border-b border-line px-4 py-3">
|
|
38
33
|
<h3 className="text-sm font-semibold text-fg">Report this message</h3>
|
|
39
34
|
<p className="text-xs text-fg-muted">
|
|
40
|
-
This is everything the report contains. It describes
|
|
41
|
-
the message — never its contents, addresses, subject,
|
|
42
|
-
names, or the parser's own error text.
|
|
35
|
+
This is everything the report contains. It describes what went wrong
|
|
36
|
+
with the message — never its contents, addresses, subject,
|
|
37
|
+
attachment names, folder name, or the parser's own error text.
|
|
43
38
|
</p>
|
|
44
39
|
</header>
|
|
45
40
|
<pre className="flex-1 overflow-auto bg-surface-sunken px-4 py-3 text-2xs leading-relaxed whitespace-pre-wrap text-fg-muted">
|
|
@@ -2,9 +2,8 @@ import assert from "node:assert/strict";
|
|
|
2
2
|
import { describe, it } from "node:test";
|
|
3
3
|
import { createElement } from "react";
|
|
4
4
|
import { renderToString } from "react-dom/server";
|
|
5
|
-
import { categoryTone } from "../category-presentation.js";
|
|
6
5
|
import type { ThreadRowData } from "./app-shell-types.js";
|
|
7
|
-
import { ComfortableRow
|
|
6
|
+
import { ComfortableRow } from "./message-row.js";
|
|
8
7
|
|
|
9
8
|
const base: ThreadRowData = {
|
|
10
9
|
id: "t1",
|
|
@@ -16,52 +15,6 @@ const base: ThreadRowData = {
|
|
|
16
15
|
timeLabel: "9:42",
|
|
17
16
|
};
|
|
18
17
|
|
|
19
|
-
describe("ComfortableRow", () => {
|
|
20
|
-
it("renders fromName, subject and snippet", () => {
|
|
21
|
-
const html = renderToString(
|
|
22
|
-
createElement(ComfortableRow, { thread: { ...base, isRead: true } }),
|
|
23
|
-
);
|
|
24
|
-
assert.match(html, /Alex Rivera/);
|
|
25
|
-
assert.match(html, /Q3 planning notes/);
|
|
26
|
-
assert.match(html, /Pushed the deck/);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it("renders unread styling differently from read", () => {
|
|
30
|
-
const unread = renderToString(
|
|
31
|
-
createElement(ComfortableRow, { thread: { ...base, isRead: false } }),
|
|
32
|
-
);
|
|
33
|
-
const read = renderToString(
|
|
34
|
-
createElement(ComfortableRow, { thread: { ...base, isRead: true } }),
|
|
35
|
-
);
|
|
36
|
-
assert.notEqual(unread, read);
|
|
37
|
-
assert.match(unread, /font-semibold/);
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
it("renders a chip for every label applied to the message (issue #26)", () => {
|
|
41
|
-
const html = renderToString(
|
|
42
|
-
createElement(ComfortableRow, {
|
|
43
|
-
thread: {
|
|
44
|
-
...base,
|
|
45
|
-
isRead: true,
|
|
46
|
-
labels: [
|
|
47
|
-
{ labelId: "l1", name: "Receipts", color: "Blue" },
|
|
48
|
-
{ labelId: "l2", name: "Travel", color: "Green" },
|
|
49
|
-
],
|
|
50
|
-
},
|
|
51
|
-
}),
|
|
52
|
-
);
|
|
53
|
-
assert.match(html, /Receipts/);
|
|
54
|
-
assert.match(html, /Travel/);
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it("renders no label chip when the message carries none", () => {
|
|
58
|
-
const html = renderToString(
|
|
59
|
-
createElement(ComfortableRow, { thread: { ...base, isRead: true } }),
|
|
60
|
-
);
|
|
61
|
-
assert.doesNotMatch(html, /Remove label/);
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
|
|
65
18
|
describe("ComfortableRow category presentation", () => {
|
|
66
19
|
const render = (category: ThreadRowData["category"]): string =>
|
|
67
20
|
renderToString(
|
|
@@ -76,10 +29,6 @@ describe("ComfortableRow category presentation", () => {
|
|
|
76
29
|
/class="([^"]*rounded-full px-2 py-0\.5 text-2xs font-medium[^"]*)"/,
|
|
77
30
|
)?.[1];
|
|
78
31
|
|
|
79
|
-
it("renders no category badge for personal", () => {
|
|
80
|
-
assert.equal(badgeClass(render("personal")), undefined);
|
|
81
|
-
});
|
|
82
|
-
|
|
83
32
|
it("renders uncategorized as neither personal nor nothing (#45)", () => {
|
|
84
33
|
const uncategorized = render("uncategorized");
|
|
85
34
|
assert.notEqual(uncategorized, render("personal"));
|
|
@@ -89,29 +38,9 @@ describe("ComfortableRow category presentation", () => {
|
|
|
89
38
|
);
|
|
90
39
|
assert.match(uncategorized, /uncategorized|unclassified/i);
|
|
91
40
|
});
|
|
92
|
-
|
|
93
|
-
it("keeps the uncategorized badge off personal's tone (#45)", () => {
|
|
94
|
-
assert.notEqual(
|
|
95
|
-
categoryTone.uncategorized,
|
|
96
|
-
categoryTone.personal,
|
|
97
|
-
"the tone table must not give unclassified mail personal's colour",
|
|
98
|
-
);
|
|
99
|
-
assert.doesNotMatch(
|
|
100
|
-
badgeClass(render("uncategorized")) ?? "",
|
|
101
|
-
/accent/,
|
|
102
|
-
"the row badge must not render personal's accent tone",
|
|
103
|
-
);
|
|
104
|
-
});
|
|
105
41
|
});
|
|
106
42
|
|
|
107
43
|
describe("ComfortableRow selection slot", () => {
|
|
108
|
-
it("renders no checkbox without a selection (non-selectable mode)", () => {
|
|
109
|
-
const html = renderToString(
|
|
110
|
-
createElement(ComfortableRow, { thread: { ...base, isRead: true } }),
|
|
111
|
-
);
|
|
112
|
-
assert.doesNotMatch(html, /Select message/);
|
|
113
|
-
});
|
|
114
|
-
|
|
115
44
|
it("renders a checkbox reflecting the checked state", () => {
|
|
116
45
|
const unchecked = renderToString(
|
|
117
46
|
createElement(ComfortableRow, {
|
|
@@ -130,16 +59,6 @@ describe("ComfortableRow selection slot", () => {
|
|
|
130
59
|
});
|
|
131
60
|
});
|
|
132
61
|
|
|
133
|
-
describe("CompactRow", () => {
|
|
134
|
-
it("renders fromName and subject", () => {
|
|
135
|
-
const html = renderToString(
|
|
136
|
-
createElement(CompactRow, { thread: { ...base, isRead: true } }),
|
|
137
|
-
);
|
|
138
|
-
assert.match(html, /Alex Rivera/);
|
|
139
|
-
assert.match(html, /Q3 planning notes/);
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
|
|
143
62
|
describe("attachment indicator", () => {
|
|
144
63
|
// A list row cannot download anything — the file lives on the message, which
|
|
145
64
|
// is one pane over. So the paperclip here is metadata and says so, rather
|
|
@@ -153,20 +72,4 @@ describe("attachment indicator", () => {
|
|
|
153
72
|
assert.match(html, /role="img"/);
|
|
154
73
|
assert.match(html, /aria-label="Has an attachment"/);
|
|
155
74
|
});
|
|
156
|
-
|
|
157
|
-
it("marks a compact row as carrying an attachment", () => {
|
|
158
|
-
const html = renderToString(
|
|
159
|
-
createElement(CompactRow, {
|
|
160
|
-
thread: { ...base, isRead: true, hasAttachment: true },
|
|
161
|
-
}),
|
|
162
|
-
);
|
|
163
|
-
assert.match(html, /aria-label="Has an attachment"/);
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
it("renders no indicator when the message carries nothing", () => {
|
|
167
|
-
const html = renderToString(
|
|
168
|
-
createElement(ComfortableRow, { thread: { ...base, isRead: true } }),
|
|
169
|
-
);
|
|
170
|
-
assert.doesNotMatch(html, /Has an attachment/);
|
|
171
|
-
});
|
|
172
75
|
});
|
|
@@ -19,22 +19,6 @@ const countMatches = (html: string, needle: string) =>
|
|
|
19
19
|
html.split(needle).length - 1;
|
|
20
20
|
|
|
21
21
|
describe("MobileMessageActionBar", () => {
|
|
22
|
-
it("renders exactly one star and one trash, and no archive (IMAP has no archive)", () => {
|
|
23
|
-
const html = renderToString(
|
|
24
|
-
createElement(MobileMessageActionBar, {
|
|
25
|
-
...base,
|
|
26
|
-
moveSlot: createElement("button", {
|
|
27
|
-
type: "button",
|
|
28
|
-
"aria-label": "Move to folder",
|
|
29
|
-
}),
|
|
30
|
-
}),
|
|
31
|
-
);
|
|
32
|
-
assert.equal(countMatches(html, 'aria-label="Star"'), 1);
|
|
33
|
-
assert.equal(countMatches(html, 'aria-label="Move to folder"'), 1);
|
|
34
|
-
assert.equal(countMatches(html, 'aria-label="Move to Trash"'), 1);
|
|
35
|
-
assert.doesNotMatch(html, /aria-label="Archive"/);
|
|
36
|
-
});
|
|
37
|
-
|
|
38
22
|
it("flips the star label when starred", () => {
|
|
39
23
|
const html = renderToString(
|
|
40
24
|
createElement(MobileMessageActionBar, { ...base, isStarred: true }),
|
|
@@ -43,19 +27,6 @@ describe("MobileMessageActionBar", () => {
|
|
|
43
27
|
assert.match(html, /aria-pressed="true"/);
|
|
44
28
|
});
|
|
45
29
|
|
|
46
|
-
it("renders the move slot the caller supplies", () => {
|
|
47
|
-
const html = renderToString(
|
|
48
|
-
createElement(MobileMessageActionBar, {
|
|
49
|
-
...base,
|
|
50
|
-
moveSlot: createElement("button", {
|
|
51
|
-
type: "button",
|
|
52
|
-
"aria-label": "Move to folder",
|
|
53
|
-
}),
|
|
54
|
-
}),
|
|
55
|
-
);
|
|
56
|
-
assert.match(html, /aria-label="Move to folder"/);
|
|
57
|
-
});
|
|
58
|
-
|
|
59
30
|
it("shows the overflow trigger when a mark-read handler is present", () => {
|
|
60
31
|
const html = renderToString(
|
|
61
32
|
createElement(MobileMessageActionBar, {
|
|
@@ -71,14 +42,6 @@ describe("MobileMessageActionBar", () => {
|
|
|
71
42
|
assert.doesNotMatch(html, /aria-label="More actions"/);
|
|
72
43
|
});
|
|
73
44
|
|
|
74
|
-
it("renders the per-message reply verbs and no intelligence toggle", () => {
|
|
75
|
-
const html = renderToString(createElement(MobileMessageActionBar, base));
|
|
76
|
-
assert.equal(countMatches(html, 'aria-label="Reply"'), 1);
|
|
77
|
-
assert.equal(countMatches(html, 'aria-label="Reply all"'), 1);
|
|
78
|
-
assert.equal(countMatches(html, 'aria-label="Forward"'), 1);
|
|
79
|
-
assert.doesNotMatch(html, /intelligence panel/);
|
|
80
|
-
});
|
|
81
|
-
|
|
82
45
|
it("drops a verb the host supplies no handler for", () => {
|
|
83
46
|
const html = renderToString(
|
|
84
47
|
createElement(MobileMessageActionBar, {
|
|
@@ -111,26 +74,4 @@ describe("MobileMessageActionBar", () => {
|
|
|
111
74
|
assert.equal(countMatches(html, 'aria-label="Forward"'), 1);
|
|
112
75
|
assert.doesNotMatch(html, /disabled=""/);
|
|
113
76
|
});
|
|
114
|
-
|
|
115
|
-
it("drops an unhandled verb with no message open too", () => {
|
|
116
|
-
const html = renderToString(
|
|
117
|
-
createElement(MobileMessageActionBar, {
|
|
118
|
-
hasThread: false,
|
|
119
|
-
onReply: () => undefined,
|
|
120
|
-
}),
|
|
121
|
-
);
|
|
122
|
-
assert.equal(countMatches(html, 'aria-label="Reply"'), 1);
|
|
123
|
-
assert.doesNotMatch(html, /aria-label="Reply all"/);
|
|
124
|
-
assert.doesNotMatch(html, /aria-label="Forward"/);
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
it("surfaces the unavailable hint when no message is open", () => {
|
|
128
|
-
const html = renderToString(
|
|
129
|
-
createElement(MobileMessageActionBar, {
|
|
130
|
-
hasThread: false,
|
|
131
|
-
unavailableHint: "Open a message first",
|
|
132
|
-
}),
|
|
133
|
-
);
|
|
134
|
-
assert.match(html, /Open a message first/);
|
|
135
|
-
});
|
|
136
77
|
});
|
|
@@ -3,7 +3,6 @@ import { describe, it } from "node:test";
|
|
|
3
3
|
import { createElement } from "react";
|
|
4
4
|
import { renderToString } from "react-dom/server";
|
|
5
5
|
import type { ThreadData } from "./app-shell-types.js";
|
|
6
|
-
import type { IntelligenceData } from "./intelligence-panel.js";
|
|
7
6
|
import { MobileReadingPane } from "./mobile-reading-pane.js";
|
|
8
7
|
|
|
9
8
|
const thread: ThreadData = {
|
|
@@ -40,46 +39,10 @@ const thread: ThreadData = {
|
|
|
40
39
|
],
|
|
41
40
|
};
|
|
42
41
|
|
|
43
|
-
const intelligence: IntelligenceData = {
|
|
44
|
-
sender: {
|
|
45
|
-
name: "Alex Rivera",
|
|
46
|
-
email: "alex@example.com",
|
|
47
|
-
trust: "wellknown",
|
|
48
|
-
firstSeenLabel: "Jan 2025",
|
|
49
|
-
},
|
|
50
|
-
authenticity: {
|
|
51
|
-
verdict: "aligned",
|
|
52
|
-
fromDomain: "example.com",
|
|
53
|
-
summary: "Verified.",
|
|
54
|
-
},
|
|
55
|
-
category: { value: "personal" },
|
|
56
|
-
similar: [],
|
|
57
|
-
};
|
|
58
|
-
|
|
59
42
|
const countMatches = (html: string, needle: string) =>
|
|
60
43
|
html.split(needle).length - 1;
|
|
61
44
|
|
|
62
45
|
describe("MobileReadingPane", () => {
|
|
63
|
-
it("renders the top bar with back, subject and the intelligence toggle", () => {
|
|
64
|
-
const html = renderToString(
|
|
65
|
-
createElement(MobileReadingPane, {
|
|
66
|
-
thread,
|
|
67
|
-
intelligence,
|
|
68
|
-
onBack: () => undefined,
|
|
69
|
-
}),
|
|
70
|
-
);
|
|
71
|
-
assert.match(html, /aria-label="Back to messages"/);
|
|
72
|
-
assert.match(html, /Q3 planning notes/);
|
|
73
|
-
assert.match(html, /aria-label="Show intelligence panel"/);
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
it("omits the intelligence toggle when no intelligence is given", () => {
|
|
77
|
-
const html = renderToString(
|
|
78
|
-
createElement(MobileReadingPane, { thread, onBack: () => undefined }),
|
|
79
|
-
);
|
|
80
|
-
assert.doesNotMatch(html, /aria-label="Show intelligence panel"/);
|
|
81
|
-
});
|
|
82
|
-
|
|
83
46
|
it("shows exactly one per-message action bar — the expanded message's", () => {
|
|
84
47
|
const html = renderToString(
|
|
85
48
|
createElement(MobileReadingPane, {
|
|
@@ -113,15 +76,4 @@ describe("MobileReadingPane", () => {
|
|
|
113
76
|
assert.match(html, /title="Reply"/);
|
|
114
77
|
assert.doesNotMatch(html, /title="Reply \(r\)"/);
|
|
115
78
|
});
|
|
116
|
-
|
|
117
|
-
it("keeps pinch-zoom enabled on the scroll area when swipe handlers are set", () => {
|
|
118
|
-
const html = renderToString(
|
|
119
|
-
createElement(MobileReadingPane, {
|
|
120
|
-
thread,
|
|
121
|
-
onBack: () => undefined,
|
|
122
|
-
touchHandlers: { onTouchStart: () => undefined },
|
|
123
|
-
}),
|
|
124
|
-
);
|
|
125
|
-
assert.match(html, /touch-action:\s*pan-y pinch-zoom/);
|
|
126
|
-
});
|
|
127
79
|
});
|