Repository navigation
Description
Update, 29 September 2026: checked against the current code. The web app has no Archive button, so its fallback is Delete, not archive. Both open questions on reminders and public page caching are answered, and neither needs work. The phone menu and the MCP close_signup tool need changes too. Two new gotchas are listed under "Open questions": a closing time already in the past, and a race with archive.
Context
Today, closing a signup is a one-way door. The status machine in src/services/signups.ts allows draft → open (publish) and open → closed (close), but there's no closed → open transition. An organizer who accidentally closes a signup, or who closes one early but later wants to extend it, has no recovery. In the web app their only option is to delete it and start over: there is no Archive button there. Archive is only reachable through the REST API (POST /api/signups/[id]/archive) and the MCP archive_signup tool.
The detail header now exposes Close while the signup is open (#19), but a closed signup shows no action at all besides Preview / Export. The status pill says closed and that's the end of it.
Proposed approach
Add a reopenSignup service + API + header button that mirrors the close path:
- Service (
src/services/signups.ts): newreopenSignup(db, actor, id)delegating totransitionStatus(db, actor, id, 'closed', 'open', 'signup.reopened'). Addsignup.reopenedtoACTIVITY_EVENTSinsrc/db/schema/activity.ts, and to theeventTypeunion ontransitionStatus. - API (
src/app/api/signups/[id]/reopen/route.ts): POST handler matching…/close/route.ts. - Action (
src/app/app/(chrome)/signups/[id]/actions.ts):reopenAction(signupId)analogous tocloseAction. - UI (
src/components/signup/SignupHeader.tsx): whenstatus === 'closed', render a Reopen button next to Preview/Export — same brand-fill styling as Publish/Close, mutually exclusive with both.hasActionButtonthere only countsdraftandopenwhen it sets the grid, so it needs the new case too. - Phone menu (
src/components/signup/MobileMoreMenuSheet.tsx): needs the same button. It shows Publish fordraftand Close foropen, and nothing forclosed. - MCP (
src/mcp/tools/signups-write.ts): theclose_signupdescription says "This cannot be undone from here." That would need updating. Decision: whether to add areopen_signuptool as well, or leave reopening to the web app.
Status machine after this change:
draft → open(publish)open ↔ closed(close / reopen)- any
→ archived(terminal — still one-way, intentionally)
archived stays terminal because it implies the organizer is done; reopening from archive is out of scope.
Open questions
- Reminder jobs on reopen: answered, nothing needed. The dispatch scan in
src/jobs/reminders.ts(around line 78) already includes closed signups, and the send job doesn't check the signup's status. So closing never cancelled reminders, and reopening has nothing to re-schedule. - Public page caching: moot.
/s/[slug]reads cookies (src/app/s/[slug]/page.tsx), so it renders on every request.revalidateSignuponly revalidates the organizer pages under/app/signups/[id]. - Confirmation prompt: close currently has no confirm step. Reopen probably doesn't need one either, but worth a thought — accidental reopen is much less destructive than accidental close.
- A closing time already in the past: sign-ups are refused once
closesAthas passed, even while the status isopen(whyNotTakingPlacesinsrc/services/commitments.ts). So reopening a signup whose closing time has passed would still refuse every sign-up. The web app has no control forclosesAt; only the REST API and the MCPupdate_signuptool set it. Decision: clearclosesAton reopen, or refuse the reopen while it is in the past. - A reopen racing an archive:
transitionStatuschecksfrombefore its transaction, and its UPDATE has no status condition (only the id anddeleted_at). A reopen that readclosedjust before an archive committed would set the signup back toopen, un-archiving it. Suggestion: addstatus = fromto the WHERE whenfromis set. The same race already exists between close and archive.
Tests
- DB: the status-transition tests are DB tests, in
src/services/signups.db.test.ts, not unit tests. Extend them to cover the new edge. - DB: add a
closed → open → closedround-trip insrc/services/*.db.test.tsto confirm activity log entries land correctly.
Activity
richshaw commentedon Oct 25, 2026
Update, 25 October 2026: checked against
mainat 4ed27a9 and against the "Publish and share" stack (#571 → #574 → #578 → #580 → #581), which rewrites the header this issue's outline puts Reopen in. Here's what's changed since the issue was written, the choices I've made, and how I'm splitting the work.What's changed
notifiableRulesinsrc/jobs/notify-rules.ts)./s/[slug]and the edit-link page/s/[slug]/c/[id]are rendered on every request, and both decide "closed" from the same rule (signupShutReason).openalready needs a slot.transitionStatuschecks for one whenever the target isopen, so a reopen gets that check for free. Its message says "publish", though, so it needs a reopen wording.close_signuptool description,docs/connect-ai-assistant.md,Choices
closed → open. Archived stays final.closesAtstill turns everyone away. The web app has no control forclosesAt, so refusing the reopen would be a dead end. The activity row keeps the removed time (clearedClosesAt).reopen_signuptool for AI assistants, not on the ask-first list. It's reversible and only ever follows the organizer asking. Ask-first would also use up most of the instruction bytes left.The stack
Smaller PRs, each reviewed and tophatted on its own:
main. AddsreopenSignup,POST /api/signups/[id]/reopen, thesignup.reopenedevent, and DB tests (passed and future closing times, no slots left, concurrent reopens, reopen racing an archive).reopen_signupfor AI assistants, on 1. Also rewordsclose_signupand updates the help line and docs.HeaderAnnouncerinto the layout so the banner can use it.Out of scope, for later:
https://claude.ai/code/session_01LrYa57fvbqWjZj89iH975K
Generated by Claude Code