@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.
Files changed (200) hide show
  1. package/package.json +12 -3
  2. package/src/components/DropdownMenu.tsx +100 -0
  3. package/src/components/EmptyState.tsx +11 -0
  4. package/src/components/ErrorBanner.render.test.ts +107 -0
  5. package/src/components/ErrorBanner.stories.tsx +132 -0
  6. package/src/components/ErrorBanner.tsx +122 -0
  7. package/src/components/ErrorBannerStack.tsx +34 -0
  8. package/src/components/ErrorState.render.test.ts +82 -0
  9. package/src/components/ErrorState.tsx +80 -0
  10. package/src/components/KeyboardShortcutsModal.tsx +111 -0
  11. package/src/components/account-service-change-dialog.render.test.ts +1 -41
  12. package/src/components/account-service-choice.render.test.ts +0 -26
  13. package/src/components/account-service-toggles.render.test.ts +0 -6
  14. package/src/components/address-display.render.test.ts +1 -38
  15. package/src/components/address-tag.render.test.ts +0 -11
  16. package/src/components/agenda-flow.reach.test.ts +0 -8
  17. package/src/components/agenda-flow.render.test.ts +0 -31
  18. package/src/components/agenda-panels.render.test.ts +0 -5
  19. package/src/components/app-shell-slotted.render.test.ts +0 -118
  20. package/src/components/attachment-list.render.test.ts +41 -24
  21. package/src/components/attachment-list.stories.tsx +67 -0
  22. package/src/components/attachment-list.tsx +112 -35
  23. package/src/components/attendee-row.render.test.ts +0 -41
  24. package/src/components/attention-dot.stories.tsx +46 -0
  25. package/src/components/attention-dot.tsx +23 -0
  26. package/src/components/banner.render.test.ts +0 -7
  27. package/src/components/bottom-sheet.render.test.ts +0 -42
  28. package/src/components/brief-section.render.test.ts +0 -13
  29. package/src/components/brief-sections.keyboard.test.ts +0 -13
  30. package/src/components/brief-sections.render.test.ts +0 -22
  31. package/src/components/calendar-clash-strip.render.test.ts +0 -19
  32. package/src/components/calendar-grid.render.test.ts +0 -79
  33. package/src/components/calendar-invite-card.render.test.ts +0 -19
  34. package/src/components/calendar-list.render.test.ts +0 -21
  35. package/src/components/calendar-slot-offers.render.test.ts +0 -24
  36. package/src/components/calendar-suggestion-deck.render.test.ts +0 -18
  37. package/src/components/calendar-toolbar.render.test.ts +1 -53
  38. package/src/components/category-badge.render.test.ts +1 -24
  39. package/src/components/compose-action-bar.render.test.ts +0 -5
  40. package/src/components/compose-attachments.render.test.ts +0 -38
  41. package/src/components/event-detail.render.test.ts +0 -27
  42. package/src/components/event-editor.render.test.ts +0 -4
  43. package/src/components/event-suggestion-card.render.test.ts +0 -61
  44. package/src/components/event-suggestion-card.zone-gate.test.ts +1 -7
  45. package/src/components/filter-clause-chip.tsx +1 -60
  46. package/src/components/filter-rule-editor.create.test.ts +0 -6
  47. package/src/components/filter-rule-editor.stories.tsx +24 -138
  48. package/src/components/filter-rule-editor.tsx +7 -93
  49. package/src/components/filter-rule.render.test.ts +9 -299
  50. package/src/components/filter-rule.ts +20 -85
  51. package/src/components/filter-sheet.render.test.ts +0 -7
  52. package/src/components/folder-manage-actions.render.test.ts +0 -13
  53. package/src/components/folder-manager.render.test.ts +0 -31
  54. package/src/components/folder-mutation-dialog.render.test.ts +0 -83
  55. package/src/components/folder-rename-dialog.render.test.ts +0 -14
  56. package/src/components/folder-row.render.test.ts +0 -30
  57. package/src/components/folder-sync-state.test.ts +0 -61
  58. package/src/components/folder-tree-picker.create.test.ts +0 -30
  59. package/src/components/folder-tree-picker.render.test.ts +0 -35
  60. package/src/components/intelligence-calendar-fixtures.ts +0 -2
  61. package/src/components/intelligence-calendar.render.test.ts +0 -4
  62. package/src/components/intelligence-panel.render.test.ts +1 -62
  63. package/src/components/intelligence-panel.stories.tsx +0 -76
  64. package/src/components/intelligence-panel.tab-strip.test.ts +0 -1
  65. package/src/components/intelligence-panel.tsx +6 -176
  66. package/src/components/intelligence-toggle.render.test.ts +0 -5
  67. package/src/components/isolated-email-frame.render.test.ts +0 -122
  68. package/src/components/isolated-email-frame.tsx +1 -1
  69. package/src/components/keyboard-hint-bar.render.test.ts +0 -7
  70. package/src/components/label-chip.render.test.ts +0 -28
  71. package/src/components/label-chip.tsx +1 -1
  72. package/src/components/mail-header.render.test.ts +0 -20
  73. package/src/components/mcp-connected-apps-page.stories.tsx +58 -0
  74. package/src/components/mcp-connected-apps-page.tsx +79 -0
  75. package/src/components/mcp-consent-page.stories.tsx +39 -0
  76. package/src/components/mcp-consent-page.tsx +47 -0
  77. package/src/components/mcp-device-page.stories.tsx +57 -0
  78. package/src/components/mcp-device-page.tsx +107 -0
  79. package/src/components/mcp-error-notice.stories.tsx +34 -0
  80. package/src/components/mcp-error-notice.tsx +23 -0
  81. package/src/components/mcp-error-page.stories.tsx +17 -0
  82. package/src/components/mcp-error-page.tsx +15 -0
  83. package/src/components/mcp-fixtures.ts +16 -0
  84. package/src/components/mcp-login-page.stories.tsx +37 -0
  85. package/src/components/mcp-login-page.tsx +58 -0
  86. package/src/components/mcp-page.stories.tsx +27 -0
  87. package/src/components/mcp-page.tsx +35 -0
  88. package/src/components/mcp-permission-list.stories.tsx +21 -0
  89. package/src/components/mcp-permission-list.tsx +22 -0
  90. package/src/components/message-body-view.render.test.ts +0 -21
  91. package/src/components/message-list-pane.brief-filter.test.ts +0 -6
  92. package/src/components/message-list-pane.render.test.ts +0 -54
  93. package/src/components/message-list-state.render.test.ts +0 -84
  94. package/src/components/{quarantine-bug-dialog.tsx → message-report-dialog.tsx} +9 -14
  95. package/src/components/message-row.render.test.ts +1 -98
  96. package/src/components/mobile-message-action-bar.render.test.ts +0 -59
  97. package/src/components/mobile-reading-pane.render.test.ts +0 -48
  98. package/src/components/mobile-search-view.render.test.ts +0 -16
  99. package/src/components/mobile-search-view.stories.tsx +8 -11
  100. package/src/components/mobile-search-view.tsx +1 -1
  101. package/src/components/nav-sidebar.keyboard.test.ts +0 -8
  102. package/src/components/nav-sidebar.render.test.ts +2 -133
  103. package/src/components/new-folder-form.render.test.ts +0 -26
  104. package/src/components/outbox-row.render.test.ts +0 -9
  105. package/src/components/pane-layout.render.test.ts +0 -18
  106. package/src/components/plain-text-editor.mount.test.ts +0 -16
  107. package/src/components/popover-menu.render.test.ts +0 -11
  108. package/src/components/progress-bar.render.test.ts +0 -14
  109. package/src/components/quarantine-report.test.ts +0 -8
  110. package/src/components/quarantine-section.render.test.ts +16 -13
  111. package/src/components/quarantine-section.stories.tsx +11 -8
  112. package/src/components/reading-pane.render.test.ts +2 -106
  113. package/src/components/reading-pane.stories.tsx +3 -0
  114. package/src/components/refresh-button.render.test.ts +0 -9
  115. package/src/components/rescue-from-spam-flow.render.test.ts +0 -24
  116. package/src/components/rich-text-editor.mount.test.ts +0 -19
  117. package/src/components/rich-text-image-node.ts +11 -9
  118. package/src/components/role-appointment-list.render.test.ts +0 -49
  119. package/src/components/role-appointment-prompt.render.test.ts +0 -79
  120. package/src/components/row-actions.render.test.ts +0 -34
  121. package/src/components/search-bar.render.test.ts +0 -44
  122. package/src/components/search-chip-input.render.test.ts +0 -71
  123. package/src/components/search-conversion-notice.stories.tsx +0 -6
  124. package/src/components/search-conversion-notice.tsx +3 -9
  125. package/src/components/search-conversion.render.test.ts +0 -52
  126. package/src/components/search-conversion.ts +2 -18
  127. package/src/components/search-result-row.tsx +5 -26
  128. package/src/components/search-results.render.test.ts +0 -68
  129. package/src/components/search-results.stories.tsx +0 -30
  130. package/src/components/search-results.tsx +1 -1
  131. package/src/components/security-select.render.test.ts +1 -14
  132. package/src/components/selection-top-bar.render.test.ts +0 -180
  133. package/src/components/selection-wizard-fixtures.ts +0 -2
  134. package/src/components/selection-wizard.render.test.ts +7 -212
  135. package/src/components/selection-wizard.stories.tsx +24 -164
  136. package/src/components/selection-wizard.tsx +10 -86
  137. package/src/components/self-update.render.test.ts +0 -113
  138. package/src/components/sender-trust-indicator.render.test.ts +0 -30
  139. package/src/components/shell-top-bar.render.test.ts +0 -31
  140. package/src/components/shell-top-bar.stories.tsx +7 -0
  141. package/src/components/shell-top-bar.tsx +11 -2
  142. package/src/components/slide-panel.render.test.ts +0 -18
  143. package/src/components/suggest-list.render.test.ts +0 -6
  144. package/src/components/swipeable-row.gesture.test.ts +0 -15
  145. package/src/components/swipeable-row.render.test.ts +0 -7
  146. package/src/components/sync-warning-fixtures.ts +22 -0
  147. package/src/components/sync-warning-report.ts +38 -0
  148. package/src/components/sync-warning-row.tsx +51 -0
  149. package/src/components/sync-warning-section.render.test.ts +19 -0
  150. package/src/components/sync-warning-section.stories.tsx +94 -0
  151. package/src/components/sync-warning-section.tsx +56 -0
  152. package/src/components/touch-list-body.render.test.ts +0 -29
  153. package/src/components/wizard.render.test.ts +0 -22
  154. package/src/filter-presets.test.ts +1 -107
  155. package/src/index.ts +40 -30
  156. package/src/lib/compose-language.test.ts +0 -11
  157. package/src/lib/email-render-treatment.test.ts +0 -21
  158. package/src/lib/keymap.test.ts +0 -32
  159. package/src/lib/property-prefill.ts +2 -2
  160. package/src/lib/search-rule.test.ts +0 -4
  161. package/src/lib/search-rule.ts +0 -9
  162. package/src/lib/sender-derivation.ts +3 -5
  163. package/src/lib/use-list-cursor.test.ts +0 -7
  164. package/src/lib/use-list-keyboard.test.ts +0 -14
  165. package/src/lib/use-modal-focus.test.ts +0 -20
  166. package/src/lib/use-selection.hook.test.ts +0 -13
  167. package/src/lib/use-selection.test.ts +0 -101
  168. package/src/lib/wizard-steps.test.ts +18 -79
  169. package/src/lib/wizard-steps.ts +27 -67
  170. package/src/mcp-pages.ts +36 -0
  171. package/src/category-presentation.test.ts +0 -76
  172. package/src/components/account-service-status.render.test.ts +0 -82
  173. package/src/components/app-password-hint.render.test.ts +0 -23
  174. package/src/components/app-top-bar.render.test.ts +0 -59
  175. package/src/components/auth-card.render.test.ts +0 -24
  176. package/src/components/auth-footer.render.test.ts +0 -17
  177. package/src/components/auth-hero.render.test.ts +0 -31
  178. package/src/components/auto-moved-badge.render.test.ts +0 -65
  179. package/src/components/button.render.test.ts +0 -29
  180. package/src/components/calendar-event-chip.render.test.ts +0 -67
  181. package/src/components/calendar-parse-badge.render.test.ts +0 -40
  182. package/src/components/checkbox.render.test.ts +0 -65
  183. package/src/components/compose-form-shell.render.test.ts +0 -106
  184. package/src/components/dialog.render.test.ts +0 -51
  185. package/src/components/field-label.render.test.ts +0 -16
  186. package/src/components/mail-action-toolbar.render.test.ts +0 -43
  187. package/src/components/nav-link-surface.render.test.ts +0 -126
  188. package/src/components/new-folder-action.render.test.ts +0 -44
  189. package/src/components/pane-header.render.test.ts +0 -22
  190. package/src/components/pull-to-refresh.render.test.ts +0 -46
  191. package/src/components/recurrence-scope-prompt.render.test.ts +0 -36
  192. package/src/components/rescue-banner.render.test.ts +0 -32
  193. package/src/components/rescue-candidate-row.render.test.ts +0 -68
  194. package/src/components/search-token-chip.render.test.ts +0 -42
  195. package/src/components/self-update-dot.tsx +0 -32
  196. package/src/components/settings-primitives.render.test.ts +0 -160
  197. package/src/lib/email-layout-clamp.test.ts +0 -139
  198. package/src/lib/label-color.test.ts +0 -25
  199. package/src/lib/semantic-off.ts +0 -20
  200. package/src/stories-viewport-globals.test.ts +0 -77
@@ -19,7 +19,6 @@ import {
19
19
  } from "lucide-react";
20
20
  import { Fragment, type ReactNode, useEffect, useId, useRef } from "react";
21
21
  import { cn } from "../lib/cn.js";
22
- import { semanticOffReason } from "../lib/semantic-off.js";
23
22
  import {
24
23
  backExits,
25
24
  crossAccountMatchReason,
@@ -39,9 +38,8 @@ import {
39
38
  type RunOutcome,
40
39
  type RunState,
41
40
  runCopy,
42
- type SampleEmptyReason,
41
+ SAMPLE_EMPTY_COPY,
43
42
  type StepId,
44
- sampleEmptyCopy,
45
43
  stepIndex,
46
44
  stepLabel,
47
45
  unreadableDraftClauses,
@@ -210,12 +208,10 @@ export interface SelectionSampleProps {
210
208
  /**
211
209
  * The server's count of what the match covers (#477 5.3), carrying whether it
212
210
  * is still moving so nothing commits against a number that is about to change.
213
- * `uncounted` is the widened door, which carries no count until it has run.
211
+ * `uncounted` is the properties door, which carries no count until it has run.
214
212
  */
215
213
  count: MatchCount;
216
214
  label: string;
217
- /** Why there are no rows. Defaults to nothing matching, never to a bare empty state. */
218
- emptyReason?: SampleEmptyReason;
219
215
  /**
220
216
  * The rows are still being fetched. No rows yet is not the same answer as no
221
217
  * rows at all, and "nothing matches" beside a server count that says otherwise
@@ -239,18 +235,17 @@ const sampleFooter = (count: MatchCount, shown: number): string => {
239
235
  * count that came back empty may say nothing matches (#477 3.5).
240
236
  *
241
237
  * A body-text clause is the case that makes the difference load-bearing: the
242
- * vector-free matcher refuses to evaluate it, so there is no count and no rows,
238
+ * organize matcher refuses to evaluate it, so there is no count and no rows,
243
239
  * and "nothing matches this yet" is not merely unexplained but wrong — the rule
244
240
  * matches, once a saved rule is what runs it.
245
241
  */
246
242
  const sampleEmptyLine = (
247
243
  count: MatchCount,
248
- emptyReason: SampleEmptyReason | undefined,
249
244
  loading: boolean | undefined,
250
245
  ): string => {
251
246
  if (loading) return "Fetching the messages this covers…";
252
247
  if (count.status === "error") return count.reason;
253
- return sampleEmptyCopy(emptyReason ?? "noMatch");
248
+ return SAMPLE_EMPTY_COPY;
254
249
  };
255
250
 
256
251
  /**
@@ -262,7 +257,6 @@ export function SelectionSample({
262
257
  messages,
263
258
  count,
264
259
  label,
265
- emptyReason,
266
260
  loading,
267
261
  }: SelectionSampleProps) {
268
262
  return (
@@ -272,7 +266,7 @@ export function SelectionSample({
272
266
  </h2>
273
267
  {messages.length === 0 ? (
274
268
  <p className="px-3 py-4 text-xs text-fg-muted">
275
- {sampleEmptyLine(count, emptyReason, loading)}
269
+ {sampleEmptyLine(count, loading)}
276
270
  </p>
277
271
  ) : (
278
272
  <>
@@ -369,40 +363,20 @@ export interface MatchStepProps {
369
363
  mode: MatchMode;
370
364
  /**
371
365
  * The one account this selection belongs to, absent when it spans several
372
- * (#523). Both widened doors are counted through a preview that account
373
- * answers, so without one they are withheld and the step states the
366
+ * (#523). The properties door is counted through a preview that account
367
+ * answers, so without one it is withheld and the step states the
374
368
  * restriction — the ticked rows are their own match and stay on offer.
375
369
  */
376
370
  accountId?: string;
377
371
  /**
378
- * Answers the door. Typed to the three doors rather than to every mode, so
372
+ * Answers the door. Typed to the doors rather than to every mode, so
379
373
  * no driver can set `escalated` from a screen — the list escalates a
380
374
  * selection, the wizard never does.
381
375
  */
382
376
  onModeChange: (mode: MatchDoor) => void;
383
- /**
384
- * Similar-mail matching cannot run right now. A runtime state, not a property
385
- * of the deployment: the door stays pressable and dimmed.
386
- */
387
- semanticUnavailable?: boolean;
388
- /**
389
- * Semantic search is off on this instance (#1068) — a deployment setting, so
390
- * the door is dimmed for a reason an operator can act on rather than a
391
- * failure the user should retry. It supersedes the runtime copy above.
392
- */
393
- semanticOff?: boolean;
394
- /**
395
- * What the mail server said when the widen was asked to run and failed. A
396
- * failure is a reason the door cannot run, so it dims the door like any other
397
- * — with the server's own words under it rather than a generic line.
398
- */
399
- semanticErrorDetail?: string;
400
- /** The dimmed door was pressed and the senders were filled in instead. */
401
- semanticFallbackTaken?: boolean;
402
- onSemanticFallback: () => void;
403
377
  /**
404
378
  * What the escalated predicate covers, in the words the list escalated it
405
- * with. Read only while the mode is `escalated`, where it replaces the three
379
+ * with. Read only while the mode is `escalated`, where it replaces the
406
380
  * doors: the predicate is the match already.
407
381
  */
408
382
  escalatedScope?: string;
@@ -414,11 +388,6 @@ export function MatchStepBody({
414
388
  mode,
415
389
  accountId,
416
390
  onModeChange,
417
- semanticUnavailable,
418
- semanticOff,
419
- semanticErrorDetail,
420
- semanticFallbackTaken,
421
- onSemanticFallback,
422
391
  escalatedScope,
423
392
  sample,
424
393
  }: MatchStepProps) {
@@ -439,7 +408,6 @@ export function MatchStepBody({
439
408
  }
440
409
  const doors = matchDoorsFor(accountId);
441
410
  const widened = doors.length > 1;
442
- const widenBlocked = semanticOff || semanticUnavailable;
443
411
  return (
444
412
  <>
445
413
  <div className="space-y-2">
@@ -454,38 +422,6 @@ export function MatchStepBody({
454
422
  title={matchDoorLabel("selected", selectedCount)}
455
423
  description={matchDoorHint("selected")}
456
424
  />
457
- {widened && (
458
- <ChoiceCard
459
- selected={mode === "similar"}
460
- unavailable={widenBlocked}
461
- onSelect={
462
- widenBlocked ? onSemanticFallback : () => onModeChange("similar")
463
- }
464
- title={matchDoorLabel("similar", selectedCount)}
465
- description={matchDoorHint("similar")}
466
- >
467
- {semanticOff ? (
468
- <p role="status" className="px-1 text-2xs text-fg-subtle">
469
- {semanticOffReason}
470
- {semanticFallbackTaken && " Matching on the senders instead."}
471
- </p>
472
- ) : (
473
- <>
474
- {semanticErrorDetail && (
475
- <p role="status" className="px-1 text-2xs text-danger">
476
- Couldn't find similar messages: {semanticErrorDetail}
477
- </p>
478
- )}
479
- {semanticFallbackTaken && (
480
- <p role="status" className="px-1 text-2xs text-fg-subtle">
481
- Similar-mail matching is unavailable right now — matching on
482
- the senders instead.
483
- </p>
484
- )}
485
- </>
486
- )}
487
- </ChoiceCard>
488
- )}
489
425
  {widened && (
490
426
  <ChoiceCard
491
427
  selected={mode === "properties"}
@@ -525,8 +461,6 @@ export interface PropertiesStepProps {
525
461
  clauseSuggestions?: readonly Suggestion[];
526
462
  /** What converting a search left behind, when a query is what opened this. */
527
463
  conversionNotice?: SearchConversionNotice;
528
- /** The similar door was dimmed and these are the senders it fell back to. */
529
- semanticFallbackTaken?: boolean;
530
464
  sample: SelectionSampleProps;
531
465
  }
532
466
 
@@ -549,19 +483,11 @@ export function PropertiesStepBody({
549
483
  clauseFields,
550
484
  clauseSuggestions,
551
485
  conversionNotice,
552
- semanticFallbackTaken,
553
486
  sample,
554
487
  }: PropertiesStepProps) {
555
488
  const join = matchJoinWord(matchOperator);
556
489
  return (
557
490
  <div className="space-y-4">
558
- {semanticFallbackTaken && (
559
- <p role="status" className="px-1 text-xs text-fg-muted">
560
- Similar-mail matching is unavailable right now. These are the senders
561
- of the messages you picked.
562
- </p>
563
- )}
564
-
565
491
  {conversionNotice && (
566
492
  <SearchConversionNoticeView notice={conversionNotice} />
567
493
  )}
@@ -701,9 +627,7 @@ export function FolderStepBody({
701
627
  export interface RuleStepProps {
702
628
  /**
703
629
  * The rule so far. The scope and its stop date are answered here; the rest is
704
- * read, because whether a one-time apply can serve this rule depends on what
705
- * is matching it — a body-text clause is unreadable under the literal matcher
706
- * and perfectly readable under the semantic widen.
630
+ * read, because a body-text clause is unreadable to a one-time apply.
707
631
  */
708
632
  draft: WizardDraft;
709
633
  onScopeChange: (scope: RuleScope) => void;
@@ -10,7 +10,6 @@ import {
10
10
  updateWaitNote,
11
11
  } from "./self-update.js";
12
12
  import { SelfUpdateConfirmDialog } from "./self-update-confirm-dialog.js";
13
- import { UpdateAvailableDot } from "./self-update-dot.js";
14
13
  import {
15
14
  SelfUpdateProgressOverlay,
16
15
  SelfUpdateUnreachableScreen,
@@ -58,15 +57,6 @@ describe("SelfUpdateSection", () => {
58
57
  assert.doesNotMatch(html, /role="alert"/);
59
58
  });
60
59
 
61
- it("names the automatic rollback before the user commits", () => {
62
- const html = section({
63
- status: "available",
64
- version: CURRENT,
65
- release: demoRelease,
66
- });
67
- assert.match(html, /restored on its own/);
68
- });
69
-
70
60
  it("keeps a failed check separate from a failed update", () => {
71
61
  const html = section({
72
62
  status: "checkFailed",
@@ -93,18 +83,6 @@ describe("SelfUpdateSection", () => {
93
83
  assert.match(html, /remit logs --since 10m/);
94
84
  });
95
85
 
96
- it("attributes the rollback to the server rather than asserting it", () => {
97
- const html = section({
98
- status: "rolledBack",
99
- runId: demoRunId,
100
- version: CURRENT,
101
- attemptedVersion: "0.9.4",
102
- reason: "migration 0042 failed",
103
- logsCommand: demoLogsCommand,
104
- });
105
- assert.match(html, /Remit reports that it put 0\.9\.3 back/);
106
- });
107
-
108
86
  it("never claims data survived a failed update", () => {
109
87
  const html = section({
110
88
  status: "rolledBack",
@@ -146,19 +124,6 @@ describe("SelfUpdateSection", () => {
146
124
  );
147
125
  });
148
126
 
149
- it("offers a way forward from every failure", () => {
150
- const rolledBack = section({
151
- status: "rolledBack",
152
- runId: demoRunId,
153
- version: CURRENT,
154
- attemptedVersion: "0.9.4",
155
- reason: "boom",
156
- logsCommand: demoLogsCommand,
157
- });
158
- assert.match(rolledBack, /Try 0\.9\.4 again/);
159
- assert.match(rolledBack, /Stay on 0\.9\.3/);
160
- });
161
-
162
127
  it("keeps the check control pressable while a check is running", () => {
163
128
  const html = section({ status: "checking", version: CURRENT });
164
129
  assert.match(html, /Check again/);
@@ -175,15 +140,6 @@ describe("SelfUpdateSection", () => {
175
140
  assert.doesNotMatch(html, /role="alert"/);
176
141
  });
177
142
 
178
- it("shows the last-checked time on a never-checked state when one is known", () => {
179
- const html = section({
180
- status: "neverChecked",
181
- version: "unknown",
182
- lastCheckedAt: NOW - 3_600_000,
183
- });
184
- assert.match(html, /Last checked/);
185
- });
186
-
187
143
  it("renders a failed rollback verbatim and never claims a version is running", () => {
188
144
  const html = section({
189
145
  status: "rollbackFailed",
@@ -251,29 +207,6 @@ describe("SelfUpdateConfirmDialog", () => {
251
207
  assert.match(html, /restored automatically/);
252
208
  });
253
209
 
254
- it("always offers the way back", () => {
255
- assert.match(html, /Not now/);
256
- });
257
-
258
- it("renders nothing when closed", () => {
259
- assert.equal(
260
- renderToString(
261
- createElement(SelfUpdateConfirmDialog, {
262
- open: false,
263
- currentVersion: CURRENT,
264
- release: demoRelease,
265
- onClose: noop,
266
- onConfirm: noop,
267
- }),
268
- ),
269
- "",
270
- );
271
- });
272
-
273
- it("says nothing about a migration by default", () => {
274
- assert.doesNotMatch(html, /updates the database/);
275
- });
276
-
277
210
  it("warns about a migration only when the release carries one", () => {
278
211
  const withMigration = render(
279
212
  createElement(SelfUpdateConfirmDialog, {
@@ -291,18 +224,6 @@ describe("SelfUpdateConfirmDialog", () => {
291
224
  });
292
225
 
293
226
  describe("SelfUpdateProgressOverlay", () => {
294
- it("tells the user the disconnection is expected", () => {
295
- const html = render(
296
- createElement(SelfUpdateProgressOverlay, {
297
- target: "0.9.4",
298
- phase: "restarting",
299
- elapsedSeconds: 20,
300
- }),
301
- );
302
- assert.match(html, /no server to talk to/);
303
- assert.match(html, /Waiting for Remit to answer again/);
304
- });
305
-
306
227
  it("stops promising a minute once a minute has passed", () => {
307
228
  assert.match(updateWaitNote(30), /about a minute/);
308
229
  assert.doesNotMatch(updateWaitNote(200), /about a minute/);
@@ -316,19 +237,6 @@ describe("SelfUpdateProgressOverlay", () => {
316
237
  }
317
238
  });
318
239
 
319
- it("blocks the window rather than its nearest positioned ancestor", () => {
320
- const html = render(
321
- createElement(SelfUpdateProgressOverlay, {
322
- target: "0.9.4",
323
- phase: "restarting",
324
- elapsedSeconds: 20,
325
- }),
326
- );
327
- assert.match(html, /fixed inset-0/);
328
- assert.doesNotMatch(html, /absolute inset-0/);
329
- assert.match(html, /aria-modal="true"/);
330
- });
331
-
332
240
  it("scopes the live region to the line that changes", () => {
333
241
  const html = render(
334
242
  createElement(SelfUpdateProgressOverlay, {
@@ -357,25 +265,4 @@ describe("SelfUpdateUnreachableScreen", () => {
357
265
  assert.match(html, /aria-modal="true"/);
358
266
  assert.match(html, /cannot confirm that from here/);
359
267
  });
360
-
361
- it("points at the machine that can answer", () => {
362
- assert.match(html, /remit logs --since 10m/);
363
- assert.match(html, /Try connecting again/);
364
- });
365
- });
366
-
367
- describe("UpdateAvailableDot", () => {
368
- it("carries a label for assistive tech when shown", () => {
369
- const html = renderToString(
370
- createElement(UpdateAvailableDot, { show: true }, null),
371
- );
372
- assert.match(html, /Update available/);
373
- });
374
-
375
- it("adds nothing when there is no update", () => {
376
- const html = renderToString(
377
- createElement(UpdateAvailableDot, { show: false }, null),
378
- );
379
- assert.doesNotMatch(html, /Update available/);
380
- });
381
268
  });
@@ -34,34 +34,4 @@ describe("SenderTrustIndicator", () => {
34
34
  );
35
35
  assert.match(html, /aria-label="VIP sender"/);
36
36
  });
37
-
38
- it("renders the new-sender pill only at md", () => {
39
- assert.match(
40
- renderToString(
41
- createElement(SenderTrustIndicator, {
42
- senderTrust: "unknown",
43
- size: "md",
44
- }),
45
- ),
46
- /First message from this sender/,
47
- );
48
- assert.equal(
49
- renderToString(
50
- createElement(SenderTrustIndicator, {
51
- senderTrust: "unknown",
52
- size: "sm",
53
- }),
54
- ),
55
- "",
56
- );
57
- });
58
-
59
- it("renders nothing for wellknown", () => {
60
- assert.equal(
61
- renderToString(
62
- createElement(SenderTrustIndicator, { senderTrust: "wellknown" }),
63
- ),
64
- "",
65
- );
66
- });
67
37
  });
@@ -37,37 +37,6 @@ const render = (overrides: Partial<ShellTopBarProps> = {}): string =>
37
37
  );
38
38
 
39
39
  describe("ShellTopBar", () => {
40
- it("carries compose, bug report, settings, refresh and the account, in that order", () => {
41
- const html = render();
42
- const compose = html.indexOf('aria-label="Compose"');
43
- const bug = html.indexOf('aria-label="Report a bug"');
44
- const settings = html.indexOf('aria-label="Settings"');
45
- const refresh = html.indexOf('data-testid="refresh"');
46
- const account = html.indexOf('data-testid="account"');
47
- assert.ok(
48
- compose > -1 && bug > -1 && settings > -1 && refresh > -1 && account > -1,
49
- );
50
- assert.ok(
51
- compose < bug &&
52
- bug < settings &&
53
- settings < refresh &&
54
- refresh < account,
55
- "actions render in reading order",
56
- );
57
- });
58
-
59
- it("carries exactly these aria-labelled elements and nothing else — the refresh control and account slot are opaque children, named by whatever the caller passes in", () => {
60
- const labels = [...render().matchAll(/aria-label="([^"]+)"/g)].map(
61
- (match) => match[1],
62
- );
63
- assert.deepEqual(labels, [
64
- "Search mail",
65
- "Compose",
66
- "Report a bug",
67
- "Settings",
68
- ]);
69
- });
70
-
71
40
  it("words the compose tooltip around the host's bare key", () => {
72
41
  assert.match(render({ composeShortcut: "c" }), /title="Compose \(c\)"/);
73
42
  });
@@ -37,10 +37,12 @@ const Bar = ({
37
37
  initialChips,
38
38
  scope = "global",
39
39
  refreshState = "idle",
40
+ settingsAttention,
40
41
  }: {
41
42
  initialChips?: SearchChip[];
42
43
  scope?: ShellSearchScope;
43
44
  refreshState?: RefreshControlState;
45
+ settingsAttention?: string;
44
46
  }) => {
45
47
  const [chips, setChips] = useState<SearchChip[] | undefined>(initialChips);
46
48
  const [value, setValue] = useState("");
@@ -61,6 +63,7 @@ const Bar = ({
61
63
  onCompose={() => undefined}
62
64
  onReportBug={() => undefined}
63
65
  onOpenSettings={() => undefined}
66
+ settingsAttention={settingsAttention}
64
67
  composeShortcut="c"
65
68
  refreshControl={<GlobalRefresh state={refreshState} />}
66
69
  account={<Account />}
@@ -143,6 +146,10 @@ export const RefreshFailed: Story = {
143
146
  render: () => <Bar refreshState="error" />,
144
147
  };
145
148
 
149
+ export const SettingsAttention: Story = {
150
+ render: () => <Bar settingsAttention="Sync warnings" />,
151
+ };
152
+
146
153
  /** The arrangement: one bar across the top of the shell, over every pane. */
147
154
  export const OverTheLayout: Story = {
148
155
  render: () => (
@@ -25,6 +25,7 @@
25
25
  import { Bug, Settings, SquarePen } from "lucide-react";
26
26
  import type { ReactNode } from "react";
27
27
  import { AppTopBar } from "./app-top-bar.js";
28
+ import { AttentionDot } from "./attention-dot.js";
28
29
  import { Button } from "./button.js";
29
30
  import { NavToggleButton } from "./nav-toggle-button.js";
30
31
  import { SearchBar } from "./search-bar.js";
@@ -59,6 +60,7 @@ export interface ShellTopBarProps {
59
60
  onCompose: () => void;
60
61
  onReportBug: () => void;
61
62
  onOpenSettings: () => void;
63
+ settingsAttention?: string;
62
64
  /**
63
65
  * The key that composes, as the host's keymap reads it — `c`, `⌘N`,
64
66
  * `g then b`. The tooltip's wording around it is this component's.
@@ -82,6 +84,7 @@ export function ShellTopBar({
82
84
  onCompose,
83
85
  onReportBug,
84
86
  onOpenSettings,
87
+ settingsAttention,
85
88
  composeShortcut,
86
89
  refreshControl,
87
90
  account,
@@ -121,9 +124,15 @@ export function ShellTopBar({
121
124
  <Button
122
125
  variant="ghost"
123
126
  size="sm"
124
- icon={<Settings className="size-4" />}
127
+ icon={
128
+ <AttentionDot label={settingsAttention}>
129
+ <Settings className="size-4" />
130
+ </AttentionDot>
131
+ }
125
132
  title="Settings"
126
- aria-label="Settings"
133
+ aria-label={
134
+ settingsAttention ? `Settings — ${settingsAttention}` : "Settings"
135
+ }
127
136
  onClick={onOpenSettings}
128
137
  />
129
138
  {refreshControl}
@@ -34,19 +34,6 @@ const scrim = (html: string): string => {
34
34
  };
35
35
 
36
36
  describe("SlidePanel (#57)", () => {
37
- it("is a fixed right-edge column, never a full-viewport takeover above sm", () => {
38
- const html = render(true);
39
- assert.match(html, /fixed top-0 right-0/);
40
- assert.match(html, /sm:w-\[400px\]/);
41
- assert.match(html, /translate-x-0/);
42
- });
43
-
44
- it("a closed panel is off-canvas and takes no pointer events", () => {
45
- const html = render(false);
46
- assert.match(html, /translate-x-full/);
47
- assert.match(html, /pointer-events-none/);
48
- });
49
-
50
37
  it("a closed panel is inert and hidden from assistive tech", () => {
51
38
  const tag = dialog(render(false));
52
39
  assert.match(tag, /inert=""/);
@@ -60,11 +47,6 @@ describe("SlidePanel (#57)", () => {
60
47
  assert.match(tag, /role="dialog"/);
61
48
  });
62
49
 
63
- it("scrolls its body rather than the page", () => {
64
- const html = render(true);
65
- assert.match(html, /overflow-auto/);
66
- });
67
-
68
50
  /**
69
51
  * The scrim is a pointer shortcut for the header's Close button, not a
70
52
  * control of its own: posing as a focusable button while answering only
@@ -45,12 +45,6 @@ describe("SuggestList", () => {
45
45
  assert.match(render(), /rides@lyft\.com/);
46
46
  });
47
47
 
48
- it("shows the hint and where a suggestion came from", () => {
49
- const html = render();
50
- assert.match(html, /Stripe/);
51
- assert.match(html, /selected/);
52
- });
53
-
54
48
  it("marks only the highlighted option as selected", () => {
55
49
  const html = render({ activeIndex: 1 });
56
50
  assert.equal(html.match(/aria-selected="true"/g)?.length, 1);
@@ -346,21 +346,6 @@ describe("SwipeableRow gesture wiring", () => {
346
346
  assert.deepEqual(peeks, []);
347
347
  });
348
348
 
349
- it("a press cancelled before the hold fires no long press", async () => {
350
- let longPressed = 0;
351
- const row = mount({
352
- onLongPress: () => longPressed++,
353
- onOpen: () => undefined,
354
- onPeek: () => undefined,
355
- });
356
-
357
- pointerDown(row);
358
- pointerCancel(row);
359
- await wait(THRESHOLD_WAIT);
360
-
361
- assert.equal(longPressed, 0);
362
- });
363
-
364
349
  it("suppresses the native context menu raised over a drifting hold", async () => {
365
350
  // Android Chrome raises its own menu at its own threshold, which can land
366
351
  // mid-drift and ahead of the app's long press.
@@ -35,13 +35,6 @@ function render(peek: SwipePeek, override?: Partial<typeof baseProps>) {
35
35
  }
36
36
 
37
37
  describe("SwipeableRow", () => {
38
- it("renders no action background at rest", () => {
39
- const html = render("none");
40
- assert.doesNotMatch(html, /bg-danger/);
41
- assert.doesNotMatch(html, /bg-accent-2(?!-soft)/);
42
- assert.doesNotMatch(html, /aria-label="Delete message"/);
43
- });
44
-
45
38
  it("reveals the delete action when peeked trailing", () => {
46
39
  const html = render("trailing");
47
40
  assert.match(html, /aria-label="Delete message"/);
@@ -0,0 +1,22 @@
1
+ import type { SyncWarningEntry } from "./sync-warning-report.js";
2
+
3
+ export const syncWarningDemoEntries: readonly SyncWarningEntry[] = [
4
+ {
5
+ syncWarningId: "w-1",
6
+ uid: 51_002,
7
+ stage: "Body",
8
+ state: "GaveUp",
9
+ attempts: 3,
10
+ createdAt: Date.parse("2026-10-17T08:12:00Z"),
11
+ folderLabel: "Inbox",
12
+ },
13
+ {
14
+ syncWarningId: "w-2",
15
+ uid: 50_874,
16
+ stage: "Header",
17
+ state: "Retrying",
18
+ attempts: 7,
19
+ createdAt: Date.parse("2026-10-16T21:40:00Z"),
20
+ folderLabel: "Receipts",
21
+ },
22
+ ];
@@ -0,0 +1,38 @@
1
+ import type { SyncWarningStage, SyncWarningState } from "@remit/domain-enums";
2
+
3
+ export interface SyncWarningEntry {
4
+ syncWarningId: string;
5
+ uid: number;
6
+ stage: (typeof SyncWarningStage)[keyof typeof SyncWarningStage];
7
+ state: (typeof SyncWarningState)[keyof typeof SyncWarningState];
8
+ attempts: number;
9
+ createdAt: number;
10
+ folderLabel: string;
11
+ }
12
+
13
+ const summaries: Record<SyncWarningEntry["state"], string> = {
14
+ Retrying: "The message could not be synced. Remit tries again every sync.",
15
+ GaveUp: "The message body could not be downloaded. Remit has stopped trying.",
16
+ };
17
+
18
+ export function syncWarningSummary(entry: SyncWarningEntry): string {
19
+ return summaries[entry.state];
20
+ }
21
+
22
+ const SYNC_WARNING_REPORT_DISCLAIMER =
23
+ "_No message content, addresses, subject, folder name or error text are included._";
24
+
25
+ export function formatSyncWarningReport(entry: SyncWarningEntry): string {
26
+ return [
27
+ `### Message failed to sync at \`${entry.stage}\``,
28
+ "",
29
+ `- **State**: \`${entry.state}\``,
30
+ `- **Attempts**: ${entry.attempts}`,
31
+ "",
32
+ SYNC_WARNING_REPORT_DISCLAIMER,
33
+ ].join("\n");
34
+ }
35
+
36
+ export function syncWarningIssueTitle(entry: SyncWarningEntry): string {
37
+ return `Message failed to sync: ${entry.state} at ${entry.stage}`;
38
+ }