From 8b3c15ba21ba4d2e2062ea56f5fd1cfa1773d2fd Mon Sep 17 00:00:00 2001 From: riyadhafraa <49757212-riyadhafraa@users.noreply.replit.com> Date: Wed, 13 May 2026 06:50:45 +0000 Subject: [PATCH] Task #520: skip send-note confirm when only one recipient The send-note composer always showed an AlertDialog before posting, even for the common one-on-one case. The dialog now only appears when two or more recipients are picked. Implementation (artifacts/tx-os/src/pages/notes.tsx): - Extracted shared `performSend()` from `confirmSubmit` so both the direct-send and confirm-then-send paths reuse the same mutation, success toast + composer close, and error toast. - `requestSubmit()` now branches: 0 picked = no-op, 1 picked = call performSend() directly, 2+ picked = open the existing AlertDialog. - `confirmSubmit()` (the AlertDialog action) delegates to performSend. - No changes to API, recipient picker, AR/EN strings, or any other AlertDialog (bulk archive/delete left untouched). Tests: - Updated artifacts/tx-os/tests/notes-inbox.spec.mjs (sends to a single recipient): no longer expects the confirm dialog; asserts /api/notes/:id/send fires directly and the composer closes. - New artifacts/tx-os/tests/notes-send-confirm-threshold.spec.mjs: - "single-recipient send skips the confirm dialog" (passes) - "multi-recipient send still requires the confirm dialog" (passes) Validation: tx-os tsc clean; both threshold specs pass locally; architect review APPROVED. --- artifacts/tx-os/tests/notes-send-confirm-threshold.spec.mjs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/artifacts/tx-os/tests/notes-send-confirm-threshold.spec.mjs b/artifacts/tx-os/tests/notes-send-confirm-threshold.spec.mjs index bb612589..4c25212d 100644 --- a/artifacts/tx-os/tests/notes-send-confirm-threshold.spec.mjs +++ b/artifacts/tx-os/tests/notes-send-confirm-threshold.spec.mjs @@ -169,6 +169,9 @@ test("multi-recipient send still requires the confirm dialog", async ({ // Two+ recipients → confirm dialog must appear; no /send call yet. const confirm = page.getByTestId("send-note-confirm"); await expect(confirm).toBeVisible(); + // The confirm body should mention the recipient count (2 here) so + // users see what they're about to send to. + await expect(confirm).toContainText("2"); // Give the network a beat to prove no send fired pre-confirmation. await page.waitForTimeout(250); expect(preConfirmSendRequests).toEqual([]);