Skip to content

feat(web): vote on availability from the web - #13

Merged
joshchen-dev merged 1 commit into
mainfrom
claude/great-shannon-b4y5vi
Oct 6, 2026
Merged

joshchen-dev merged 1 commit into
mainfrom
claude/great-shannon-b4y5vi

Conversation

@joshchen-dev

@joshchen-dev joshchen-dev commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

This is the first step in moving all interaction to the web, with Discord reduced to announcements. Members can now vote from the availability grid.

  • The vote endpoint: PUT /api/polls/{id}/availability with {"available": [occurrenceIds]}. It reuses Store.SetAvailability, so the rules match Discord exactly:
    • only members of the poll's roster can vote
    • dates that have already started are locked
    • any date not selected becomes Unavailable
    • a confirmed date flips to Needs attention if someone drops out
  • Discord sync: the Discord message updates through the existing background refresher (Bot.SubmitAvailability).
  • The grid: your row is pinned first and labelled "You". Edit my availability turns it into toggle buttons, then you save or cancel. Leader date actions are hidden while you're editing.
  • Errors: an unknown or foreign occurrence ID now returns 400 (ValidationError) instead of 500.
  • Discord voting still works. Removing it is the next PR, which makes Discord announcement-only.
  • Bumps the version to v0.0.12.

Verification

  • TestAvailabilityRejectsInvalidInput: rejects a bad poll ID, a zero occurrence ID, unknown fields and a missing available list.
  • TestSchedulingLifecycle now asserts that a foreign occurrence ID returns ValidationError.
  • Playwright a member edits and saves their availability on the web: your row is first, toggling Thursday off sends {"available":[101,103]}, and the toast and view mode come back. It runs on desktop and Pixel 7.
  • go test ./... with PostgreSQL, go vet ./..., npm run check, npm run build, npm run format:check, and the full Playwright suite (15 passed).

Members can now answer from the availability grid: "Edit my availability"
turns their row (pinned first and marked "You") into toggles, and saving
calls PUT /api/polls/{id}/availability. It reuses SetAvailability, so the
rules match Discord: only roster members may vote, started dates are
locked, unselected dates become Unavailable, and confirmed dates move to
Needs attention when someone drops out. The Discord announcement updates
through the background refresher. Unknown occurrence IDs are now a 400
instead of a 500.
@joshchen-dev
joshchen-dev merged commit 0d69010 into main Oct 6, 2026
1 check passed
@joshchen-dev
joshchen-dev deleted the claude/great-shannon-b4y5vi branch October 6, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant