add "find a time" scheduling flow#18
Draft
zzstoatzz wants to merge 4 commits into
Draft
Conversation
availability collection → overlap detection → voting → event creation - new D1 tables for scheduling requests, availability, and votes - availability grid with drag-to-paint, heatmap overlay, timezone-aware display - overlap algorithm slices candidates to match requested event duration - participant avatars with hover-to-highlight individual availability - voting phase with "none of these work" option - resolved state links back to created event - prefills EventEditor with winning time slot Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- add try/catch around JSON.parse for poll_options - add try/catch around request.json() in API endpoint - replace location.reload() with invalidateAll() for proper SvelteKit data refresh Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- delete unused SchedulingResults.svelte (inlined into [id]/+page.svelte) - make wallClockToUtc private (only used internally by generateSlots) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
P1: add organizer-only guard to lock availability action
P1: rewrite overlap algorithm to slide across all slots and intersect
participants, fixing missed windows at count boundaries
P1: fix DST conversion with iterative offset probing instead of
single-probe approach that shifts by an hour at transitions
P2: single-pass participant slot grouping + concurrent profile loading
(was O(n*m) sequential)
also fix type errors caught by svelte-check
Co-Authored-By: Claude Opus 4.6 (1M context) <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.
what this does
adds a "find a time" flow — a precursor to event creation where participants coordinate availability before committing to a time.
demo: https://bsky.app/profile/zzstoatzz.io/post/3mjdqgzh5b225
the flow
what's NOT here
community.lexicon.calendar.eventvia the existing flowreading guide
changes to existing files are minimal — 3 files touched, ~65 lines:
+layout.svelte— adds "find a time" nav link (5 lines)create/+page.server.ts— reads prefill params from URL (14 lines)create/+page.svelte— passes prefill to EventEditor + resolves scheduling intent on publish (39 lines)new code is all in two new directories:
src/lib/scheduling/— backend logic (566 lines)types.ts— data typesdb.ts— D1 table setup + queries (CREATE TABLE IF NOT EXISTS, same pattern as Contrail)timezones.ts— UTC ↔ local timezone conversion (all slots stored as UTC, converted at display time)overlap.ts— finds overlapping windows, slices to requested durationsrc/lib/components/scheduling/— UI (431 lines)AvailabilityGrid.svelte— when2meet-style drag-to-paint grid with heatmap overlayCreateScheduleForm.svelte— title + timeframe + duration formsrc/routes/(app)/schedule/— routes (795 lines)new/— create form[id]/— main page (grid + sidebar with avatars, overlap preview, voting, event creation)api/— JSON mutation endpointopen questions
test plan
🤖 Generated with Claude Code