Public: anyone can read this; the crew can change it.

Removing a deal, a party or a date asks once before it happens, so a mis-tap in the meeting never loses a deal #70

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Removing a deal, a party or a date from the page now takes two taps, and still works without JavaScript. What changed Confirm step: the three removals use the existing pattern. The summaries read "Remove this deal…", "Remove …" and "Remove this date…".

Notes

shipped production is serving it deploy d2eada7

opened this

Removing a deal, a party or a date from the page now takes two taps, and still works without JavaScript.

What changed

  • Confirm step: the three removals use the existing <details class="confirm"> pattern. The summaries read "Remove this deal…", "Remove <name>…" and "Remove this date…". Opening one shows a line saying what goes, then a Yes, remove button. For a deal the line reads "77 Harbor View Dr, its 6 dates, 4 parties and their messages." Each button's accessible name includes what it removes. The markup is in a new src/pages/confirm.ts, which deal.ts and sheet.ts both use.
  • Handlers: /deals/:id/delete, /parties/:id/remove and /deadlines/:id/remove now refuse a POST without confirm=yes. They answer 422 with the refused page and remove nothing. The deal route didn't read the form before, so it does now. The API DELETE routes, the MCP tools, canRemove and contract.json are untouched.
  • Notices: the notice now names what went: "Removed 77 Harbor View Dr.", "Removed Bo Buyer.", "Removed HOA review." I added a small nameOf helper in src/deals.ts to look up the party or date name before it is removed.
  • CSS: one rule changed in static/app.css. The party row's order rule now targets .confirm, and a new .party-controls > .confirm[open] rule lets an opened confirm take the full row. No new class. docs/design/areas/remove.md records this.
  • README: the steps on removing a party and a date now say it asks once.
  • Audit: the deal-removal audit row is unchanged, and a test asserts exactly one new delete/ok row per removal.
  • Tests: in src/server.test.ts, the party and date tests now assert a refusal with no confirm (and with confirm=no) that leaves the row in place, then a removal with confirm=yes. A new test covers the deal's removal line, accessible name, 422 without confirm, the notice and the 404 afterwards.

Checks

  • bun test src/server.test.ts src/deals.test.ts passes (73 tests). I did not run the full suite.
  • bun x tsc --noEmit only printed its help text, because the repo has no tsconfig.json, so there was no type check.
  • bun scripts/lint-design.ts printed nothing, so I take it as clean.
  • scripts/gate.ts and scripts/fast.ts don't exist in this repo.

Left alone: I kept the edits to the removal forms so the rebase against #62 stays small.

To try it: open a deal you own, tap Remove this deal…, and read the line before confirming. The party Remove <name>… and a custom date's sheet work the same way.

🤖 Generated with Claude Code

Closes #64

commented

Removing a deal, a party or a date from the page now takes two taps, and still works without JavaScript.

What changed

  • Confirm step: the three removals use the existing <details class="confirm"> pattern. The summaries read "Remove this deal…", "Remove <name>…" and "Remove this date…". Opening one shows a line saying what goes, then a Yes, remove button. For a deal the line reads "77 Harbor View Dr, its 6 dates, 4 parties and their messages." Each button's accessible name includes what it removes. The markup is in a new src/pages/confirm.ts, which deal.ts and sheet.ts both use.
  • Handlers: /deals/:id/delete, /parties/:id/remove and /deadlines/:id/remove now refuse a POST without confirm=yes. They answer 422 with the refused page and remove nothing. The deal route didn't read the form before, so it does now. The API DELETE routes, the MCP tools, canRemove and contract.json are untouched.
  • Notices: the notice now names what went: "Removed 77 Harbor View Dr.", "Removed Bo Buyer.", "Removed HOA review." I added a small nameOf helper in src/deals.ts to look up the party or date name before it is removed.
  • CSS: one rule changed in static/app.css. The party row's order rule now targets .confirm, and a new .party-controls > .confirm[open] rule lets an opened confirm take the full row. No new class. docs/design/areas/remove.md records this.
  • README: the steps on removing a party and a date now say it asks once.
  • Audit: the deal-removal audit row is unchanged, and a test asserts exactly one new delete/ok row per removal.
  • Tests: in src/server.test.ts, the party and date tests now assert a refusal with no confirm (and with confirm=no) that leaves the row in place, then a removal with confirm=yes. A new test covers the deal's removal line, accessible name, 422 without confirm, the notice and the 404 afterwards.

Checks

  • bun test src/server.test.ts src/deals.test.ts passes (73 tests). I did not run the full suite.
  • bun x tsc --noEmit only printed its help text, because the repo has no tsconfig.json, so there was no type check.
  • bun scripts/lint-design.ts printed nothing, so I take it as clean.
  • scripts/gate.ts and scripts/fast.ts don't exist in this repo.

Left alone: I kept the edits to the removal forms so the rebase against #62 stays small.

To try it: open a deal you own, tap Remove this deal…, and read the line before confirming. The party Remove <name>… and a custom date's sheet work the same way.

🤖 Generated with Claude Code

Approved

Clean. All three page removals use the existing confirm pattern and refuse a POST without confirm=yes (422, nothing removed). Notices name what went. API DELETE, MCP, canRemove and contract.json are untouched, so no cell is loosened and the actions still go through permit. lint-design passes (the script is lint-design.ts) and the preview serves. Minor: nameOf reads a name without permit, but only to word the notice after a removal that succeeded.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs