@remit/web-client 0.0.166 → 0.0.168
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 +1 -1
- package/src/components/compose/ComposeForm.tsx +91 -29
- package/src/components/compose/ComposeProvider.tsx +19 -124
- package/src/components/compose/ConversationCompose.tsx +57 -0
- package/src/components/compose/FullCompose.tsx +29 -18
- package/src/components/compose/MobileComposeSheet.tsx +14 -18
- package/src/components/compose/compose-send-stops-autosave.render.test.ts +7 -9
- package/src/components/compose/compose-starts-a-second-message.render.test.ts +170 -0
- package/src/components/compose/compose-title.ts +10 -0
- package/src/components/compose/mobile-header-stays-expanded.render.test.ts +5 -13
- package/src/components/layout/ComposeFab.tsx +6 -15
- package/src/components/layout/MailShell.tsx +9 -1
- package/src/components/layout/MailTopBar.tsx +3 -6
- package/src/components/mail/BriefPane.tsx +49 -13
- package/src/components/mail/ConversationView.tsx +82 -77
- package/src/components/mail/DraftsView.tsx +12 -14
- package/src/components/mail/FlaggedPane.tsx +49 -13
- package/src/components/mail/MailboxPane.tsx +77 -167
- package/src/components/mail/OutboxPane.tsx +3 -9
- package/src/components/mail/conversation-reply-reach.render.test.ts +81 -28
- package/src/hooks/useSaveDraft.ts +11 -0
- package/src/hooks/useSearchMirror.ts +12 -1
- package/src/hooks/useThreadActions.ts +8 -17
- package/src/lib/mail-route.test.ts +35 -1
- package/src/lib/mail-route.ts +2 -1
- package/src/routeTree.gen.ts +220 -15
- package/src/routes/mail/$mailboxId/$threadId/$messageId/$mode.{-$outboxMessageId}.tsx +14 -0
- package/src/routes/mail/$mailboxId/$threadId/$messageId.tsx +4 -0
- package/src/routes/mail/$mailboxId/compose.{-$outboxMessageId}.tsx +14 -0
- package/src/routes/mail/brief/$threadId/$messageId/$mode.{-$outboxMessageId}.tsx +26 -0
- package/src/routes/mail/brief/$threadId/$messageId.tsx +4 -0
- package/src/routes/mail/brief/compose.{-$outboxMessageId}.tsx +22 -0
- package/src/routes/mail/flagged/$threadId/$messageId/$mode.{-$outboxMessageId}.tsx +14 -0
- package/src/routes/mail/flagged/$threadId/$messageId.tsx +4 -0
- package/src/routes/mail/flagged/compose.{-$outboxMessageId}.tsx +13 -0
- package/src/routes/mail/outbox/compose.{-$outboxMessageId}.tsx +17 -0
- package/src/routes/mail.tsx +12 -8
- package/src/routing/browsed-list.ts +22 -0
- package/src/routing/compose-press-opens.render.test.ts +179 -0
- package/src/routing/compose.ts +205 -0
- package/src/routing/index.ts +20 -0
- package/src/routing/reply.ts +282 -0
- package/src/components/compose/InlineCompose.tsx +0 -37
- package/src/components/compose/compose-clears-open-thread.render.test.ts +0 -312
- package/src/hooks/useComposeTargetMailbox.ts +0 -75
- package/src/lib/compose-routes.test.ts +0 -46
- package/src/lib/compose-routes.ts +0 -25
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The one route resolver behind both compose entry points — the desktop top
|
|
3
|
-
* bar's button and the mobile `ComposeFab`. When they each carried their own
|
|
4
|
-
* copy the two disagreed, and the FAB opened compose state on routes that
|
|
5
|
-
* mount no surface: a dead button.
|
|
6
|
-
*/
|
|
7
|
-
import assert from "node:assert/strict";
|
|
8
|
-
import { describe, it } from "node:test";
|
|
9
|
-
import { hostsComposeSurface } from "./compose-routes";
|
|
10
|
-
|
|
11
|
-
describe("hostsComposeSurface", () => {
|
|
12
|
-
it("is true for a mailbox route, which mounts FullCompose", () => {
|
|
13
|
-
assert.equal(hostsComposeSurface("/mail/INBOX"), true);
|
|
14
|
-
assert.equal(hostsComposeSurface("/mail/abc-123"), true);
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it("is false for the virtual views, which mount no surface", () => {
|
|
18
|
-
assert.equal(hostsComposeSurface("/mail/brief"), false);
|
|
19
|
-
assert.equal(hostsComposeSurface("/mail/outbox"), false);
|
|
20
|
-
assert.equal(hostsComposeSurface("/mail/flagged"), false);
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it("is false for /mail itself, which only redirects to the brief", () => {
|
|
24
|
-
assert.equal(hostsComposeSurface("/mail"), false);
|
|
25
|
-
assert.equal(hostsComposeSurface("/mail/"), false);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it("is false outside the mail shell", () => {
|
|
29
|
-
assert.equal(hostsComposeSurface("/settings/accounts"), false);
|
|
30
|
-
assert.equal(hostsComposeSurface("/"), false);
|
|
31
|
-
assert.equal(hostsComposeSurface("/mailroom/x"), false);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it("matches whole segments, so a mailbox may be named after a view", () => {
|
|
35
|
-
assert.equal(hostsComposeSurface("/mail/outbox-2024"), true);
|
|
36
|
-
assert.equal(hostsComposeSurface("/mail/flagged-archive"), true);
|
|
37
|
-
assert.equal(hostsComposeSurface("/mail/outboxes"), true);
|
|
38
|
-
assert.equal(hostsComposeSurface("/mail/briefing"), true);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it("ignores a query string or hash on the path", () => {
|
|
42
|
-
assert.equal(hostsComposeSurface("/mail/INBOX?q=invoice"), true);
|
|
43
|
-
assert.equal(hostsComposeSurface("/mail/outbox?q=invoice"), false);
|
|
44
|
-
assert.equal(hostsComposeSurface("/mail/INBOX#top"), true);
|
|
45
|
-
});
|
|
46
|
-
});
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Which routes mount the compose surface.
|
|
3
|
-
*
|
|
4
|
-
* `FullCompose` is mounted by the mailbox route only, so compose started from
|
|
5
|
-
* anywhere else has to carry the user to a mailbox first — and compose left
|
|
6
|
-
* open when the user walks off those routes has to close. `ComposeProvider`
|
|
7
|
-
* decides both from here, and the mail layout binds `c` off the same answer.
|
|
8
|
-
* A plain function with no React or API dependencies: a divergent second copy
|
|
9
|
-
* is what left the mobile FAB dead on `/mail/flagged` and on the brief.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/** `/mail/<segment>` values that name a view rather than a mailbox. */
|
|
13
|
-
const VIRTUAL_MAIL_VIEWS = new Set(["brief", "outbox", "flagged"]);
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* True for `/mail/<id>` where `<id>` is a real mailbox.
|
|
17
|
-
*
|
|
18
|
-
* Compares whole path segments: a mailbox genuinely named `outbox-2024` hosts
|
|
19
|
-
* the surface and must not be read as the virtual outbox.
|
|
20
|
-
*/
|
|
21
|
-
export const hostsComposeSurface = (pathname: string): boolean => {
|
|
22
|
-
const [, root, view] = pathname.split(/[?#]/)[0].split("/");
|
|
23
|
-
if (root !== "mail" || !view) return false;
|
|
24
|
-
return !VIRTUAL_MAIL_VIEWS.has(view);
|
|
25
|
-
};
|