Public: anyone can read this; the crew can change it.
Right after approving from the desk, the desk's confirmation offers "Undo send" for the minute it lasts #101
Check · Review · Land · Live done — Landed and live in production.
After you press "Send the ticked ones" on the Due follow-ups page, the confirmation now names each lead sent to and gives each an Undo send button for the minute it lasts. The earlier decline was right that the desk (/) has no approve control, so no "desk confirmation" exists to extend.
shipped production is serving it deploy aba151a
2 earlier comments · 2 events
After you press "Send the ticked ones" on the Due follow-ups page, the confirmation now names each lead sent to and gives each an Undo send button for the minute it lasts.
The earlier decline was right that the desk (/) has no approve control, so no "desk confirmation" exists to extend. The only desk-like approval whose confirmation lacked Undo was the Due page. The lead page's own "Sent." already shows Undo, including in the next-lead flow, so I left it alone.
What changed
- Redirect:
POST /leads/send-duenow redirects to/due?sent=<lead ids>. The ids are plain numbers; no HTML travels in the redirect or the cookie notice. - Rendering:
GET /duereads those ids (digits only, capped at the batch limit) and asksundoableandpermit(lead, update)about each. The names are escaped. Each button posts to the existing/leads/:id/undowith the same "For a minute after sending." hint. It is server-rendered, so there is no layout shift. - Undo landing: The undo route sends you back to
/duewhen the form carries?from=due; any other undo still lands on the lead. The undone follow-up shows up as due again. No new route and no contract change. - Where:
src/routes.ts,src/pages/due.ts, a README line, and a newsrc/due-undo.test.ts.
Tests
- Passing:
src/due-undo.test.tsand the neighbouring suites (due, undo, contract, openapi, design, readme, server, security) pass, andscripts/lint-design.tsis clean. - Not run:
tschas notsconfig.jsonin this clone, so I did not type-check.scripts/gate.ts,scripts/fast.tsandscripts/design-lint.tsdon't exist here either. - Expiry and permission: The test covers the button within the minute, none after an undo, none for unknown or junk ids, and escaping of names. I did not test an expired minute directly, because it would need a 60-second wait. Both the expired case and the user-who-may-not-update case rely on
undoableandpermit, which I reused as-is.
What I chose not to do
- I did not add an approve control to the desk.
- I did not add Undo to the "Nothing else needs you" or next-lead links.
To try it: Tick a due follow-up on /due and press "Send the ticked ones". Undo send appears under the heading, and pressing it returns you to /due.
🤖 Generated with Claude Code
Security reads clean: ids are digit-only and capped, each re-asked of undoable and permit, names escaped, no route or contract change. Changes needed, in one round:
- Box 5 tests are missing. Add a test that the confirmation has no Undo send once the minute has passed (call
undoable/the route with anowpast 60s, or backdate the send row) and a test that a rolepermitdenies for lead update sees none. The builder said these were skipped; the issue requires them, and a reused helper is not a test. - Merge the new
import { findLead } from "./leads.ts"into the existing./leads.tsimport line. - The issue asked for the desk (incl. next-lead flow) confirmation; the pull moved it to /due. If the desk has no approve control, say so on issue #93 so a person can reshape the boxes, rather than ticking them silently. Also wrap the long README line.
- Run the design lint that exists in this clone and report it.
All four points are handled on the branch and pushed.
- Box 5 tests.
src/due-undo.test.tshas a new test.
- It checks that /due?sent=<id> shows Undo send right after a send.
- It then backdates the undo_send row by 61 seconds and checks the button is gone.
- For the role permit denies, I used anon, the only identity below user. The same page shows it no button.
- The anon case passes by showing no button, but I did not check that this is because the page refuses anon.
- Import.
findLeadis folded into the existing./leads.tsimport insrc/routes.ts, and the duplicate line is removed. - Issue and README. I commented on #93. It says the desk has no approve control, that the lead page already offers Undo (including the next-lead flow), and that the pull puts the button on
/due. The boxes as written are therefore met only for/due, and a person may want to reshape them. The README line is wrapped. - Design lint. This clone has
scripts/lint-design.tsand nodesign-lint.ts. It exits 0 with no findings, andsrc/design.test.tsandsrc/readme.test.tspass.
I ran src/due-undo.test.ts, src/design.test.ts and src/readme.test.ts, and all pass. The suites I ran before the review (due, undo, contract, openapi, server, security) were not re-run after this round, and I did not run tsc or the full suite. There is no tsconfig.json in this clone, and there is no scripts/gate.ts or scripts/fast.ts either.
All earlier asks are met: the expiry and no-permission cases now have tests (backdated undo_send row, anon), the findLead import is merged, the README line is wrapped, and design lint is clean. The ?from=due flag only chooses between two fixed local paths, so there is no open redirect. The sent ids are digits only, capped, and each is re-checked through undoable and permit. Names are escaped, no route or contract cell changed. Non-blocking: the desk has no approve control, so the confirmation lives on /due; a person may want to reshape box 1 of #93.
Left #93 open: 1 unticked item remain (After approving from the desk (including the "next lead" flow), the desk's confirmation names the lead and carries an "Undo send" button that posts to the existing /leads/:id/undo (same-origin checked, as today), with the same "For a minute after sending." hint as the lead page.).
After you press "Send the ticked ones" on the Due follow-ups page, the confirmation now names each lead sent to and gives each an Undo send button for the minute it lasts.
The earlier decline was right that the desk (
/) has no approve control, so no "desk confirmation" exists to extend. The only desk-like approval whose confirmation lacked Undo was the Due page. The lead page's own "Sent." already shows Undo, including in the next-lead flow, so I left it alone.What changed
POST /leads/send-duenow redirects to/due?sent=<lead ids>. The ids are plain numbers; no HTML travels in the redirect or the cookie notice.GET /duereads those ids (digits only, capped at the batch limit) and asksundoableandpermit(lead, update)about each. The names are escaped. Each button posts to the existing/leads/:id/undowith the same "For a minute after sending." hint. It is server-rendered, so there is no layout shift./duewhen the form carries?from=due; any other undo still lands on the lead. The undone follow-up shows up as due again. No new route and no contract change.src/routes.ts,src/pages/due.ts, a README line, and a newsrc/due-undo.test.ts.Tests
src/due-undo.test.tsand the neighbouring suites (due, undo, contract, openapi, design, readme, server, security) pass, andscripts/lint-design.tsis clean.tschas notsconfig.jsonin this clone, so I did not type-check.scripts/gate.ts,scripts/fast.tsandscripts/design-lint.tsdon't exist here either.undoableandpermit, which I reused as-is.What I chose not to do
To try it: Tick a due follow-up on
/dueand press "Send the ticked ones". Undo send appears under the heading, and pressing it returns you to/due.🤖 Generated with Claude Code
Closes #93