@remit/web-client 0.0.307 → 0.0.308

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/web-client",
3
- "version": "0.0.307",
3
+ "version": "0.0.308",
4
4
  "type": "module",
5
5
  "description": "Remit web client, published as composable primitives — the app shell, auth shells, and runtime config. A distributor imports what it composes and bundles it.",
6
6
  "exports": {
@@ -621,10 +621,10 @@ export function StepPendingFolders({
621
621
  <WizardShell
622
622
  steps={IMPORT_STEPS}
623
623
  activeStep={3}
624
- title={folders.length > 0 ? "Waiting on folders" : "Import finished"}
624
+ title={folders.length > 0 ? "Creating folders" : "Import finished"}
625
625
  subtitle={
626
626
  folders.length > 0
627
- ? "The config names folders this server has not shown us yet."
627
+ ? "The config names folders this account does not have yet. Reader creates them on the mail server."
628
628
  : "Everything in the file landed, and every folder it named resolved."
629
629
  }
630
630
  footer={
@@ -642,10 +642,11 @@ export function StepPendingFolders({
642
642
  {folders.length > 0 ? (
643
643
  <>
644
644
  <Banner tone="warning">
645
- {folders.length} settings are imported but switched off. Each
646
- turns itself on the moment its folder appears — nothing was
647
- dropped. If a folder never appears, create it in your mail client,
648
- or edit the setting in Settings → Senders & Rules.
645
+ {folders.length} settings are imported but switched off. Reader
646
+ creates each missing folder on the mail server the next time the
647
+ account syncs, and turns the setting on once the server confirms
648
+ it. A rule whose folder cannot be created stays off, and Settings
649
+ → Filters says why.
649
650
  </Banner>
650
651
  <div className="flex items-center gap-2 text-xs text-fg-muted">
651
652
  <FolderClock className="size-4" />
@@ -47,6 +47,7 @@ const filterFixture = (
47
47
  name: "Receipts",
48
48
  scope: "Standing",
49
49
  state: "Active",
50
+ disabledReason: "None",
50
51
  hasAnchor: false,
51
52
  ruleChangedAt: 100,
52
53
  actionChangedAt: 100,
@@ -0,0 +1,36 @@
1
+ import assert from "node:assert/strict";
2
+ import { describe, it } from "node:test";
3
+ import React, { createElement } from "react";
4
+ import { renderToString } from "react-dom/server";
5
+ import { ApiError } from "@/lib/api";
6
+ import { FilterToggleError } from "./FilterToggleError";
7
+
8
+ (globalThis as { React?: typeof React }).React = React;
9
+
10
+ const render = (error: unknown) =>
11
+ renderToString(
12
+ createElement(FilterToggleError, {
13
+ enabling: true,
14
+ error,
15
+ onRetry: () => undefined,
16
+ reportHref: (message: string) =>
17
+ `https://example.test/new?body=${encodeURIComponent(message)}`,
18
+ }) as never,
19
+ );
20
+
21
+ describe("FilterToggleError (#1103)", () => {
22
+ it("shows a refusal with its fix and a report link, and no Retry", () => {
23
+ const html = render(new ApiError("Pick a folder in the rule.", 400));
24
+ assert.match(html, /Couldn(&#x27;|')t turn the filter on/);
25
+ assert.match(html, /Pick a folder in the rule\./);
26
+ assert.match(html, /Report an issue/);
27
+ assert.match(html, /example\.test\/new\?body=Pick/);
28
+ assert.doesNotMatch(html, />Retry</);
29
+ });
30
+
31
+ it("offers Retry when the server did not answer", () => {
32
+ const html = render(new ApiError("Unavailable", 503));
33
+ assert.match(html, />Retry</);
34
+ assert.match(html, /Report an issue/);
35
+ });
36
+ });
@@ -0,0 +1,40 @@
1
+ import type { Meta, StoryObj } from "@storybook/react-vite";
2
+ import { ApiError } from "@/lib/api";
3
+ import { FilterToggleError } from "./FilterToggleError";
4
+
5
+ const meta: Meta<typeof FilterToggleError> = {
6
+ title: "Playground/Shipped/Settings/Filters/FilterToggleError",
7
+ component: FilterToggleError,
8
+ parameters: { layout: "padded" },
9
+ decorators: [
10
+ (Story) => (
11
+ <div className="mx-auto max-w-md">
12
+ <Story />
13
+ </div>
14
+ ),
15
+ ],
16
+ args: {
17
+ onRetry: () => undefined,
18
+ reportHref: () => "https://github.com/remit-mail/reader/issues/new",
19
+ },
20
+ };
21
+ export default meta;
22
+
23
+ type Story = StoryObj<typeof FilterToggleError>;
24
+
25
+ export const RefusedWithoutFolder: Story = {
26
+ args: {
27
+ enabling: true,
28
+ error: new ApiError(
29
+ "This filter has no folder to move mail into yet. Wait for its folder to be created on the mail server, or pick a folder in the rule, then turn it on.",
30
+ 400,
31
+ ),
32
+ },
33
+ };
34
+
35
+ export const ServerUnavailable: Story = {
36
+ args: {
37
+ enabling: false,
38
+ error: new ApiError("The server did not answer.", 503),
39
+ },
40
+ };
@@ -0,0 +1,44 @@
1
+ import { ErrorState, formatErrorMessage } from "@/components/ui/ErrorState";
2
+ import { getErrorStatus } from "@/lib/error-classifier";
3
+
4
+ interface FilterToggleErrorProps {
5
+ enabling: boolean;
6
+ error: unknown;
7
+ onRetry: () => void;
8
+ reportHref: (message: string) => string;
9
+ }
10
+
11
+ const isRefusal = (error: unknown): boolean => {
12
+ const status = getErrorStatus(error);
13
+ return status !== undefined && status >= 400 && status < 500;
14
+ };
15
+
16
+ export function FilterToggleError({
17
+ enabling,
18
+ error,
19
+ onRetry,
20
+ reportHref,
21
+ }: FilterToggleErrorProps) {
22
+ return (
23
+ <div className="space-y-1">
24
+ <ErrorState
25
+ variant="inline"
26
+ title={
27
+ enabling
28
+ ? "Couldn't turn the filter on"
29
+ : "Couldn't turn the filter off"
30
+ }
31
+ error={error}
32
+ onRetry={isRefusal(error) ? undefined : onRetry}
33
+ />
34
+ <a
35
+ href={reportHref(formatErrorMessage(error))}
36
+ target="_blank"
37
+ rel="noreferrer"
38
+ className="text-xs text-accent hover:underline"
39
+ >
40
+ Report an issue
41
+ </a>
42
+ </div>
43
+ );
44
+ }
@@ -21,6 +21,7 @@ const filter = (
21
21
  name: "Travel",
22
22
  scope: "Standing",
23
23
  state: "Active",
24
+ disabledReason: "None",
24
25
  hasAnchor: true,
25
26
  ruleChangedAt: 0,
26
27
  actionChangedAt: 0,
@@ -45,6 +46,7 @@ const render = (
45
46
  labelById,
46
47
  onEdit: () => undefined,
47
48
  onDelete: () => undefined,
49
+ onToggle: () => undefined,
48
50
  semanticUnavailable,
49
51
  now: NOW,
50
52
  }) as never,
@@ -111,4 +113,44 @@ describe("FiltersList", () => {
111
113
  assert.match(html, /Expired/);
112
114
  assert.match(html, /expired/);
113
115
  });
116
+
117
+ it("offers to turn a running filter off", () => {
118
+ const html = render([filter({})]);
119
+ assert.match(html, /Turn off filter Travel/);
120
+ assert.doesNotMatch(html, /Disabled/);
121
+ });
122
+
123
+ const reasons = [
124
+ ["UserDisabled", /Turned off\./],
125
+ ["AwaitingFolder", /Off until its folder exists on the mail server/],
126
+ ["FolderCreateFailed", /refused to create its folder/],
127
+ ["FolderMissing", /no longer exists/],
128
+ ] as const;
129
+
130
+ it("drops the turns-on-by-itself copy once the user picked a folder", () => {
131
+ const html = render([
132
+ filter({
133
+ state: "Disabled",
134
+ disabledReason: "AwaitingFolder",
135
+ actionMailboxId: "mbx-travel",
136
+ }),
137
+ ]);
138
+ assert.doesNotMatch(html, /turns on by itself/);
139
+ assert.match(html, /Turned off\./);
140
+ });
141
+
142
+ for (const [reason, copy] of reasons) {
143
+ it(`marks a filter disabled for ${reason} with its reason and a way back on (#1103)`, () => {
144
+ const html = render([
145
+ filter({
146
+ state: "Disabled",
147
+ disabledReason: reason,
148
+ actionMailboxId: "None",
149
+ }),
150
+ ]);
151
+ assert.match(html, /Disabled/);
152
+ assert.match(html, copy);
153
+ assert.match(html, /Turn on filter Travel/);
154
+ });
155
+ }
114
156
  });
@@ -0,0 +1,89 @@
1
+ import type { RemitImapFilterResponse } from "@remit/api-http-client/types.gen.ts";
2
+ import type { Meta, StoryObj } from "@storybook/react-vite";
3
+ import { FiltersList } from "./FiltersList";
4
+
5
+ const NOW = Date.parse("2026-09-25T12:00:00Z");
6
+
7
+ const meta: Meta<typeof FiltersList> = {
8
+ title: "Playground/Shipped/Settings/Filters/FiltersList",
9
+ component: FiltersList,
10
+ parameters: { layout: "padded" },
11
+ decorators: [
12
+ (Story) => (
13
+ <div className="mx-auto max-w-md">
14
+ <Story />
15
+ </div>
16
+ ),
17
+ ],
18
+ args: {
19
+ mailboxName: (mailboxId: string) =>
20
+ mailboxId === "mbx-invoices" ? "Invoices" : undefined,
21
+ labelById: new Map(),
22
+ onEdit: () => undefined,
23
+ onDelete: () => undefined,
24
+ onToggle: () => undefined,
25
+ now: NOW,
26
+ },
27
+ };
28
+ export default meta;
29
+
30
+ type Story = StoryObj<typeof FiltersList>;
31
+
32
+ const makeFilter = (
33
+ overrides: Partial<RemitImapFilterResponse>,
34
+ ): RemitImapFilterResponse => ({
35
+ filterId: "flt-1",
36
+ accountConfigId: "acc-1",
37
+ name: "Invoices",
38
+ scope: "Standing",
39
+ state: "Active",
40
+ disabledReason: "None",
41
+ hasAnchor: false,
42
+ ruleChangedAt: 0,
43
+ actionChangedAt: 0,
44
+ matchOperator: "And",
45
+ literalClauses: [{ field: "From", value: "billing@example.com" }],
46
+ actionLabelId: "None",
47
+ actionMailboxId: "mbx-invoices",
48
+ createdAt: 0,
49
+ updatedAt: 0,
50
+ ...overrides,
51
+ });
52
+
53
+ const disabled = (
54
+ reason: RemitImapFilterResponse["disabledReason"],
55
+ overrides: Partial<RemitImapFilterResponse> = {},
56
+ ): RemitImapFilterResponse[] => [
57
+ makeFilter({ state: "Disabled", disabledReason: reason, ...overrides }),
58
+ ];
59
+
60
+ export const Active: Story = {
61
+ args: { filters: [makeFilter({})] },
62
+ };
63
+
64
+ export const TurnedOffByUser: Story = {
65
+ args: { filters: disabled("UserDisabled") },
66
+ };
67
+
68
+ export const AwaitingFolder: Story = {
69
+ args: { filters: disabled("AwaitingFolder", { actionMailboxId: "None" }) },
70
+ };
71
+
72
+ export const FolderCreateFailed: Story = {
73
+ args: {
74
+ filters: disabled("FolderCreateFailed", { actionMailboxId: "None" }),
75
+ },
76
+ };
77
+
78
+ export const FolderMissing: Story = {
79
+ args: {
80
+ filters: disabled("FolderMissing", { actionMailboxId: "mbx-deleted" }),
81
+ },
82
+ };
83
+
84
+ export const Toggling: Story = {
85
+ args: {
86
+ filters: disabled("UserDisabled"),
87
+ togglingFilterId: "flt-1",
88
+ },
89
+ };
@@ -8,6 +8,7 @@ import {
8
8
  } from "@remit/ui";
9
9
  import { Trash2 } from "lucide-react";
10
10
  import {
11
+ disabledReasonCopy,
11
12
  filterDisplayStatus,
12
13
  formatExpiresAt,
13
14
  } from "@/lib/organize/filter-status";
@@ -23,6 +24,8 @@ interface FiltersListProps {
23
24
  onEdit: (filterId: string) => void;
24
25
  onDelete: (filterId: string) => void;
25
26
  deletingFilterId?: string;
27
+ onToggle: (filterId: string, enabled: boolean) => void;
28
+ togglingFilterId?: string;
26
29
  /**
27
30
  * This deployment ships no vector pipeline (RFC 038 D4). A filter carrying a
28
31
  * semantic anchor lists with its widen chip inactive — it matches by its
@@ -47,6 +50,8 @@ export function FiltersList({
47
50
  onEdit,
48
51
  onDelete,
49
52
  deletingFilterId,
53
+ onToggle,
54
+ togglingFilterId,
50
55
  semanticUnavailable = false,
51
56
  now = Date.now(),
52
57
  }: FiltersListProps) {
@@ -64,6 +69,8 @@ export function FiltersList({
64
69
  {filters.map((filter) => {
65
70
  const status = filterDisplayStatus(filter, now);
66
71
  const expired = status === "Expired";
72
+ const disabled = status === "Disabled";
73
+ const reason = disabled ? disabledReasonCopy(filter) : undefined;
67
74
  const folder =
68
75
  filter.actionMailboxId !== NO_ACTION
69
76
  ? mailboxName(filter.actionMailboxId)
@@ -88,12 +95,15 @@ export function FiltersList({
88
95
  <div className="flex items-center gap-2">
89
96
  <span
90
97
  className={`truncate text-sm font-medium ${
91
- expired ? "text-fg-muted" : "text-fg"
98
+ expired || disabled ? "text-fg-muted" : "text-fg"
92
99
  }`}
93
100
  >
94
101
  {filter.name}
95
102
  </span>
96
- <Badge tone={expired ? "neutral" : "positive"} dot>
103
+ <Badge
104
+ tone={expired ? "neutral" : disabled ? "warning" : "positive"}
105
+ dot
106
+ >
97
107
  {status}
98
108
  </Badge>
99
109
  </div>
@@ -107,6 +117,9 @@ export function FiltersList({
107
117
  ? " · always"
108
118
  : ""}
109
119
  </p>
120
+ {reason && (
121
+ <p className="mt-0.5 text-xs text-warning">{reason}</p>
122
+ )}
110
123
  {(filter.hasAnchor || label) && (
111
124
  <div className="mt-1.5 flex flex-wrap gap-1.5">
112
125
  {filter.hasAnchor && (
@@ -129,6 +142,17 @@ export function FiltersList({
129
142
  </div>
130
143
  )}
131
144
  </button>
145
+ {!expired && (
146
+ <Button
147
+ variant="ghost"
148
+ size="sm"
149
+ onClick={() => onToggle(filter.filterId, disabled)}
150
+ disabled={togglingFilterId === filter.filterId}
151
+ aria-label={`${disabled ? "Turn on" : "Turn off"} filter ${filter.name}`}
152
+ >
153
+ {disabled ? "Turn on" : "Turn off"}
154
+ </Button>
155
+ )}
132
156
  <Button
133
157
  variant="ghost"
134
158
  size="sm"
@@ -46,6 +46,7 @@ const makeFilter = (
46
46
  name: "Receipts",
47
47
  scope: "Standing",
48
48
  state: "Active",
49
+ disabledReason: "None",
49
50
  hasAnchor: false,
50
51
  ruleChangedAt: 0,
51
52
  actionChangedAt: 0,
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  filterDetailOperationsDeleteFilterMutation,
3
+ filterDetailOperationsUpdateFilterMutation,
3
4
  filterOperationsCreateFilterMutation,
4
5
  filterOperationsListFiltersOptions,
5
6
  filterOperationsListFiltersQueryKey,
@@ -145,3 +146,41 @@ export const useDeleteFilter = (accountId: string | undefined) => {
145
146
  : undefined,
146
147
  };
147
148
  };
149
+
150
+ export const useToggleFilter = (accountId: string | undefined) => {
151
+ const queryClient = useQueryClient();
152
+ const mutation = useMutation({
153
+ ...filterDetailOperationsUpdateFilterMutation(),
154
+ onSuccess: () => {
155
+ if (!accountId) return;
156
+ queryClient.invalidateQueries({
157
+ queryKey: buildFilterListKey(accountId),
158
+ });
159
+ },
160
+ });
161
+ const { mutate, variables } = mutation;
162
+
163
+ const toggleFilter = useCallback(
164
+ (filterId: string, enabled: boolean) => {
165
+ if (!accountId) return;
166
+ mutate({
167
+ path: { accountId, filterId },
168
+ body: { state: enabled ? "Active" : "Disabled" },
169
+ });
170
+ },
171
+ [accountId, mutate],
172
+ );
173
+
174
+ const retry = useCallback(() => {
175
+ if (variables) mutate(variables);
176
+ }, [mutate, variables]);
177
+
178
+ return {
179
+ toggleFilter,
180
+ retry,
181
+ togglingFilterId: mutation.isPending ? variables?.path.filterId : undefined,
182
+ isError: mutation.isError,
183
+ error: mutation.error,
184
+ enabling: variables?.body?.state === "Active",
185
+ };
186
+ };
@@ -0,0 +1,10 @@
1
+ import { buildBugReportContext, buildGitHubIssueUrl } from "./bug-report";
2
+
3
+ export function filterToggleReportHref(message: string): string {
4
+ return buildGitHubIssueUrl(
5
+ buildBugReportContext({
6
+ title: `Filter toggle: ${message}`,
7
+ errorMessage: message,
8
+ }),
9
+ );
10
+ }
@@ -18,6 +18,7 @@ const filter = (
18
18
  name: "Receipts",
19
19
  scope: "Standing",
20
20
  state: "Active",
21
+ disabledReason: "None",
21
22
  hasAnchor: false,
22
23
  ruleChangedAt: 0,
23
24
  actionChangedAt: 0,
@@ -9,6 +9,27 @@ import {
9
9
  const NOW = Date.parse("2026-07-12T12:00:00Z");
10
10
 
11
11
  describe("filterDisplayStatus", () => {
12
+ it("marks a disabled filter Disabled (#1103)", () => {
13
+ assert.equal(
14
+ filterDisplayStatus({ scope: "Standing", state: "Disabled" }, NOW),
15
+ "Disabled",
16
+ );
17
+ });
18
+
19
+ it("marks a disabled temporary filter past its date Expired", () => {
20
+ assert.equal(
21
+ filterDisplayStatus(
22
+ {
23
+ scope: "Temporary",
24
+ state: "Disabled",
25
+ expiresAt: "2020-01-01T00:00:00Z",
26
+ },
27
+ NOW,
28
+ ),
29
+ "Expired",
30
+ );
31
+ });
32
+
12
33
  it("treats a Standing filter as always Active", () => {
13
34
  assert.equal(
14
35
  filterDisplayStatus({ scope: "Standing", state: "Active" }, NOW),
@@ -1,6 +1,8 @@
1
1
  import type { RemitImapFilterResponse } from "@remit/api-http-client/types.gen.ts";
2
2
 
3
- export type FilterDisplayStatus = "Active" | "Expired";
3
+ export type FilterDisplayStatus = "Active" | "Expired" | "Disabled";
4
+
5
+ export type FilterDisabledReason = RemitImapFilterResponse["disabledReason"];
4
6
 
5
7
  /**
6
8
  * The displayed Active/Expired status of a filter.
@@ -19,12 +21,39 @@ export const filterDisplayStatus = (
19
21
  now: number,
20
22
  ): FilterDisplayStatus => {
21
23
  if (filter.state === "Expired") return "Expired";
22
- if (filter.scope !== "Temporary") return "Active";
23
- if (!filter.expiresAt) return "Active";
24
+ const running = filter.state === "Disabled" ? "Disabled" : "Active";
25
+ if (filter.scope !== "Temporary") return running;
26
+ if (!filter.expiresAt) return running;
24
27
 
25
28
  const expiresAtMs = Date.parse(filter.expiresAt);
26
- if (Number.isNaN(expiresAtMs)) return "Active";
27
- return expiresAtMs <= now ? "Expired" : "Active";
29
+ if (Number.isNaN(expiresAtMs)) return running;
30
+ return expiresAtMs <= now ? "Expired" : running;
31
+ };
32
+
33
+ const DISABLED_REASON_COPY: Record<
34
+ Exclude<FilterDisabledReason, "None">,
35
+ string
36
+ > = {
37
+ UserDisabled: "Turned off. Turn it on to run it on new mail again.",
38
+ AwaitingFolder:
39
+ "Off until its folder exists on the mail server. It turns on by itself once the folder is created.",
40
+ FolderCreateFailed:
41
+ "Off: the mail server refused to create its folder. Pick another folder in the rule, then turn it on.",
42
+ FolderMissing:
43
+ "Off: the folder it moves mail into no longer exists. Pick another folder in the rule, then turn it on.",
44
+ };
45
+
46
+ export const disabledReasonCopy = (
47
+ filter: Pick<RemitImapFilterResponse, "disabledReason" | "actionMailboxId">,
48
+ ): string | undefined => {
49
+ if (filter.disabledReason === "None") return undefined;
50
+ const folderless =
51
+ filter.disabledReason === "AwaitingFolder" ||
52
+ filter.disabledReason === "FolderCreateFailed";
53
+ if (folderless && filter.actionMailboxId !== "None") {
54
+ return DISABLED_REASON_COPY.UserDisabled;
55
+ }
56
+ return DISABLED_REASON_COPY[filter.disabledReason];
28
57
  };
29
58
 
30
59
  /**
@@ -64,6 +64,7 @@ const filter: RemitImapFilterResponse = {
64
64
  name: "Receipts",
65
65
  scope: "Standing",
66
66
  state: "Active",
67
+ disabledReason: "None",
67
68
  hasAnchor: false,
68
69
  ruleChangedAt: 0,
69
70
  actionChangedAt: 0,
@@ -9,10 +9,16 @@ import { createFileRoute, useNavigate } from "@tanstack/react-router";
9
9
  import { useCallback, useMemo, useState } from "react";
10
10
  import { FilterEditorSurface } from "@/components/settings/FilterEditorSurface";
11
11
  import { FiltersList } from "@/components/settings/FiltersList";
12
+ import { FilterToggleError } from "@/components/settings/FilterToggleError";
12
13
  import { ErrorState } from "@/components/ui/ErrorState";
13
- import { useDeleteFilter, useFilterList } from "@/hooks/useFilters";
14
+ import {
15
+ useDeleteFilter,
16
+ useFilterList,
17
+ useToggleFilter,
18
+ } from "@/hooks/useFilters";
14
19
  import { useFolderLabelTranslator } from "@/hooks/useFolderLabelTranslator";
15
20
  import { useLabelList } from "@/hooks/useLabels";
21
+ import { filterToggleReportHref } from "@/lib/filter-report";
16
22
  import { buildMailboxRoleMap, labelForMailbox } from "@/lib/folder-roles";
17
23
  import { buildMoveOptions, folderDelimiter } from "@/lib/move-options";
18
24
  import { SETTINGS_ID_TO_PATH, SETTINGS_NAV_ITEMS } from "@/routes/settings";
@@ -32,6 +38,10 @@ const filtersHelp = (
32
38
  An expired filter isn't deleted the instant it lapses — it stays here,
33
39
  marked Expired, so you can see what it did and when it stopped.
34
40
  </p>
41
+ <p>
42
+ A filter that can't do its job turns itself off and says why, for example
43
+ when its folder no longer exists. Turn it back on once that is fixed.
44
+ </p>
35
45
  </div>
36
46
  );
37
47
 
@@ -44,6 +54,7 @@ export function AccountFilters({
44
54
  const { filters, isPending, isError, error, refetch } =
45
55
  useFilterList(accountId);
46
56
  const { deleteFilter, deletingFilterId } = useDeleteFilter(accountId);
57
+ const toggle = useToggleFilter(accountId);
47
58
  const [editingFilterId, setEditingFilterId] = useState<string | undefined>();
48
59
 
49
60
  const { data: mailboxesData } = useQuery({
@@ -128,14 +139,26 @@ export function AccountFilters({
128
139
  }}
129
140
  />
130
141
  ) : (
131
- <FiltersList
132
- filters={filters}
133
- mailboxName={mailboxName}
134
- labelById={labelById}
135
- onEdit={setEditingFilterId}
136
- onDelete={deleteFilter}
137
- deletingFilterId={deletingFilterId}
138
- />
142
+ <>
143
+ {toggle.isError && (
144
+ <FilterToggleError
145
+ enabling={toggle.enabling}
146
+ error={toggle.error}
147
+ onRetry={toggle.retry}
148
+ reportHref={filterToggleReportHref}
149
+ />
150
+ )}
151
+ <FiltersList
152
+ filters={filters}
153
+ mailboxName={mailboxName}
154
+ labelById={labelById}
155
+ onEdit={setEditingFilterId}
156
+ onDelete={deleteFilter}
157
+ deletingFilterId={deletingFilterId}
158
+ onToggle={toggle.toggleFilter}
159
+ togglingFilterId={toggle.togglingFilterId}
160
+ />
161
+ </>
139
162
  )}
140
163
  </section>
141
164
  );