@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.
- package/package.json +12 -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 +1 -1
- 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-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 +0 -15
- package/src/components/swipeable-row.render.test.ts +0 -7
- 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 -30
- 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/use-list-cursor.test.ts +0 -7
- package/src/lib/use-list-keyboard.test.ts +0 -14
- 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/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,51 @@
|
|
|
1
|
+
import { Bug } from "lucide-react";
|
|
2
|
+
import { Badge } from "./badge.js";
|
|
3
|
+
import { Button } from "./button.js";
|
|
4
|
+
import {
|
|
5
|
+
type SyncWarningEntry,
|
|
6
|
+
syncWarningSummary,
|
|
7
|
+
} from "./sync-warning-report.js";
|
|
8
|
+
|
|
9
|
+
export interface SyncWarningRowProps {
|
|
10
|
+
entry: SyncWarningEntry;
|
|
11
|
+
onReport: (entry: SyncWarningEntry) => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function formatCreatedAt(epochMillis: number): string {
|
|
15
|
+
return new Date(epochMillis).toLocaleString(undefined, {
|
|
16
|
+
dateStyle: "medium",
|
|
17
|
+
timeStyle: "short",
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function SyncWarningRow({ entry, onReport }: SyncWarningRowProps) {
|
|
22
|
+
const gaveUp = entry.state === "GaveUp";
|
|
23
|
+
return (
|
|
24
|
+
<li className="flex flex-col gap-2 border-b border-line px-row-inset py-3 last:border-b-0 sm:flex-row sm:items-start sm:justify-between">
|
|
25
|
+
<div className="min-w-0 space-y-1">
|
|
26
|
+
<p className="text-sm text-fg">{syncWarningSummary(entry)}</p>
|
|
27
|
+
<p className="flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs text-fg-subtle">
|
|
28
|
+
<Badge tone={gaveUp ? "danger" : "warning"}>
|
|
29
|
+
{gaveUp ? "Gave up" : "Retrying"}
|
|
30
|
+
</Badge>
|
|
31
|
+
<span className="truncate">{entry.folderLabel}</span>
|
|
32
|
+
<span aria-hidden>·</span>
|
|
33
|
+
<span>{`uid ${entry.uid}`}</span>
|
|
34
|
+
<span aria-hidden>·</span>
|
|
35
|
+
<span>{`since ${formatCreatedAt(entry.createdAt)}`}</span>
|
|
36
|
+
<span aria-hidden>·</span>
|
|
37
|
+
<span>{`${entry.attempts} attempts`}</span>
|
|
38
|
+
</p>
|
|
39
|
+
</div>
|
|
40
|
+
<Button
|
|
41
|
+
variant="secondary"
|
|
42
|
+
size="sm"
|
|
43
|
+
className="shrink-0"
|
|
44
|
+
icon={<Bug className="size-3.5" />}
|
|
45
|
+
onClick={() => onReport(entry)}
|
|
46
|
+
>
|
|
47
|
+
Cut a bug
|
|
48
|
+
</Button>
|
|
49
|
+
</li>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { describe, it } from "node:test";
|
|
3
|
+
import { createElement } from "react";
|
|
4
|
+
import { renderToString } from "react-dom/server";
|
|
5
|
+
import { syncWarningDemoEntries } from "./sync-warning-fixtures.js";
|
|
6
|
+
import { SyncWarningSection } from "./sync-warning-section.js";
|
|
7
|
+
|
|
8
|
+
describe("SyncWarningSection", () => {
|
|
9
|
+
it("states the total when the list is capped", () => {
|
|
10
|
+
const html = renderToString(
|
|
11
|
+
createElement(SyncWarningSection, {
|
|
12
|
+
entries: syncWarningDemoEntries,
|
|
13
|
+
total: 4812,
|
|
14
|
+
onReport: () => {},
|
|
15
|
+
}),
|
|
16
|
+
);
|
|
17
|
+
assert.match(html, /Showing the 2 newest of 4812/);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { MessageReportDialog } from "./message-report-dialog.js";
|
|
4
|
+
import { syncWarningDemoEntries } from "./sync-warning-fixtures.js";
|
|
5
|
+
import {
|
|
6
|
+
formatSyncWarningReport,
|
|
7
|
+
type SyncWarningEntry,
|
|
8
|
+
} from "./sync-warning-report.js";
|
|
9
|
+
import { SyncWarningRow } from "./sync-warning-row.js";
|
|
10
|
+
import { SyncWarningSection } from "./sync-warning-section.js";
|
|
11
|
+
|
|
12
|
+
const [gaveUp, retrying] = syncWarningDemoEntries;
|
|
13
|
+
|
|
14
|
+
const demoIssueUrl = "https://github.com/remit-mail/reader/issues/new";
|
|
15
|
+
|
|
16
|
+
const meta: Meta<typeof SyncWarningSection> = {
|
|
17
|
+
title: "Design System/Settings/Sync warnings",
|
|
18
|
+
component: SyncWarningSection,
|
|
19
|
+
parameters: { layout: "padded" },
|
|
20
|
+
args: { onReport: () => {} },
|
|
21
|
+
decorators: [
|
|
22
|
+
(Story) => (
|
|
23
|
+
<div className="mx-auto max-w-2xl">
|
|
24
|
+
<Story />
|
|
25
|
+
</div>
|
|
26
|
+
),
|
|
27
|
+
],
|
|
28
|
+
};
|
|
29
|
+
export default meta;
|
|
30
|
+
|
|
31
|
+
type Story = StoryObj<typeof SyncWarningSection>;
|
|
32
|
+
|
|
33
|
+
export const Empty: Story = {
|
|
34
|
+
args: { entries: [], total: 0 },
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const Mixed: Story = {
|
|
38
|
+
args: {
|
|
39
|
+
entries: syncWarningDemoEntries,
|
|
40
|
+
total: syncWarningDemoEntries.length,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const OverCap: Story = {
|
|
45
|
+
args: { entries: syncWarningDemoEntries, total: 4_812 },
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const GaveUpRow: Story = {
|
|
49
|
+
render: () => (
|
|
50
|
+
<ul className="rounded-sm border border-line bg-surface">
|
|
51
|
+
<SyncWarningRow entry={gaveUp} onReport={() => {}} />
|
|
52
|
+
</ul>
|
|
53
|
+
),
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const RetryingRow: Story = {
|
|
57
|
+
render: () => (
|
|
58
|
+
<ul className="rounded-sm border border-line bg-surface">
|
|
59
|
+
<SyncWarningRow entry={retrying} onReport={() => {}} />
|
|
60
|
+
</ul>
|
|
61
|
+
),
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const ReportFlow: Story = {
|
|
65
|
+
render: () => {
|
|
66
|
+
const [open, setOpen] = useState<SyncWarningEntry | null>(null);
|
|
67
|
+
return (
|
|
68
|
+
<>
|
|
69
|
+
<SyncWarningSection
|
|
70
|
+
entries={syncWarningDemoEntries}
|
|
71
|
+
total={syncWarningDemoEntries.length}
|
|
72
|
+
onReport={setOpen}
|
|
73
|
+
/>
|
|
74
|
+
<MessageReportDialog
|
|
75
|
+
report={open ? formatSyncWarningReport(open) : null}
|
|
76
|
+
issueUrl={demoIssueUrl}
|
|
77
|
+
onClose={() => setOpen(null)}
|
|
78
|
+
onCopy={() => setOpen(null)}
|
|
79
|
+
/>
|
|
80
|
+
</>
|
|
81
|
+
);
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const Report: Story = {
|
|
86
|
+
render: () => (
|
|
87
|
+
<MessageReportDialog
|
|
88
|
+
report={formatSyncWarningReport(gaveUp)}
|
|
89
|
+
issueUrl={demoIssueUrl}
|
|
90
|
+
onClose={() => {}}
|
|
91
|
+
onCopy={() => {}}
|
|
92
|
+
/>
|
|
93
|
+
),
|
|
94
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { CheckCircle2 } from "lucide-react";
|
|
2
|
+
import type { SyncWarningEntry } from "./sync-warning-report.js";
|
|
3
|
+
import { SyncWarningRow } from "./sync-warning-row.js";
|
|
4
|
+
|
|
5
|
+
export interface SyncWarningSectionProps {
|
|
6
|
+
entries: readonly SyncWarningEntry[];
|
|
7
|
+
total: number;
|
|
8
|
+
onReport: (entry: SyncWarningEntry) => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function SyncWarningSection({
|
|
12
|
+
entries,
|
|
13
|
+
total,
|
|
14
|
+
onReport,
|
|
15
|
+
}: SyncWarningSectionProps) {
|
|
16
|
+
return (
|
|
17
|
+
<section className="space-y-3">
|
|
18
|
+
<header className="space-y-1">
|
|
19
|
+
<h2 className="text-sm font-semibold text-fg">
|
|
20
|
+
Messages that failed to sync
|
|
21
|
+
</h2>
|
|
22
|
+
<p className="text-xs text-fg-muted">
|
|
23
|
+
A message shows here after three failed rounds and leaves on its own
|
|
24
|
+
once it syncs. The rest of the folder keeps syncing.
|
|
25
|
+
</p>
|
|
26
|
+
</header>
|
|
27
|
+
|
|
28
|
+
{entries.length === 0 && (
|
|
29
|
+
<div className="flex items-center gap-2 rounded-sm border border-line bg-surface px-row-inset py-3">
|
|
30
|
+
<CheckCircle2 className="size-4 shrink-0 text-positive" aria-hidden />
|
|
31
|
+
<p className="text-sm text-fg-muted">
|
|
32
|
+
Every message is syncing. Nothing has failed.
|
|
33
|
+
</p>
|
|
34
|
+
</div>
|
|
35
|
+
)}
|
|
36
|
+
|
|
37
|
+
{total > entries.length && (
|
|
38
|
+
<p className="text-xs text-fg-muted">
|
|
39
|
+
{`Showing the ${entries.length} newest of ${total} messages that failed to sync.`}
|
|
40
|
+
</p>
|
|
41
|
+
)}
|
|
42
|
+
|
|
43
|
+
{entries.length > 0 && (
|
|
44
|
+
<ul className="rounded-sm border border-line bg-surface">
|
|
45
|
+
{entries.map((entry) => (
|
|
46
|
+
<SyncWarningRow
|
|
47
|
+
key={entry.syncWarningId}
|
|
48
|
+
entry={entry}
|
|
49
|
+
onReport={onReport}
|
|
50
|
+
/>
|
|
51
|
+
))}
|
|
52
|
+
</ul>
|
|
53
|
+
)}
|
|
54
|
+
</section>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
@@ -46,12 +46,6 @@ const baseProps = {
|
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
describe("TouchListBody", () => {
|
|
49
|
-
it("renders the rows", () => {
|
|
50
|
-
const html = renderToString(createElement(TouchListBody, baseProps));
|
|
51
|
-
assert.match(html, /Priya Nair/);
|
|
52
|
-
assert.match(html, /Alex Rivera/);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
49
|
it("shows the refreshing affordance when refreshing", () => {
|
|
56
50
|
const html = renderToString(
|
|
57
51
|
createElement(TouchListBody, { ...baseProps, refreshing: true }),
|
|
@@ -59,33 +53,10 @@ describe("TouchListBody", () => {
|
|
|
59
53
|
assert.match(html, /Checking for new mail/);
|
|
60
54
|
});
|
|
61
55
|
|
|
62
|
-
it("shows pull to refresh when idle and not in selection mode", () => {
|
|
63
|
-
const html = renderToString(createElement(TouchListBody, baseProps));
|
|
64
|
-
assert.match(html, /Pull to refresh/);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it("dims and suppresses taps on every row while busy", () => {
|
|
68
|
-
const html = renderToString(
|
|
69
|
-
createElement(TouchListBody, {
|
|
70
|
-
...baseProps,
|
|
71
|
-
selectionMode: true,
|
|
72
|
-
checkedIds: new Set(["t1", "t2"]),
|
|
73
|
-
busy: true,
|
|
74
|
-
}),
|
|
75
|
-
);
|
|
76
|
-
const dimmed = (html.match(/pointer-events-none opacity-50/g) ?? []).length;
|
|
77
|
-
assert.equal(dimmed, 2, "both seeded rows are dimmed");
|
|
78
|
-
});
|
|
79
|
-
|
|
80
56
|
it("hides pull to refresh while busy", () => {
|
|
81
57
|
const html = renderToString(
|
|
82
58
|
createElement(TouchListBody, { ...baseProps, busy: true }),
|
|
83
59
|
);
|
|
84
60
|
assert.doesNotMatch(html, /Pull to refresh/);
|
|
85
61
|
});
|
|
86
|
-
|
|
87
|
-
it("renders rows undimmed when not busy", () => {
|
|
88
|
-
const html = renderToString(createElement(TouchListBody, baseProps));
|
|
89
|
-
assert.doesNotMatch(html, /pointer-events-none/);
|
|
90
|
-
});
|
|
91
62
|
});
|
|
@@ -24,26 +24,4 @@ describe("ConnectorTile coming-soon", () => {
|
|
|
24
24
|
);
|
|
25
25
|
assert.match(html, /<button/, "tile is a pressable button");
|
|
26
26
|
});
|
|
27
|
-
|
|
28
|
-
it("renders a comingSoon tile without a handler as a safe no-op", () => {
|
|
29
|
-
assert.doesNotThrow(() =>
|
|
30
|
-
markup({
|
|
31
|
-
name: "Gmail",
|
|
32
|
-
description: "Sign in with Google.",
|
|
33
|
-
icon: null,
|
|
34
|
-
comingSoon: true,
|
|
35
|
-
}),
|
|
36
|
-
);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it("renders a normal tile without coming-soon affordances", () => {
|
|
40
|
-
const html = markup({
|
|
41
|
-
name: "IMAP / SMTP",
|
|
42
|
-
description: "Any provider.",
|
|
43
|
-
icon: null,
|
|
44
|
-
onSelect: () => undefined,
|
|
45
|
-
});
|
|
46
|
-
assert.doesNotMatch(html, /aria-disabled/);
|
|
47
|
-
assert.doesNotMatch(html, />soon</);
|
|
48
|
-
});
|
|
49
27
|
});
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import { describe, it } from "node:test";
|
|
3
|
-
import {
|
|
4
|
-
briefFilterConfig,
|
|
5
|
-
type FilterAccount,
|
|
6
|
-
flaggedFilterConfig,
|
|
7
|
-
inboxFilterConfig,
|
|
8
|
-
} from "./filter-presets.js";
|
|
3
|
+
import { briefFilterConfig, type FilterAccount } from "./filter-presets.js";
|
|
9
4
|
|
|
10
5
|
const accounts: FilterAccount[] = [
|
|
11
6
|
{ id: "all", label: "All", active: true },
|
|
@@ -14,31 +9,6 @@ const accounts: FilterAccount[] = [
|
|
|
14
9
|
];
|
|
15
10
|
|
|
16
11
|
describe("briefFilterConfig", () => {
|
|
17
|
-
it("offers the message categories with a leading All", () => {
|
|
18
|
-
const { categories } = briefFilterConfig();
|
|
19
|
-
assert.equal(categories[0]?.id, "all");
|
|
20
|
-
assert.deepEqual(
|
|
21
|
-
categories.map((c) => c.id),
|
|
22
|
-
[
|
|
23
|
-
"all",
|
|
24
|
-
"personal",
|
|
25
|
-
"uncategorized",
|
|
26
|
-
"transactional",
|
|
27
|
-
"newsletter",
|
|
28
|
-
"marketing",
|
|
29
|
-
"social",
|
|
30
|
-
"automated",
|
|
31
|
-
],
|
|
32
|
-
);
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it("offers the BriefSections chip set", () => {
|
|
36
|
-
assert.deepEqual(
|
|
37
|
-
briefFilterConfig().filters.map((f) => f.id),
|
|
38
|
-
["unread", "attachment", "contacts", "today"],
|
|
39
|
-
);
|
|
40
|
-
});
|
|
41
|
-
|
|
42
12
|
it("includes the accounts source group when more than one account", () => {
|
|
43
13
|
const { sources } = briefFilterConfig(accounts);
|
|
44
14
|
assert.deepEqual(
|
|
@@ -52,79 +22,3 @@ describe("briefFilterConfig", () => {
|
|
|
52
22
|
assert.equal(briefFilterConfig().sources, undefined);
|
|
53
23
|
});
|
|
54
24
|
});
|
|
55
|
-
|
|
56
|
-
describe("inboxFilterConfig", () => {
|
|
57
|
-
it("offers the same message categories as the brief", () => {
|
|
58
|
-
assert.deepEqual(
|
|
59
|
-
inboxFilterConfig().categories.map((c) => c.id),
|
|
60
|
-
briefFilterConfig().categories.map((c) => c.id),
|
|
61
|
-
);
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
it("adds Has attachment to Unread and Starred", () => {
|
|
65
|
-
assert.deepEqual(
|
|
66
|
-
inboxFilterConfig().filters.map((f) => f.id),
|
|
67
|
-
["unread", "flagged", "attachment"],
|
|
68
|
-
);
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
it("labels the IMAP \\Flagged filter 'Starred'", () => {
|
|
72
|
-
assert.deepEqual(
|
|
73
|
-
inboxFilterConfig().filters.map((f) => f.label),
|
|
74
|
-
["Unread", "Starred", "Has attachment"],
|
|
75
|
-
);
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
it("never offers an accounts source group", () => {
|
|
79
|
-
assert.equal(inboxFilterConfig().sources, undefined);
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
describe("flaggedFilterConfig", () => {
|
|
84
|
-
it("offers the same message categories as the brief", () => {
|
|
85
|
-
assert.deepEqual(
|
|
86
|
-
flaggedFilterConfig().categories.map((c) => c.id),
|
|
87
|
-
briefFilterConfig().categories.map((c) => c.id),
|
|
88
|
-
);
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
it("offers Unread and Has attachment, never the redundant Flagged", () => {
|
|
92
|
-
assert.deepEqual(
|
|
93
|
-
flaggedFilterConfig().filters.map((f) => f.id),
|
|
94
|
-
["unread", "attachment"],
|
|
95
|
-
);
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
it("never offers an accounts source group", () => {
|
|
99
|
-
assert.equal(flaggedFilterConfig().sources, undefined);
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
describe("the Unclassified category", () => {
|
|
104
|
-
it("is offered by every shipped preset", () => {
|
|
105
|
-
for (const preset of [
|
|
106
|
-
briefFilterConfig(),
|
|
107
|
-
inboxFilterConfig(),
|
|
108
|
-
flaggedFilterConfig(),
|
|
109
|
-
]) {
|
|
110
|
-
assert.equal(
|
|
111
|
-
preset.categories.some((c) => c.id === "uncategorized"),
|
|
112
|
-
true,
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
it("follows Personal, the order the brief already uses", () => {
|
|
118
|
-
const ids = inboxFilterConfig().categories.map((c) => c.id);
|
|
119
|
-
assert.equal(ids.indexOf("uncategorized"), ids.indexOf("personal") + 1);
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
it("carries its own label and tone, never personal's (#45)", () => {
|
|
123
|
-
const categories = briefFilterConfig().categories;
|
|
124
|
-
const unclassified = categories.find((c) => c.id === "uncategorized");
|
|
125
|
-
const personal = categories.find((c) => c.id === "personal");
|
|
126
|
-
assert.equal(unclassified?.label, "Unclassified");
|
|
127
|
-
assert.notEqual(unclassified?.label, personal?.label);
|
|
128
|
-
assert.notEqual(unclassified?.tone, personal?.tone);
|
|
129
|
-
});
|
|
130
|
-
});
|
package/src/index.ts
CHANGED
|
@@ -100,6 +100,7 @@ export { AppTopBar, type AppTopBarProps } from "./components/app-top-bar.js";
|
|
|
100
100
|
export {
|
|
101
101
|
type AttachmentDownloadState,
|
|
102
102
|
type AttachmentItem,
|
|
103
|
+
type AttachmentKind,
|
|
103
104
|
AttachmentList,
|
|
104
105
|
type AttachmentListProps,
|
|
105
106
|
} from "./components/attachment-list.js";
|
|
@@ -111,6 +112,10 @@ export {
|
|
|
111
112
|
RsvpBadge,
|
|
112
113
|
type RsvpBadgeProps,
|
|
113
114
|
} from "./components/attendee-row.js";
|
|
115
|
+
export {
|
|
116
|
+
AttentionDot,
|
|
117
|
+
type AttentionDotProps,
|
|
118
|
+
} from "./components/attention-dot.js";
|
|
114
119
|
export { AuthCard, type AuthCardProps } from "./components/auth-card.js";
|
|
115
120
|
export {
|
|
116
121
|
AuthFooter,
|
|
@@ -305,6 +310,11 @@ export {
|
|
|
305
310
|
ConfirmDialog,
|
|
306
311
|
type ConfirmDialogProps,
|
|
307
312
|
} from "./components/confirm-dialog.js";
|
|
313
|
+
export {
|
|
314
|
+
DropdownMenu,
|
|
315
|
+
DropdownMenuItem,
|
|
316
|
+
DropdownMenuSeparator,
|
|
317
|
+
} from "./components/DropdownMenu.js";
|
|
308
318
|
export {
|
|
309
319
|
DangerZoneSection,
|
|
310
320
|
type DangerZoneSectionProps,
|
|
@@ -314,6 +324,15 @@ export {
|
|
|
314
324
|
DialogBackdrop,
|
|
315
325
|
type DialogBackdropProps,
|
|
316
326
|
} from "./components/dialog-backdrop.js";
|
|
327
|
+
export { EmptyState } from "./components/EmptyState.js";
|
|
328
|
+
export {
|
|
329
|
+
ErrorBanner,
|
|
330
|
+
type ErrorBannerAction,
|
|
331
|
+
type ErrorBannerEntry,
|
|
332
|
+
type ErrorBannerSeverity,
|
|
333
|
+
} from "./components/ErrorBanner.js";
|
|
334
|
+
export { ErrorBannerStack } from "./components/ErrorBannerStack.js";
|
|
335
|
+
export { ErrorState, formatErrorMessage } from "./components/ErrorState.js";
|
|
317
336
|
export type {
|
|
318
337
|
AuthorDeclarations,
|
|
319
338
|
EmailFrameVariant,
|
|
@@ -353,8 +372,6 @@ export {
|
|
|
353
372
|
type ClauseDraft,
|
|
354
373
|
ClauseEditor,
|
|
355
374
|
type ClauseEditorProps,
|
|
356
|
-
WidenChip,
|
|
357
|
-
type WidenChipProps,
|
|
358
375
|
} from "./components/filter-clause-chip.js";
|
|
359
376
|
export {
|
|
360
377
|
FilterPreviewCount,
|
|
@@ -375,27 +392,22 @@ export {
|
|
|
375
392
|
demoSubjectPrefillRule,
|
|
376
393
|
demoVocabularyRule,
|
|
377
394
|
type FilterRule,
|
|
378
|
-
hasActiveWiden,
|
|
379
395
|
hasMatcher,
|
|
380
396
|
type LabelOption,
|
|
381
397
|
type MatchOperator,
|
|
382
398
|
matchesBodyText,
|
|
383
399
|
matchJoinWord,
|
|
384
|
-
matchModeHint,
|
|
385
|
-
matchModeLabel,
|
|
386
400
|
matchOperatorLabel,
|
|
401
|
+
PROPERTIES_MATCH_HINT,
|
|
387
402
|
type PreviewCount,
|
|
388
403
|
previewCountSummary,
|
|
389
404
|
previewSettledReason,
|
|
390
405
|
type RuleClause,
|
|
391
|
-
type RuleMatchMode,
|
|
392
406
|
type RuleScope,
|
|
393
|
-
type RuleWiden,
|
|
394
407
|
ruleBlockedCopy,
|
|
395
408
|
scopeLabel,
|
|
396
409
|
UNCOUNTABLE_PREDICATE_REASON,
|
|
397
410
|
unreadableBodyClauses,
|
|
398
|
-
widenChipLabel,
|
|
399
411
|
} from "./components/filter-rule.js";
|
|
400
412
|
export {
|
|
401
413
|
type ClauseEditState,
|
|
@@ -487,14 +499,9 @@ export {
|
|
|
487
499
|
type IntelligencePanelProps,
|
|
488
500
|
type IntelligenceQuickActions,
|
|
489
501
|
type IntelligenceTabId,
|
|
490
|
-
type MatchedChunk,
|
|
491
502
|
type SenderFlagsIntel,
|
|
492
503
|
type SenderIntel,
|
|
493
504
|
type SenderTrustLevel,
|
|
494
|
-
type SimilarMessageIntel,
|
|
495
|
-
type SimilarMessageLinkComponent,
|
|
496
|
-
type SimilarMessageLinkProps,
|
|
497
|
-
type SimilarState,
|
|
498
505
|
} from "./components/intelligence-panel.js";
|
|
499
506
|
export { IntelligenceSection } from "./components/intelligence-section.js";
|
|
500
507
|
export {
|
|
@@ -506,6 +513,7 @@ export {
|
|
|
506
513
|
type IsolatedEmailFrameProps,
|
|
507
514
|
measureContentAxis,
|
|
508
515
|
} from "./components/isolated-email-frame.js";
|
|
516
|
+
export { KeyboardShortcutsModal } from "./components/KeyboardShortcutsModal.js";
|
|
509
517
|
export { Kbd, type KbdProps } from "./components/kbd.js";
|
|
510
518
|
export {
|
|
511
519
|
KeyboardHintBar,
|
|
@@ -547,6 +555,10 @@ export {
|
|
|
547
555
|
MessageListLoading,
|
|
548
556
|
MessageListLoadingMore,
|
|
549
557
|
} from "./components/message-list-state.js";
|
|
558
|
+
export {
|
|
559
|
+
MessageReportDialog,
|
|
560
|
+
type MessageReportDialogProps,
|
|
561
|
+
} from "./components/message-report-dialog.js";
|
|
550
562
|
export {
|
|
551
563
|
type BriefRowComponent,
|
|
552
564
|
ComfortableRow,
|
|
@@ -630,10 +642,6 @@ export {
|
|
|
630
642
|
PullToRefresh,
|
|
631
643
|
type PullToRefreshProps,
|
|
632
644
|
} from "./components/pull-to-refresh.js";
|
|
633
|
-
export {
|
|
634
|
-
QuarantineBugDialog,
|
|
635
|
-
type QuarantineBugDialogProps,
|
|
636
|
-
} from "./components/quarantine-bug-dialog.js";
|
|
637
645
|
export {
|
|
638
646
|
QuarantineEntryRow,
|
|
639
647
|
type QuarantineEntryRowProps,
|
|
@@ -745,7 +753,6 @@ export {
|
|
|
745
753
|
type SearchFieldSuggest,
|
|
746
754
|
} from "./components/search-chip-input.js";
|
|
747
755
|
export {
|
|
748
|
-
DROPPED_SEMANTIC_COPY,
|
|
749
756
|
droppedFacetsCopy,
|
|
750
757
|
hasConversionNotice,
|
|
751
758
|
makeFilterBlockedCopy,
|
|
@@ -841,10 +848,6 @@ export {
|
|
|
841
848
|
SelfUpdateConfirmDialog,
|
|
842
849
|
type SelfUpdateConfirmDialogProps,
|
|
843
850
|
} from "./components/self-update-confirm-dialog.js";
|
|
844
|
-
export {
|
|
845
|
-
UpdateAvailableDot,
|
|
846
|
-
type UpdateAvailableDotProps,
|
|
847
|
-
} from "./components/self-update-dot.js";
|
|
848
851
|
export {
|
|
849
852
|
SelfUpdateProgressOverlay,
|
|
850
853
|
type SelfUpdateProgressOverlayProps,
|
|
@@ -900,6 +903,20 @@ export {
|
|
|
900
903
|
SwipeableRow,
|
|
901
904
|
type SwipePeek,
|
|
902
905
|
} from "./components/swipeable-row.js";
|
|
906
|
+
export { syncWarningDemoEntries } from "./components/sync-warning-fixtures.js";
|
|
907
|
+
export {
|
|
908
|
+
formatSyncWarningReport,
|
|
909
|
+
type SyncWarningEntry,
|
|
910
|
+
syncWarningIssueTitle,
|
|
911
|
+
} from "./components/sync-warning-report.js";
|
|
912
|
+
export {
|
|
913
|
+
SyncWarningRow,
|
|
914
|
+
type SyncWarningRowProps,
|
|
915
|
+
} from "./components/sync-warning-row.js";
|
|
916
|
+
export {
|
|
917
|
+
SyncWarningSection,
|
|
918
|
+
type SyncWarningSectionProps,
|
|
919
|
+
} from "./components/sync-warning-section.js";
|
|
903
920
|
export { TouchListBody } from "./components/touch-list.js";
|
|
904
921
|
export {
|
|
905
922
|
CheckRow,
|
|
@@ -1130,12 +1147,6 @@ export {
|
|
|
1130
1147
|
type SearchConversion,
|
|
1131
1148
|
searchConversionNotice,
|
|
1132
1149
|
} from "./lib/search-rule.js";
|
|
1133
|
-
export {
|
|
1134
|
-
SEMANTIC_OFF_BUYS,
|
|
1135
|
-
SEMANTIC_OFF_COMMAND,
|
|
1136
|
-
SEMANTIC_OFF_TITLE,
|
|
1137
|
-
semanticOffReason,
|
|
1138
|
-
} from "./lib/semantic-off.js";
|
|
1139
1150
|
export {
|
|
1140
1151
|
collapsibleDomain,
|
|
1141
1152
|
deriveSenderClauses,
|
|
@@ -1213,10 +1224,9 @@ export {
|
|
|
1213
1224
|
type RunState,
|
|
1214
1225
|
ruleRestrictionFor,
|
|
1215
1226
|
runCopy,
|
|
1216
|
-
|
|
1227
|
+
SAMPLE_EMPTY_COPY,
|
|
1217
1228
|
type SelectionRestriction,
|
|
1218
1229
|
type StepId,
|
|
1219
|
-
sampleEmptyCopy,
|
|
1220
1230
|
stepBlockedReason,
|
|
1221
1231
|
stepIndex,
|
|
1222
1232
|
stepLabel,
|
|
@@ -108,12 +108,6 @@ describe("browserSpellcheckHelp", () => {
|
|
|
108
108
|
);
|
|
109
109
|
assert.match(help, /^On iPhone and iPad the keyboard/);
|
|
110
110
|
});
|
|
111
|
-
|
|
112
|
-
it("never claims the app changes the dictionary", () => {
|
|
113
|
-
for (const agent of ["Chrome/141", "Firefox/130", "Safari/605", "curl/8"]) {
|
|
114
|
-
assert.doesNotMatch(browserSpellcheckHelp(agent), /this app|we /i);
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
111
|
});
|
|
118
112
|
|
|
119
113
|
describe("wrapWithLanguage", () => {
|
|
@@ -182,11 +176,6 @@ describe("unwrapLanguage", () => {
|
|
|
182
176
|
});
|
|
183
177
|
|
|
184
178
|
describe("COMPOSE_LANGUAGE_OPTIONS", () => {
|
|
185
|
-
it("offers no tag twice", () => {
|
|
186
|
-
const tags = COMPOSE_LANGUAGE_OPTIONS.map((option) => option.tag);
|
|
187
|
-
assert.equal(new Set(tags).size, tags.length);
|
|
188
|
-
});
|
|
189
|
-
|
|
190
179
|
/**
|
|
191
180
|
* Read against `franc-min`'s own trigram tables rather than against the list
|
|
192
181
|
* that produced them: a code the detector has never heard of is a menu row
|
|
@@ -58,25 +58,4 @@ describe("classifyEmailRenderTreatment (#424)", () => {
|
|
|
58
58
|
);
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
|
-
|
|
62
|
-
test("framed and isPlain are always mutually exclusive", () => {
|
|
63
|
-
const cases: Array<
|
|
64
|
-
[Parameters<typeof classifyEmailRenderTreatment>[0], boolean]
|
|
65
|
-
> = [
|
|
66
|
-
["newsletter", false],
|
|
67
|
-
["marketing", true],
|
|
68
|
-
["personal", false],
|
|
69
|
-
["personal", true],
|
|
70
|
-
[undefined, false],
|
|
71
|
-
[undefined, true],
|
|
72
|
-
];
|
|
73
|
-
for (const [category, bg] of cases) {
|
|
74
|
-
const t = classifyEmailRenderTreatment(category, bg);
|
|
75
|
-
assert.notStrictEqual(
|
|
76
|
-
t.framed,
|
|
77
|
-
t.isPlain,
|
|
78
|
-
`framed and isPlain must differ for (${category}, ${bg})`,
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
61
|
});
|