Skip to content

Say in a moved slot's editor that its people will be emailed, and when - #1079

Open
richshaw wants to merge 1 commit into
mainfrom
claude/issue-599-moved-slot-note
Open

richshaw wants to merge 1 commit into
mainfrom
claude/issue-599-moved-slot-note

Conversation

@richshaw

Copy link
Copy Markdown
Owner

Fixes #599.

Merge order: #1077, #1076 and #1068 also raise the /app/signups/[id]/build budget in budgets.json, so whichever of them lands second has a one-line conflict there.

The problem

When an organizer opens a slot that people hold, its editor says "If you change its date or time, we'll email them to let them know." After the organizer changes the date and the rail says "Saved", the note still says the same thing. Nothing tells them that an email is now on its way, or when.

The fix

  • New note once a move has saved (SlotEditor.tsx). With reminders on, the note now reads: "You moved this slot. We'll email the 2 people signed up in about 10 minutes, with the new details." (For one person: "the person signed up".) The minutes come from SLOT_CHANGE_SETTLE_MINUTES through an ICU plural, so the note can't drift from the worker.

  • Screen readers. A visually hidden role="status" says the moved line when it appears. The note itself stays a plain role="note", so it isn't read out whole on every change.

  • Which changes count (slotMoved in useBuildState.ts). The tab compares the values the page loaded with the values the server last accepted (the savedValues map that A refused cell edit in the builder stays on screen and blocks the rest of the row, and a later save says "Saved" #514 keeps). It compares them through slotInstantOf (build-shared/slot-instant.ts), which uses the same rule extractSlotAt builds slot_at with:

    • the reminder date field;
    • the time field pairedTimeField pairs with it;
    • 12:00 when there's no time.

    Because it reads what has saved, the note never runs ahead of the server, and a refused value never flips it.

  • When the first note stays. The first note stays in each case where the worker sends nothing:

    • the slot is put back where it was when the page loaded;
    • another date field changes;
    • reminders are off.
  • Decisions the issue didn't make:

    • A slot moved into the past keeps the first note. notifiableRules only emails about a slot that is still ahead, so the moved note there would promise an email that never goes.
    • "About 10 minutes" is a plural over the minutes, not formatDuration. Importing format-duration into the Build tab reshuffled a shared chunk. That added 0.2 kB to /app/signups/new and to /s/[slug]/c/[id], which pushed both over budget.
    • slotInstantOf lives under build-shared/, not src/lib/reminder-fields.ts. In reminder-fields.ts it would ship in that module's chunk to participant pages too.
  • Budget. /app/signups/[id]/build goes from 151.6 to 152 kB. The page measured 152.0 kB with this change and 151.5 kB on main in the same container, so the check, the note's message and the status line cost about 0.5 kB. No other page moved.

  • Translations. Swedish and German translations of organizer.build.editor.moved, marked with mark-translated.mjs. en.d.json.ts was rewritten by the build.

  • CHANGELOG entry under Changed.

  • The help article "Create and publish your first signup" already says the email goes "about {SLOT_CHANGE_DELAY} after your last change", so it needs no change. affected-articles.mjs names no article.

Translation review

A different model reviewed organizer.build.editor.moved in sv and de against editor.signedUp, the glossaries and the number rules. It checked every plural branch for 1, 2, 5 and 1234 people and for 1, 10 and 60 minutes. No findings. Neither language changed after the review. The moved state has no screenshot in translation:screenshots, so the review was done from the keys, the English and the neighbouring messages.

Tests

New tests:

  • slot-instant.test.ts: the date with its paired time, 12:00 for a slot with no time or an invalid time, null without a real date, and another date field ignored.
  • useBuildState.test.ts → slotMoved:
    • true only once a new reminder date has saved, not while it waits to;
    • true for a new paired time;
    • false again once the date is put back;
    • false for a non-reminder date field;
    • false with reminders off;
    • false for a slot moved into the past.
  • SlotEditor.test.tsx:
    • the moved note and its status line, for several people and for one;
    • back to the first note, with an empty status, when the slot moves back;
    • the reminders-off note unchanged after a move.

Run in this session, all passing:

  • pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test: 249 files, 3779 tests.
  • pnpm build && pnpm budgets: every page within budget after the raise above.
  • pnpm test:e2e for build-tab-language, precompiled-messages and organizer in chromium: 63 passed. The mobile-safari project couldn't launch its browser in this container (running as root without a sandbox), and CI runs chromium only.

Before merging

Nothing to run. This waits for the owner because it changes the Build tab's wording (UX) and raises a budget.


Generated by Claude Code

Once a change to a held slot's reminder date, or the time paired with it,
has saved, the note in its editor reads "You moved this slot. We'll email
the 2 people signed up in about 10 minutes, with the new details." in
place of "If you change its date or time…", and a polite status says the
same line to screen readers. The wait is SLOT_CHANGE_SETTLE_MINUTES.

The Build tab compares the values the page loaded with those the server
last accepted, through the instant slot_at is built from (date, paired
time, 12:00 for none), so a change to another date field, a slot put back
where it was, or one moved into the past keeps the first note, as the
worker sends nothing for those. Reminders off: unchanged.

Translated into Swedish and German; the Build tab's budget goes to
152 kB for the new check and message.

Fixes #599.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SSJa9cz4jcAL1B4QLi
@richshaw richshaw added pipeline:ux Changes what a person using OpenSignup sees or does pipeline:working A session is working on it right now labels Nov 19, 2026 — with Claude
@richshaw
richshaw requested a balanced review from Copilot November 19, 2026 10:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@richshaw richshaw added pipeline:tophat pipeline:working A session is working on it right now and removed pipeline:working A session is working on it right now labels Nov 19, 2026 — with Claude

Copy link
Copy Markdown
Owner Author

Tophat: passed

I ran 1ac0906 locally with pnpm dev and pnpm worker, on Postgres 16, in Chromium at 1280×900 and 390×844. I used two made-up published signups: "Snack duty — Spring season" with 2 people signed up, and "Bake sale — Spring fair" with 1.

Check Result What I saw
Opening a held slot, before any change ✅ "2 people are signed up for this slot. If you change its date or time, we’ll email them to let them know." No change from main.
Changing the date to a later one ✅ After "Saved", the note read "You moved this slot. We’ll email the 2 people signed up in about 10 minutes, with the new details." The hidden role="status" had the same text.
Editing another field (What) after the move ✅ The moved note stayed. When I edited What on a slot that hadn't moved, the first note stayed.
Putting the date back to the one the page loaded with ✅ The note went back to the first one, and the status line was empty.
Moving the slot to 2020-04-06, in the past ✅ The DB recorded the save (a slot.rescheduled row going to 2020). The first note stayed.
One person signed up ✅ "We’ll email the person signed up in about 10 minutes…"
Swedish organizer, phone ✅ "Du har flyttat passet. Personen som är anmäld får ett mejl med de nya uppgifterna om ungefär 10 minuter." It fits at 390 px and shows no English apart from the signup's own field label.
Reminders off (sendReminders: false), then a move ✅ "Reminders are off, so we won’t email them if you change it." No change from main, and no status line.
The email the note promises (neighbour) ✅ The last move saved at 11:01:13 UTC. The worker sent "Time changed: Snack duty — Spring season · Fruit, water and napkins · Sat, May 11" to both people at 11:12:14, about 11 minutes later. The reminders-off signup sent nothing.
Phone width, English ✅ The note wraps to three lines inside the editor and doesn't overlap anything.
Console and server logs ✅ No browser console errors. The server printed only the usual dev-mode MaxListenersExceededWarning.

For the owner (UX): the change is the wording of a slot editor's note. Once an organizer saves a new date or time for a slot that people hold, the note stops saying "If you change its date or time…". It now says the slot moved, who will be emailed, and roughly when. The note goes back to the first wording when the slot is put back, moved into the past, or has reminders off. It's a page-session state: when I reloaded the page after a move, the note was back to "If you change…" even though the email was still on its way. The PR describes this design (it compares with the values the page loaded). Screenshots:

  • 1079-before-move and 1079-after-move: desktop
  • 1079-after-move-phone: phone
  • 1079-sv-moved-phone: Swedish
  • 1079-moved-back, 1079-moved-past and 1079-reminders-off: the cases that keep the first note

Screenshots are in https://claude.ai/code/session_016YZ9STa5aTQAkze9LZqK5N.


Generated by Claude Code

@richshaw richshaw added pipeline:review pipeline:working A session is working on it right now and removed pipeline:tophat pipeline:working A session is working on it right now labels Nov 19, 2026 — with Claude

@richshaw richshaw left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: passed (round 1)

This fixes #599 the way its outline asks. slotMoved in useBuildState compares each slot's instant as the page loaded it with the instant from savedValues, which is only written after a PATCH, add, duplicate or reorder refetch succeeds, so the note never runs ahead of the server and a refused value can't flip it. slotInstantOf follows extractSlotAt step by step: the date field the reminder ref names, pairedTimeField for its time, 12:00 when there's no valid time, null without a real date, all in UTC. state.reminderFieldRef is the stored reminderFromFieldRef gated on sendReminders (reminderFieldFrom, kept in step with field changes by mirrorFieldChange), so it matches findReminderFields on the server, and a change to another date field can't promise an email. The past-slot case matches notifiableRules, which only emails about a slot still ahead. The status span mounts empty with the editor and fills on a move, so it's announced once while the note stays a plain role="note". The wait comes from SLOT_CHANGE_SETTLE_MINUTES through an ICU plural. Every "Done when" item is met and has a test: the new note after a saved move (and not while the save is pending), back to the first note when the date is put back, unchanged for another date field, unchanged with reminders off. It also tests the paired time and a slot moved into the past. The message is translated into sv and de, and both translated-from records were updated.

Blocking (0)
Optional (1):

  • useBuildState.ts slotMoved: it compares with the page as loaded, not with what participants were last told. So the note is wrong in two cases. After a reload it shows the first note though an email is still pending. And if a slot was moved before the page loaded and is then put back to that loaded value, the note shows "If you change…" while the worker may still email about the earlier move. The issue chose this trade-off ("Compare with the page as it loaded"), and the PR and CHANGELOG say so. No change needed.

Earlier threads: none. Copilot couldn't review (quota).
Checks: CI is green on 1ac0906 (lint-type-test, e2e, CodeQL). The tophat passed on 1ac0906, the head, so no runtime code changed since. Its neighbour check saw the worker send the "Time changed" email about 11 minutes after the move, as the note says. A trial merge with main (git merge-tree) is clean. Locally I read the diff, extractSlotAt / findReminderFields / pairedTimeField, every place that writes savedValues, and reminderFieldFrom / mirrorFieldChange, and went through the repo checklist. No services, schema, help or legal pages are touched.

Why the owner: it's UX, and it raises a budget. Once an organizer saves a new date or time for a slot people hold, the slot editor's note changes to "You moved this slot. We'll email the 2 people signed up in about 10 minutes, with the new details." It goes back to the first note if the slot is put back, moved into the past, or reminders are off. budgets.json raises /app/signups/[id]/build from 151.6 to 152 kB, about 0.5 kB for the check, the message and the status line. #1077, #1076 and #1068 also raise this budget, so whichever lands second gets a one-line conflict. The tophat's screenshots to look at are 1079-after-move, 1079-after-move-phone, 1079-sv-moved-phone, 1079-moved-back, 1079-moved-past and 1079-reminders-off.

https://claude.ai/code/session_016YZ9STg3kL2NGVvvB8ZHAR


Generated by Claude Code

Copy link
Copy Markdown
Owner Author

Owner: Build page size limit raise approved

The owner approved, in a live session, raising the /app/signups/[id]/build limit in budgets.json for this PR. The approval covers the raise this PR needs on its own (151.6 → 152.0 kB), and the larger number needed when it merges after #1075, #1076 or #1077, which raise the same line: measure again with pnpm build && pnpm budgets and set the limit to what the page measures with all of them in.

This covers the size limit only. The change itself still waits at pipeline:owner for the owner's look.

https://claude.ai/code/session_016YZ9SS7PCSeTVXMcS859ee


Generated by Claude Code

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

Labels

pipeline:owner Passed; waits for the owner (UX or high-risk) pipeline:ux Changes what a person using OpenSignup sees or does

Projects

None yet

Development

Successfully merging this pull request may close these issues.

After a slot with sign-ups moves, its editor still says "If you change its date or time"

3 participants