@rapidmx/web-client 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/apps/admin/audit-log/index.tsx +35 -8
  2. package/apps/admin/data-requests/index.tsx +480 -485
  3. package/apps/admin/distribution-lists/[uid].tsx +19 -1
  4. package/apps/admin/escrow-scopes/[uid].tsx +348 -237
  5. package/apps/admin/escrow-scopes/new/index.tsx +8 -2
  6. package/apps/admin/index.tsx +19 -1
  7. package/apps/admin/ingest-queue/index.tsx +44 -5
  8. package/apps/admin/mailboxes/[uid].tsx +211 -184
  9. package/apps/admin/quarantine/index.tsx +46 -14
  10. package/apps/admin/transport-rules/[uid].tsx +30 -1
  11. package/apps/admin/transport-rules/_transportRuleConfig.tsx +38 -2
  12. package/apps/admin/transport-rules/index.tsx +24 -6
  13. package/apps/admin/transport-rules/new/index.tsx +30 -1
  14. package/apps/escrow/_layout.tsx +2 -3
  15. package/apps/escrow/audit-log/index.tsx +196 -168
  16. package/apps/escrow/matters/[uid].tsx +621 -521
  17. package/apps/shared/components/admin/escrowScopes/EscrowScopeKeyAndHoldersFields.tsx +22 -1
  18. package/apps/shared/components/admin/layout/AdminShell.tsx +3 -1
  19. package/apps/shared/components/admin/mailboxes/EscrowScopeCard.tsx +152 -0
  20. package/apps/shared/components/admin/mailboxes/ResourceSettingsCard.tsx +3 -3
  21. package/apps/shared/components/admin/mailboxes/ShareAccessCard.tsx +55 -11
  22. package/apps/shared/components/admin/settings/BrandingForm.tsx +15 -4
  23. package/apps/shared/components/admin/settings/DomainDnsSetup.tsx +18 -7
  24. package/apps/shared/components/admin/settings/EncryptionPolicyForm.tsx +10 -2
  25. package/apps/shared/components/admin/settings/MailboxCreateForm.tsx +6 -0
  26. package/apps/shared/components/admin/settings/MailboxPolicyForm.tsx +45 -12
  27. package/apps/shared/components/admin/settings/PluginsManager.tsx +1235 -595
  28. package/apps/shared/components/admin/settings/RetentionPolicyForm.tsx +174 -98
  29. package/apps/shared/components/admin/setup/EscrowSetupStep.tsx +49 -13
  30. package/apps/shared/components/admin/setup/SetupWizard.tsx +150 -34
  31. package/apps/shared/components/admin/signOut.ts +79 -0
  32. package/apps/shared/components/admin/usePagedList.tsx +129 -0
  33. package/apps/shared/components/calendar/EventModal.tsx +717 -549
  34. package/apps/shared/components/calendar/MonthView.tsx +173 -139
  35. package/apps/shared/components/calendar/RecurrenceEditor.tsx +222 -180
  36. package/apps/shared/components/calendar/SplitDayView.tsx +143 -137
  37. package/apps/shared/components/calendar/TimeGridView.tsx +244 -198
  38. package/apps/shared/components/calendar/allDay.ts +124 -0
  39. package/apps/shared/components/calendar/layout/CalendarShell.tsx +1 -1
  40. package/apps/shared/components/contacts/ContactDetailPane.tsx +100 -21
  41. package/apps/shared/components/contacts/ContactForm.tsx +377 -348
  42. package/apps/shared/components/contacts/ContactsSidebar.tsx +6 -2
  43. package/apps/shared/components/contacts/KeyChangeReview.tsx +192 -0
  44. package/apps/shared/components/contacts/contactKeys.ts +78 -0
  45. package/apps/shared/components/escrow/layout/EscrowShell.tsx +148 -134
  46. package/apps/shared/components/layout/AppShell.tsx +87 -15
  47. package/apps/shared/components/layout/BrandingChrome.tsx +48 -10
  48. package/apps/shared/components/layout/KeyEnrollmentGate.tsx +389 -298
  49. package/apps/shared/components/layout/MailboxProvisioning.tsx +19 -3
  50. package/apps/shared/components/layout/RecoveryCodeUnlock.tsx +350 -0
  51. package/apps/shared/components/layout/UnlockPromptProvider.tsx +257 -128
  52. package/apps/shared/components/mail/ConversationThreadPane.tsx +216 -181
  53. package/apps/shared/components/mail/MessageDetailPane.tsx +1318 -630
  54. package/apps/shared/components/mail/compose/ComposeContext.tsx +20 -15
  55. package/apps/shared/components/mail/compose/ComposeWindow.tsx +854 -132
  56. package/apps/shared/components/mail/compose/composeFlushRegistry.ts +60 -0
  57. package/apps/shared/components/mail/layout/MailShell.tsx +12 -2
  58. package/apps/shared/components/mail/pinnedSigners.ts +124 -0
  59. package/apps/shared/components/mail/verificationSeals.ts +125 -0
  60. package/apps/shared/components/mail/writableMailboxes.ts +101 -0
  61. package/apps/shared/components/rules/RuleBuilder.tsx +311 -276
  62. package/apps/shared/mail/listAllPages.ts +39 -0
  63. package/apps/shared/search/LocalIndexLifecycle.tsx +64 -55
  64. package/apps/shared/search/localIndexBuilder.ts +481 -179
  65. package/apps/shared/search/localIndexRpcClient.ts +228 -28
  66. package/apps/shared/search/localIndexSchema.ts +15 -6
  67. package/apps/shared/search/localIndexStorage.ts +98 -0
  68. package/apps/shared/search/localIndexVFS.ts +32 -1
  69. package/apps/shared/search/localIndexWorker.ts +648 -186
  70. package/apps/www/calendar/index.tsx +438 -417
  71. package/apps/www/contacts/[uid].tsx +21 -2
  72. package/apps/www/contacts/index.tsx +116 -12
  73. package/apps/www/index.tsx +1314 -1041
  74. package/apps/www/messages/[uid].tsx +18 -6
  75. package/apps/www/settings/auto-reply/index.tsx +134 -129
  76. package/apps/www/settings/booking-types/[uid].tsx +306 -300
  77. package/apps/www/settings/encryption/index.tsx +739 -216
  78. package/apps/www/settings/filters/[uid].tsx +171 -155
  79. package/apps/www/settings/filters/new/index.tsx +8 -1
  80. package/apps/www/settings/focused-inbox/index.tsx +150 -148
  81. package/apps/www/settings/privacy/index.tsx +494 -436
  82. package/apps/www/settings/read-receipts/index.tsx +148 -125
  83. package/apps/www/settings/sharing/index.tsx +17 -14
  84. package/apps/www/tasks/index.tsx +638 -579
  85. package/dist/apps/admin/audit-log/index.js +38 -8
  86. package/dist/apps/admin/data-requests/index.js +52 -72
  87. package/dist/apps/admin/distribution-lists/[uid].js +1 -1
  88. package/dist/apps/admin/escrow-scopes/[uid].js +91 -12
  89. package/dist/apps/admin/escrow-scopes/new/index.js +8 -3
  90. package/dist/apps/admin/index.js +4 -1
  91. package/dist/apps/admin/ingest-queue/index.js +24 -6
  92. package/dist/apps/admin/mailboxes/[uid].js +20 -4
  93. package/dist/apps/admin/quarantine/index.js +20 -11
  94. package/dist/apps/admin/transport-rules/[uid].js +18 -2
  95. package/dist/apps/admin/transport-rules/_transportRuleConfig.js +19 -0
  96. package/dist/apps/admin/transport-rules/index.js +22 -6
  97. package/dist/apps/admin/transport-rules/new/index.js +18 -2
  98. package/dist/apps/escrow/_layout.js +3 -3
  99. package/dist/apps/escrow/audit-log/index.js +26 -1
  100. package/dist/apps/escrow/matters/[uid].js +77 -42
  101. package/dist/apps/shared/components/admin/escrowScopes/EscrowScopeKeyAndHoldersFields.js +11 -2
  102. package/dist/apps/shared/components/admin/layout/AdminShell.js +3 -1
  103. package/dist/apps/shared/components/admin/mailboxes/EscrowScopeCard.js +72 -0
  104. package/dist/apps/shared/components/admin/mailboxes/ResourceSettingsCard.js +3 -3
  105. package/dist/apps/shared/components/admin/mailboxes/ShareAccessCard.js +22 -4
  106. package/dist/apps/shared/components/admin/settings/BrandingForm.js +15 -4
  107. package/dist/apps/shared/components/admin/settings/DomainDnsSetup.js +13 -7
  108. package/dist/apps/shared/components/admin/settings/EncryptionPolicyForm.js +7 -2
  109. package/dist/apps/shared/components/admin/settings/MailboxCreateForm.js +6 -0
  110. package/dist/apps/shared/components/admin/settings/MailboxPolicyForm.js +34 -12
  111. package/dist/apps/shared/components/admin/settings/PluginsManager.js +390 -78
  112. package/dist/apps/shared/components/admin/settings/RetentionPolicyForm.js +40 -11
  113. package/dist/apps/shared/components/admin/setup/EscrowSetupStep.js +29 -13
  114. package/dist/apps/shared/components/admin/setup/SetupWizard.js +87 -21
  115. package/dist/apps/shared/components/admin/signOut.js +75 -0
  116. package/dist/apps/shared/components/admin/usePagedList.js +99 -0
  117. package/dist/apps/shared/components/calendar/EventModal.js +142 -21
  118. package/dist/apps/shared/components/calendar/MonthView.js +12 -5
  119. package/dist/apps/shared/components/calendar/RecurrenceEditor.js +40 -5
  120. package/dist/apps/shared/components/calendar/SplitDayView.js +10 -4
  121. package/dist/apps/shared/components/calendar/TimeGridView.js +23 -7
  122. package/dist/apps/shared/components/calendar/allDay.js +111 -0
  123. package/dist/apps/shared/components/calendar/layout/CalendarShell.js +1 -1
  124. package/dist/apps/shared/components/contacts/ContactDetailPane.js +43 -5
  125. package/dist/apps/shared/components/contacts/ContactForm.js +32 -10
  126. package/dist/apps/shared/components/contacts/ContactsSidebar.js +2 -2
  127. package/dist/apps/shared/components/contacts/KeyChangeReview.js +63 -0
  128. package/dist/apps/shared/components/contacts/contactKeys.js +64 -0
  129. package/dist/apps/shared/components/escrow/layout/EscrowShell.js +24 -5
  130. package/dist/apps/shared/components/layout/AppShell.js +83 -14
  131. package/dist/apps/shared/components/layout/BrandingChrome.js +45 -10
  132. package/dist/apps/shared/components/layout/KeyEnrollmentGate.js +49 -12
  133. package/dist/apps/shared/components/layout/MailboxProvisioning.js +10 -2
  134. package/dist/apps/shared/components/layout/RecoveryCodeUnlock.js +174 -0
  135. package/dist/apps/shared/components/layout/UnlockPromptProvider.js +73 -14
  136. package/dist/apps/shared/components/mail/ConversationThreadPane.js +50 -12
  137. package/dist/apps/shared/components/mail/MessageDetailPane.js +441 -36
  138. package/dist/apps/shared/components/mail/compose/ComposeContext.js +9 -6
  139. package/dist/apps/shared/components/mail/compose/ComposeWindow.js +699 -128
  140. package/dist/apps/shared/components/mail/compose/composeFlushRegistry.js +50 -0
  141. package/dist/apps/shared/components/mail/layout/MailShell.js +12 -3
  142. package/dist/apps/shared/components/mail/pinnedSigners.js +98 -0
  143. package/dist/apps/shared/components/mail/verificationSeals.js +112 -0
  144. package/dist/apps/shared/components/mail/writableMailboxes.js +87 -0
  145. package/dist/apps/shared/components/rules/RuleBuilder.js +34 -6
  146. package/dist/apps/shared/mail/listAllPages.js +25 -0
  147. package/dist/apps/shared/search/LocalIndexLifecycle.js +58 -54
  148. package/dist/apps/shared/search/localIndexBuilder.js +292 -37
  149. package/dist/apps/shared/search/localIndexRpcClient.js +188 -25
  150. package/dist/apps/shared/search/localIndexSchema.js +12 -6
  151. package/dist/apps/shared/search/localIndexStorage.js +86 -0
  152. package/dist/apps/shared/search/localIndexVFS.js +68 -40
  153. package/dist/apps/shared/search/localIndexWorker.js +519 -173
  154. package/dist/apps/www/calendar/index.js +28 -10
  155. package/dist/apps/www/contacts/[uid].js +13 -2
  156. package/dist/apps/www/contacts/index.js +80 -10
  157. package/dist/apps/www/index.js +339 -108
  158. package/dist/apps/www/messages/[uid].js +18 -6
  159. package/dist/apps/www/settings/auto-reply/index.js +9 -4
  160. package/dist/apps/www/settings/booking-types/[uid].js +17 -12
  161. package/dist/apps/www/settings/encryption/index.js +514 -97
  162. package/dist/apps/www/settings/filters/[uid].js +22 -7
  163. package/dist/apps/www/settings/filters/new/index.js +8 -2
  164. package/dist/apps/www/settings/focused-inbox/index.js +3 -1
  165. package/dist/apps/www/settings/privacy/index.js +57 -22
  166. package/dist/apps/www/settings/read-receipts/index.js +10 -3
  167. package/dist/apps/www/settings/sharing/index.js +7 -11
  168. package/dist/apps/www/tasks/index.js +50 -10
  169. package/package.json +2 -2
@@ -1,125 +1,148 @@
1
- ///////////////////////////////////////////////////////////////////////////////
2
- // Copyright (C) 2026 Jean-Philippe Steinmetz
3
- // SPDX-License-Identifier: MPL-2.0
4
- ///////////////////////////////////////////////////////////////////////////////
5
- import React, { FormEvent, useState } from "react";
6
- import { ApiRequestError } from "@rapidmx/react-shared/util/api.js";
7
- import { updateMailbox } from "@rapidmx/react-shared/mail/mailApi.js";
8
- import SettingsShell, { SettingsShellProps, useSettingsShell } from "../../../shared/components/settings/layout/SettingsShell.js";
9
- import Alert from "@rapidmx/react-shared/components/feedback/Alert.js";
10
- import Button from "@rapidmx/react-shared/components/buttons/Button.js";
11
-
12
- export type SettingsReadReceiptsPageProps = Omit<SettingsShellProps, "active">;
13
-
14
- export default function SettingsReadReceiptsPage(props: SettingsReadReceiptsPageProps) {
15
- return (
16
- <SettingsShell {...props} active="read-receipts">
17
- <ReadReceiptsContent />
18
- </SettingsShell>
19
- );
20
- }
21
-
22
- function ReadReceiptsContent() {
23
- const { mailboxUid, mailboxes } = useSettingsShell();
24
- // `SettingsShell` only ever renders its children once `mailboxes` has loaded and `mailboxUid` has
25
- // resolved to one of them — same established non-null pattern as `apps/www/settings/auto-reply/index.tsx`.
26
- const mailbox = mailboxes.find((mb) => mb.uid === mailboxUid)!;
27
-
28
- const [alwaysRequestReceiptInternal, setAlwaysRequestReceiptInternal] = useState(mailbox.alwaysRequestReceiptInternal ?? true);
29
- const [alwaysRequestReceiptExternal, setAlwaysRequestReceiptExternal] = useState(mailbox.alwaysRequestReceiptExternal ?? false);
30
- const [autoSendReceiptsInternal, setAutoSendReceiptsInternal] = useState(mailbox.autoSendReceiptsInternal ?? true);
31
- const [autoSendReceiptsExternal, setAutoSendReceiptsExternal] = useState(mailbox.autoSendReceiptsExternal ?? false);
32
- const [error, setError] = useState<string | null>(null);
33
- const [saving, setSaving] = useState(false);
34
- const [saved, setSaved] = useState(false);
35
-
36
- async function handleSubmit(e: FormEvent) {
37
- e.preventDefault();
38
- setError(null);
39
- setSaved(false);
40
- setSaving(true);
41
- try {
42
- await updateMailbox({
43
- uid: mailbox.uid,
44
- version: mailbox.version,
45
- alwaysRequestReceiptInternal,
46
- alwaysRequestReceiptExternal,
47
- autoSendReceiptsInternal,
48
- autoSendReceiptsExternal,
49
- });
50
- setSaved(true);
51
- } catch (err) {
52
- setError(err instanceof ApiRequestError ? err.message : "Could not save read receipt settings.");
53
- } finally {
54
- setSaving(false);
55
- }
56
- }
57
-
58
- return (
59
- <div className="flex-1 min-w-0 overflow-y-auto p-6">
60
- <div className="max-w-xl">
61
- <h1 className="text-lg font-bold tracking-tight mb-1">Read Receipts</h1>
62
- <p className="text-sm text-text-muted mb-4">
63
- Controls when this mailbox requests a delivery/read receipt on mail it sends, and how it
64
- responds to a receipt requested of it. A per-message &ldquo;Request a read receipt&rdquo;
65
- checkbox in Compose always overrides the request-side settings below for that one message.
66
- </p>
67
-
68
- {error && <Alert>{error}</Alert>}
69
- {saved && !error && <div className="mb-4 text-sm text-success font-medium">Saved.</div>}
70
-
71
- <form onSubmit={handleSubmit} className="flex flex-col gap-5">
72
- <fieldset className="flex flex-col gap-2">
73
- <legend className="text-sm font-semibold mb-1">Request receipts when sending</legend>
74
- <label className="flex items-center gap-2 text-sm">
75
- <input
76
- type="checkbox"
77
- checked={alwaysRequestReceiptInternal}
78
- onChange={(e) => setAlwaysRequestReceiptInternal(e.target.checked)}
79
- />
80
- From internal recipients (mail to this organization)
81
- </label>
82
- <label className="flex items-center gap-2 text-sm">
83
- <input
84
- type="checkbox"
85
- checked={alwaysRequestReceiptExternal}
86
- onChange={(e) => setAlwaysRequestReceiptExternal(e.target.checked)}
87
- />
88
- From external recipients
89
- </label>
90
- </fieldset>
91
-
92
- <fieldset className="flex flex-col gap-2">
93
- <legend className="text-sm font-semibold mb-1">Respond automatically to requests</legend>
94
- <label className="flex items-center gap-2 text-sm">
95
- <input
96
- type="checkbox"
97
- checked={autoSendReceiptsInternal}
98
- onChange={(e) => setAutoSendReceiptsInternal(e.target.checked)}
99
- />
100
- From internal senders
101
- </label>
102
- <label className="flex items-center gap-2 text-sm">
103
- <input
104
- type="checkbox"
105
- checked={autoSendReceiptsExternal}
106
- onChange={(e) => setAutoSendReceiptsExternal(e.target.checked)}
107
- />
108
- From external senders
109
- </label>
110
- <p className="text-xs text-text-muted">
111
- Unchecked means a request from that sender waits in your Inbox for you to send or
112
- decline it explicitly.
113
- </p>
114
- </fieldset>
115
-
116
- <div>
117
- <Button type="submit" loading={saving} disabled={saving} className="!w-auto">
118
- Save
119
- </Button>
120
- </div>
121
- </form>
122
- </div>
123
- </div>
124
- );
125
- }
1
+ ///////////////////////////////////////////////////////////////////////////////
2
+ // Copyright (C) 2026 Jean-Philippe Steinmetz
3
+ // SPDX-License-Identifier: MPL-2.0
4
+ ///////////////////////////////////////////////////////////////////////////////
5
+ import React, { FormEvent, useState } from "react";
6
+ import { ApiRequestError } from "@rapidmx/react-shared/util/api.js";
7
+ import { updateMailbox } from "@rapidmx/react-shared/mail/mailApi.js";
8
+ import SettingsShell, { SettingsShellProps, useSettingsShell } from "../../../shared/components/settings/layout/SettingsShell.js";
9
+ import Alert from "@rapidmx/react-shared/components/feedback/Alert.js";
10
+ import Button from "@rapidmx/react-shared/components/buttons/Button.js";
11
+
12
+ export type SettingsReadReceiptsPageProps = Omit<SettingsShellProps, "active">;
13
+
14
+ export default function SettingsReadReceiptsPage(props: SettingsReadReceiptsPageProps) {
15
+ return (
16
+ <SettingsShell {...props} active="read-receipts">
17
+ <ReadReceiptsContent />
18
+ </SettingsShell>
19
+ );
20
+ }
21
+
22
+ function ReadReceiptsContent() {
23
+ const { mailboxUid, mailboxes } = useSettingsShell();
24
+ // `SettingsShell` only ever renders its children once `mailboxes` has loaded and `mailboxUid` has
25
+ // resolved to one of them — same established non-null pattern as `apps/www/settings/auto-reply/index.tsx`.
26
+ const mailbox = mailboxes.find((mb) => mb.uid === mailboxUid)!;
27
+
28
+ const [alwaysRequestReceiptInternal, setAlwaysRequestReceiptInternal] = useState(mailbox.alwaysRequestReceiptInternal ?? true);
29
+ const [alwaysRequestReceiptFederated, setAlwaysRequestReceiptFederated] = useState(mailbox.alwaysRequestReceiptFederated ?? false);
30
+ const [alwaysRequestReceiptExternal, setAlwaysRequestReceiptExternal] = useState(mailbox.alwaysRequestReceiptExternal ?? false);
31
+ const [autoSendReceiptsInternal, setAutoSendReceiptsInternal] = useState(mailbox.autoSendReceiptsInternal ?? true);
32
+ const [autoSendReceiptsFederated, setAutoSendReceiptsFederated] = useState(mailbox.autoSendReceiptsFederated ?? false);
33
+ const [autoSendReceiptsExternal, setAutoSendReceiptsExternal] = useState(mailbox.autoSendReceiptsExternal ?? false);
34
+ // See auto-reply/index.tsx's identical note - later saves must carry the version the previous save returned.
35
+ const [version, setVersion] = useState(mailbox.version);
36
+ const [error, setError] = useState<string | null>(null);
37
+ const [saving, setSaving] = useState(false);
38
+ const [saved, setSaved] = useState(false);
39
+
40
+ async function handleSubmit(e: FormEvent) {
41
+ e.preventDefault();
42
+ setError(null);
43
+ setSaved(false);
44
+ setSaving(true);
45
+ try {
46
+ const updated = await updateMailbox({
47
+ uid: mailbox.uid,
48
+ version,
49
+ alwaysRequestReceiptInternal,
50
+ alwaysRequestReceiptFederated,
51
+ alwaysRequestReceiptExternal,
52
+ autoSendReceiptsInternal,
53
+ autoSendReceiptsFederated,
54
+ autoSendReceiptsExternal,
55
+ });
56
+ setVersion(updated.version);
57
+ setSaved(true);
58
+ } catch (err) {
59
+ setError(err instanceof ApiRequestError ? err.message : "Could not save read receipt settings.");
60
+ } finally {
61
+ setSaving(false);
62
+ }
63
+ }
64
+
65
+ return (
66
+ <div className="flex-1 min-w-0 overflow-y-auto p-6">
67
+ <div className="max-w-xl">
68
+ <h1 className="text-lg font-bold tracking-tight mb-1">Read Receipts</h1>
69
+ <p className="text-sm text-text-muted mb-4">
70
+ Controls when this mailbox requests a delivery/read receipt on mail it sends, and how it
71
+ responds to a receipt requested of it. A per-message &ldquo;Request a read receipt&rdquo;
72
+ checkbox in Compose always overrides the request-side settings below for that one message.
73
+ </p>
74
+
75
+ {error && <Alert>{error}</Alert>}
76
+ {saved && !error && <div className="mb-4 text-sm text-success font-medium">Saved.</div>}
77
+
78
+ <form onSubmit={handleSubmit} className="flex flex-col gap-5">
79
+ <fieldset className="flex flex-col gap-2">
80
+ <legend className="text-sm font-semibold mb-1">Request receipts when sending</legend>
81
+ <label className="flex items-center gap-2 text-sm">
82
+ <input
83
+ type="checkbox"
84
+ checked={alwaysRequestReceiptInternal}
85
+ onChange={(e) => setAlwaysRequestReceiptInternal(e.target.checked)}
86
+ />
87
+ From internal recipients (mail to this organization)
88
+ </label>
89
+ <label className="flex items-center gap-2 text-sm">
90
+ <input
91
+ type="checkbox"
92
+ checked={alwaysRequestReceiptFederated}
93
+ onChange={(e) => setAlwaysRequestReceiptFederated(e.target.checked)}
94
+ />
95
+ From federated recipients (partner organizations)
96
+ </label>
97
+ <label className="flex items-center gap-2 text-sm">
98
+ <input
99
+ type="checkbox"
100
+ checked={alwaysRequestReceiptExternal}
101
+ onChange={(e) => setAlwaysRequestReceiptExternal(e.target.checked)}
102
+ />
103
+ From external recipients
104
+ </label>
105
+ </fieldset>
106
+
107
+ <fieldset className="flex flex-col gap-2">
108
+ <legend className="text-sm font-semibold mb-1">Respond automatically to requests</legend>
109
+ <label className="flex items-center gap-2 text-sm">
110
+ <input
111
+ type="checkbox"
112
+ checked={autoSendReceiptsInternal}
113
+ onChange={(e) => setAutoSendReceiptsInternal(e.target.checked)}
114
+ />
115
+ From internal senders
116
+ </label>
117
+ <label className="flex items-center gap-2 text-sm">
118
+ <input
119
+ type="checkbox"
120
+ checked={autoSendReceiptsFederated}
121
+ onChange={(e) => setAutoSendReceiptsFederated(e.target.checked)}
122
+ />
123
+ From federated senders (partner organizations)
124
+ </label>
125
+ <label className="flex items-center gap-2 text-sm">
126
+ <input
127
+ type="checkbox"
128
+ checked={autoSendReceiptsExternal}
129
+ onChange={(e) => setAutoSendReceiptsExternal(e.target.checked)}
130
+ />
131
+ From external senders
132
+ </label>
133
+ <p className="text-xs text-text-muted">
134
+ Unchecked means a request from that sender waits in your Inbox for you to send or
135
+ decline it explicitly.
136
+ </p>
137
+ </fieldset>
138
+
139
+ <div>
140
+ <Button type="submit" loading={saving} disabled={saving} className="!w-auto">
141
+ Save
142
+ </Button>
143
+ </div>
144
+ </form>
145
+ </div>
146
+ </div>
147
+ );
148
+ }
@@ -57,13 +57,13 @@ function SharingContent() {
57
57
  const [removeTarget, setRemoveTarget] = useState<MailboxAccessMember | null>(null);
58
58
  const [removing, setRemoving] = useState(false);
59
59
 
60
+ // `SettingsShell` only ever renders its children once `mailboxUid` has resolved (a mailbox-less caller
61
+ // gets `<MailboxProvisioning />` instead) - same established precedent as the Labels/Focused Inbox
62
+ // settings pages, so none of the handlers below need their own `!mailboxUid` guard.
60
63
  function reload() {
61
- if (!mailboxUid) {
62
- return;
63
- }
64
64
  setStatus("loading");
65
65
  setError(null);
66
- listMailboxAccess(mailboxUid)
66
+ listMailboxAccess(mailboxUid!)
67
67
  .then((result) => {
68
68
  setMembers(result);
69
69
  setStatus("ready");
@@ -86,7 +86,7 @@ function SharingContent() {
86
86
  async function handleAdd(e: FormEvent) {
87
87
  e.preventDefault();
88
88
  const email = emailInput.trim();
89
- if (!email || !mailboxUid) {
89
+ if (!email) {
90
90
  return;
91
91
  }
92
92
  setAddError(null);
@@ -97,7 +97,7 @@ function SharingContent() {
97
97
  setAddError("No one found with that email on this platform.");
98
98
  return;
99
99
  }
100
- await setMailboxAccess(mailboxUid, found.userUid, newRole);
100
+ await setMailboxAccess(mailboxUid!, found.userUid, newRole);
101
101
  setEmailInput("");
102
102
  setNewRole("viewer");
103
103
  reload();
@@ -109,13 +109,10 @@ function SharingContent() {
109
109
  }
110
110
 
111
111
  async function handleRoleChange(userOrRoleId: string, role: MailboxAccessRole) {
112
- if (!mailboxUid) {
113
- return;
114
- }
115
112
  setPendingRoleChange(userOrRoleId);
116
113
  setError(null);
117
114
  try {
118
- await setMailboxAccess(mailboxUid, userOrRoleId, role);
115
+ await setMailboxAccess(mailboxUid!, userOrRoleId, role);
119
116
  reload();
120
117
  } catch (err) {
121
118
  setError(err instanceof ApiRequestError ? err.message : "Could not update this member's role.");
@@ -129,13 +126,12 @@ function SharingContent() {
129
126
  }
130
127
 
131
128
  async function handleRemove() {
132
- if (!mailboxUid || !removeTarget) {
133
- return;
134
- }
129
+ // Only reachable from the confirm modal's own "Remove" button, and `Modal` renders nothing at all
130
+ // unless `removeTarget` is set, so `removeTarget` is always non-null here.
135
131
  setRemoving(true);
136
132
  setError(null);
137
133
  try {
138
- await removeMailboxAccess(mailboxUid, removeTarget.userOrRoleId);
134
+ await removeMailboxAccess(mailboxUid!, removeTarget!.userOrRoleId);
139
135
  setRemoveTarget(null);
140
136
  reload();
141
137
  } catch (err) {
@@ -191,6 +187,13 @@ function SharingContent() {
191
187
  handleRoleChange(member.userOrRoleId, e.target.value as MailboxAccessRole)
192
188
  }
193
189
  >
190
+ {/* Access granted outside this page can't be set here, only replaced by a
191
+ standard role. */}
192
+ {member.role === "custom" && (
193
+ <option value="custom" disabled>
194
+ Custom access
195
+ </option>
196
+ )}
194
197
  {(Object.keys(ROLE_LABELS) as MailboxAccessRole[]).map((role) => (
195
198
  <option key={role} value={role}>
196
199
  {ROLE_LABELS[role]}