feat: allow non-creative edits to SGA Space bookings past advance notice (#94), and bump to v1.14.1 - #98
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…#94) Advance notice exists so that time is *claimed* a set number of hours before it is used, so the thing to test is the time an edit newly claims -- not whether the start moved, which is what the PATCH route tested. Shortening a booking, pushing its start later, renaming it or cancelling it release time or leave it alone, and none of them needs notice. lib/spaces-advance-notice.ts works out the earliest instant an edit newly claims and refuses only that. Extending the end of a booking whose end is still outside the window is therefore allowed, as the issue asks, because the block being claimed starts at the old end. Relocating a booking wholesale to a date past the cutoff is allowed for the same reason, and is not treated as an extension. Creation claims its whole interval, so the POST route reduces to the test it already ran and now shares the rule. `now` defaults to bostonWallClockNow() and not to Date.now(). A space booking's start_time holds Boston wall-clock digits with a Z on the end, so measuring it against a real instant makes every booking look an offset earlier than it is -- issue #87, fixed in 1e3d894, which this would otherwise have reintroduced. The default belongs in the rule rather than at each call site because the browser is a caller too, and its clock is in whatever zone the viewer happens to be sitting in. The real blocker was in the calendar: the notice-zone guard in the click handler returned before the "is this a booking I own?" branch, so a booking sitting inside the window could not be opened at all, let alone shortened or cancelled. Your own booking is now reached first, in both the click and the hover handler, since opening a booking you already hold claims nothing. The edit modal runs the same rule as the form changes, so a change that would be refused says so before it is submitted rather than after a round trip. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
pataniaeli
force-pushed
the
feat/issue-94-spaces-shrink-edits
branch
2 times, most recently
from
September 9, 2026 22:37
fbf8a25 to
8523418
Compare
package.json, the lockfile's two root entries, and the sidebar label. Only lines 3 and 9 of package-lock.json belong to the project; a find-and-replace across the file would bump a dependency to a version that does not exist and break npm ci. A patch rather than a minor: this release only fixes things. It carries the weekly update emails and alerts pointing at the week that actually moved (#91), Senate session-type preferences applying to emails and alerts rather than only to the My Rooms list (#92, #93), and SGA Space bookings inside the advance notice window becoming editable again (#94) -- which relaxes a restriction rather than adding a capability. The FAQ entry is written for members: what changed for someone using Chambers. None of it is administrator-only this time, so nothing is named as such. The v1.15.0 placeholder stays where it is and keeps pointing forward. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #94.
The rule
Advance notice exists so that time is claimed a set number of hours before it is used. So the thing to test is the time an edit newly claims, not whether the start moved — which is what the PATCH route tested. Shortening a booking, pushing its start later, renaming it or cancelling it all release time or leave it alone, and none of them needs notice.
lib/spaces-advance-notice.tsworks out the earliest instant an edit newly claims, and refuses only that:The middle row is your parenthetical: extending a booking whose end is still outside the window is allowed, because the time being added begins where the booking already ended. The third row means relocating a booking wholesale to next week is allowed and is not treated as an extension — while sliding it two hours later tonight still is one, because it claims tonight's time.
Creation claims its whole interval, so the POST route reduces to exactly the test it already ran, and now shares the rule rather than keeping a second copy.
It measures from Boston wall clock, not
Date.now()Rebased onto #89 partway through, which is how I found this. A space booking's
start_timeholds Boston wall-clock digits with aZon the end, so measuring it against a real instant makes every booking look an offset earlier than it is — that is #87, fixed in1e3d894, and a shared rule defaulting toDate.now()would have quietly reintroduced it on both paths at once.nowtherefore defaults tobostonWallClockNow()inside the rule rather than at each call site, because the browser is a caller too and its clock is in whatever zone the viewer is sitting in — a student on co-op in California would otherwise see a different answer from the server's.The actual blocker
The server was already half-right — it only checked when
start_timechanged, and DELETE never checked at all. What made these bookings untouchable wasspace-calendar.tsx: the notice-zone guard in the click handler returned before the "is this a booking I own?" branch, so a booking sitting inside the window could not be opened, let alone shortened or cancelled. Your own booking is now reached first, in both the click and the hover handler, since opening a booking you already hold claims nothing. The hover affordance and the click target now agree, which they did not before.The edit modal runs the same rule as the form changes, so a change that would be refused says so up front instead of after a round trip:
Verification
npm run build,tscandeslintclean (the onespace-calendar.tsxwarning is pre-existing and untouched).The rule was exercised directly across 22 cases — shortening both ends, renaming only, both extension shapes, a booking straddling the cutoff, relocation near and far, creation either side,
minHours: 0, and the wall-clock cases above, including one that is correctly allowed under Boston wall clock and would be wrongly refused underDate.now().I could not click through this in a browser: the dev server is behind a login wall. Worth someone exercising the calendar click on a booking inside the notice window before merge.
🤖 Generated with Claude Code