feat: re-add timezone-safe multi-weekday picker to recurring hangouts - #573
Open
juanmahidalgo wants to merge 1 commit into
Open
feat: re-add timezone-safe multi-weekday picker to recurring hangouts#573juanmahidalgo wants to merge 1 commit into
juanmahidalgo wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Coverage Report for CI Build 27299074920Coverage increased (+0.02%) to 93.543%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
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.
Follow-up to #561 (issue #560).
Context
#561 collapsed the hangout recurrence UI into one dropdown and, to kill the "Toxic Tuesday" phantom-occurrence bug, dropped the per-weekday picker and derived the weekly weekday from
start_at. That removed the ability to schedule a single event on multiple weekdays (e.g. Mon/Wed/Fri), which is a real use case. This PR brings the multi-weekday picker back — without reopening the bug.Why the bug happened (and how this avoids it)
The events server stores
recurrent_weekday_maskand runs its RRule in UTC, while the form collects weekdays in the creator's local calendar. The original bug was a phantom occurrence:start_at's own UTC weekday wasn't present in the stored mask, so RRule emitted the start day on top of the rule's days. The fix guarantees that can't happen:localWeekdaysToUtcMask), so occurrences land on the creator's intended local days andstart_at's UTC weekday is always in the mask.Changes
src/utils/recurrence.ts: neweffectiveWeekdays(always folds in the start weekday),localWeekdaysToUtcMask/utcMaskToLocalWeekdays(local↔UTC conversion anchored on the start instant).repeatDaysback in form state; weekday chips render for weekly cadences (every week / 2 / 3 / 4 weeks) with the start day locked; submit builds the UTC mask from the selected days (daily/monthly still send 0). Edit hydration decodes the stored mask back to local weekdays.decodeRecurrentByDaynow decodes the UTC mask into the viewer's local weekdays, so the recurrence label matches the locally-formatted schedule and the create-form preview.repeat_onacross all six locales.Test plan
recurrence.spec.ts(conversion + wrap + start-weekday-always-present invariant, with mocked UTC delta),useCreateEventForm.helpers.spec.ts(multi-day preview + mask hydration),useCreateEventForm.spec.tsx(mask carries start weekday + extra days),EventForm.spec.tsx(chips render/lock/toggle, hidden for non-weekly). Local full-suite run deferred to CI for memory reasons.