@remit/web-client 0.0.78 → 0.0.79

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.78",
3
+ "version": "0.0.79",
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": {
@@ -12,6 +12,7 @@ const make = (
12
12
  hasStars: boolean,
13
13
  ): RemitImapThreadMessageResponse => ({
14
14
  senderTrust: "unknown",
15
+ category: "uncategorized",
15
16
  threadId: "t1",
16
17
  threadMessageId: `tm-${messageId}`,
17
18
  messageId,
@@ -77,6 +77,7 @@ describe("patchDescribeMessage", () => {
77
77
  cc: [],
78
78
  bcc: [],
79
79
  replyTo: [],
80
+ category: "uncategorized",
80
81
  senderTrust: "unknown",
81
82
  },
82
83
  flags: [],
@@ -24,6 +24,7 @@ function threadResponse(
24
24
  fromEmail: "sender@example.com",
25
25
  subject: "Subject",
26
26
  snippet: "Snippet",
27
+ category: "uncategorized",
27
28
  sentDate: 1767225600,
28
29
  isRead: false,
29
30
  isDeleted: false,
@@ -16,6 +16,7 @@ function threadMessage(
16
16
  fromEmail: "sender@example.com",
17
17
  subject: "Subject",
18
18
  snippet: "Snippet",
19
+ category: "uncategorized",
19
20
  sentDate: 1767225600,
20
21
  isRead: false,
21
22
  isDeleted: false,
@@ -10,7 +10,10 @@ describe("toDisplayCategory", () => {
10
10
  assert.strictEqual(toDisplayCategory("uncategorized"), "uncategorized");
11
11
  });
12
12
 
13
- test("treats a row with no category as unclassified", () => {
13
+ test("treats an absent category as unclassified", () => {
14
+ // No caller can reach this today — both response fields are required —
15
+ // but an absent category must resolve to `uncategorized`, never to
16
+ // `personal`, wherever one arrives from.
14
17
  assert.strictEqual(toDisplayCategory(undefined), "uncategorized");
15
18
  });
16
19
 
@@ -11,8 +11,10 @@ import type { ThreadCategory } from "@remit/ui";
11
11
  * decided was personal, so a classification gap read as a large personal inbox
12
12
  * rather than as missing work (issue #45).
13
13
  *
14
- * Pre-migration rows that read `undefined` carry no category either, so they
15
- * map to `uncategorized` the same way.
14
+ * Both response fields that feed this are required, so no caller reaches the
15
+ * `undefined` branch. The parameter stays tolerant anyway: this is the one place
16
+ * an absent category is turned into a value, and the answer has to be
17
+ * `uncategorized` rather than a crash or a `personal` default.
16
18
  */
17
19
  export function toDisplayCategory(
18
20
  category: RemitImapMessageCategory | undefined,
@@ -71,6 +71,7 @@ export const makeThreadMessage = (
71
71
  fromEmail: "alice@example.com",
72
72
  sentDate: 1_767_225_600_000,
73
73
  snippet: "",
74
+ category: "uncategorized",
74
75
  isRead: false,
75
76
  hasAttachment: false,
76
77
  star: "none",