Skip to content

Closing a signup is one-way; need a Reopen affordance #20

Closed

Description

@richshaw

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): new reopenSignup(db, actor, id) delegating to transitionStatus(db, actor, id, 'closed', 'open', 'signup.reopened'). Add signup.reopened to ACTIVITY_EVENTS in src/db/schema/activity.ts, and to the eventType union on transitionStatus.
  • 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 to closeAction.
  • UI (src/components/signup/SignupHeader.tsx): when status === 'closed', render a Reopen button next to Preview/Export — same brand-fill styling as Publish/Close, mutually exclusive with both. hasActionButton there only counts draft and open when 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 for draft and Close for open, and nothing for closed.
  • MCP (src/mcp/tools/signups-write.ts): the close_signup description says "This cannot be undone from here." That would need updating. Decision: whether to add a reopen_signup tool 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. revalidateSignup only 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 closesAt has passed, even while the status is open (whyNotTakingPlaces in src/services/commitments.ts). So reopening a signup whose closing time has passed would still refuse every sign-up. The web app has no control for closesAt; only the REST API and the MCP update_signup tool set it. Decision: clear closesAt on reopen, or refuse the reopen while it is in the past.
  • A reopen racing an archive: transitionStatus checks from before its transaction, and its UPDATE has no status condition (only the id and deleted_at). A reopen that read closed just before an archive committed would set the signup back to open, un-archiving it. Suggestion: add status = from to the WHERE when from is 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 → closed round-trip in src/services/*.db.test.ts to confirm activity log entries land correctly.

Activity

  1. added
    enhancement
    on Apr 30, 2026
  2. richshaw commented on Oct 25, 2026

    @richshaw
    OwnerAuthor

    Update, 25 October 2026: checked against main at 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

    • The archive race is fixed. Publish, close and archive check the status without a lock, so an archive racing a publish leaves the signup open #437 moved every status change under the signup lock, so a reopen racing an archive will always end archived. Nothing to do here.
    • Reminders and the public page still need nothing. Reminders and slot-change emails treat closed like open (notifiableRules in src/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).
    • Moving to open already needs a slot. transitionStatus checks for one whenever the target is open, so a reopen gets that check for free. Its message says "publish", though, so it needs a reopen wording.
    • The header is different after Ask before closing a signup, and move Close signup into the ⋯ menu #571. An open signup shows Preview, Share and a ⋯ menu holding Close signup, which asks first. A closed signup's desktop header shows only Preview. On a phone it has no ⋯ and no bottom bar. Every tab shows a grey "Signup closed" banner while it's closed.
    • More places say closing is permanent than the issue lists:
    • The AI assistant's server instructions are nearly full. They use 2,022 of the 2,048 bytes before the tools line, which some clients cut off.

    Choices

    1. Only closed → open. Archived stays final.
    2. A closing time that has already passed is removed on reopen. A later one stays. Otherwise a reopened signup past its closesAt still turns everyone away. The web app has no control for closesAt, so refusing the reopen would be a dead end. The activity row keeps the removed time (clearedClosesAt).
    3. Reopen goes in the closed banner, not the header.
      • The banner shows on every tab, on phone and computer, for exactly as long as the signup is closed.
      • It already says what "closed" means.
      • The phone header has nowhere to put a button.
      • It's a blue button, because an outlined one is nearly invisible on the grey banner.
      • It sits under the text on the left, never at the banner's right edge. Close's confirm panel hangs down from the ⋯ over that spot, so a right-aligned Reopen would land where the red Close signup button was a second earlier: One click on "Close signup" closes a signup for good, from the spot where Publish was #457's trap the other way round.
    4. No confirmation before reopening. Close is right there, and it asks first.
    5. Say it worked. After a reopen from this page, the header's live region says "Reopened. People can sign up again." and focus moves to the title, as Close does.
    6. A reopen_signup tool 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.
    7. Close's question becomes "People can't sign up until you reopen it."

    The stack

    Smaller PRs, each reviewed and tophatted on its own:

    1. Reopen in the service and REST API, on main. Adds reopenSignup, POST /api/signups/[id]/reopen, the signup.reopened event, and DB tests (passed and future closing times, no slots left, concurrent reopens, reopen racing an archive).
    2. reopen_signup for AI assistants, on 1. Also rewords close_signup and updates the help line and docs.
    3. The header announcer says what any status change did, on After a fix, hand focus back to Publish and share; mark slots that still say TBD #581. A refactor with no visible change. It lifts HeaderAnnouncer into the layout so the banner can use it.
    4. The Reopen signup button in the closed banner, on 3, with 1 merged in. Its diff shows 1's files until 1 lands.
    5. A help page, "Close or reopen a signup", on 4. No help page covers closing yet.

    Out of scope, for later:

    • An open signup past its closing time shows as open in the organizer's header while the public page says closed.
    • Reopening a signup whose slots are all in the past lets people sign up for past dates. An open signup already allows that today.

    https://claude.ai/code/session_01LrYa57fvbqWjZj89iH975K


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions