Repository navigation
Conversation
…booking page transitions
…fication tooltips, and add-question modal
|
All contributors have signed the CLA. ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
Caution
The embedded booking widget is broken by the new booking.css layout, the single-use prefill path ships a failing test, and Microsoft SSO/JIT provisioning needs a security decision before merge. Details below.
Reviewed changes
- Theming — new
theme.svelte.tsstore (fp-theme, light/dark/system), pre-paint script inapp.html,darkvariant rewritten to&:where(.dark, .dark *), hard-coded hex palette inapp.cssreplacing most oklch tokens, switchers in the sidebar and on public routes. - Admin restyle/rework — event-types list rebuilt as cards with an overflow menu and 1-time-link actions; the event-type editor was rewritten end-to-end (Limits & Buffers panel with per-row day/week caps,
BookingPreviewCardlive preview,QuestionsPanelwith drag reorder + add-question dialog); bookings gains list/calendar views and client-side sorting; availability gains a day toggle, copy-hours and a bulk date-override modal; calendar gains per-sub-calendar conflict switches. - Public booking surfaces —
themeHead/themeSwitchershared templates, a dark palette inbooking.css, a right column that collapses until.card.has-day/.is-confirm, and?name/?email/?dealIdprefill plussingle_use_tokenplumbing inbook.html. - Frequency caps (new) —
caps.go(ISO-week bucketing,CountFrequencyBookings,enforceFrequencyCaps) called fromService.Create,max_per_day/max_per_weekcolumns (migration 00072),nullableIntPATCH semantics, slot filtering incomputeSlots, exposure in MCP/assistant. - Single-use links (new) — migration 00073, create/list/revoke handlers,
GET /t/{token}, token burn inside the booking transaction, private event types bookable when a token is presented. - Microsoft OAuth settings (new) — migration 00074,
microsoft_settings.goGET/PUT/PATCH, DB-over-env boot load,SetAllowedSignupDomainsand JIT member provisioning infinishOAuthLogin, new settings page and nav entry.
Verification I ran: go build ./... clean; go test ./internal/booking ./internal/config ./internal/db pass; go test ./internal/handler fails only on TestSingleUseLinks_lifecycleBookReplayAndManageReschedule; pnpm check (svelte-check) reports 0 errors; pnpm check:i18n passes. Note that frontend/src/routes/event-types/[slug]/+page.svelte (~3.8k lines changed) renders as “binary file or no changes” in the generated diff and had to be reviewed separately.
ℹ️ New admin UI text bypasses the i18n catalogue
The admin app has an en + fr catalogue with a source-level guard (pnpm check:i18n), but most of the new strings are hardcoded English, and one existing translated string was replaced outright, so French users now get a mixed UI. The guard passes because it only validates keys that are used, not strings that skip the catalogue.
Technical details
# New user-facing strings are not in the catalogue
## Affected sites
- `frontend/src/routes/calendar/+page.svelte:389` — `$t('calendar.addBookingsHere')` replaced by the
hardcoded "Primary Booking Target"; `:398` "Toggle the calendars you want to check for
conflicts:"; `:410` "Adding events to"; the `calendar.footer.manageHint` / `calendar.hint.multiCalendar`
blocks were deleted rather than reworded.
- `frontend/src/routes/event-types/+page.svelte:266,307,313,321` — "+ New event type", "Hidden",
"Disabled", "Public"/"Hidden" labels.
- `frontend/src/routes/bookings/+page.svelte:496,509` — "Canceled", "Soonest"/"Latest"/"Name (asc)";
the whole new calendar toolbar ("Today", "Week", "Month", "No bookings").
- `frontend/src/routes/availability/+page.svelte` — "Unavailable", "Copied hours to selected days",
"Date override saved", "Select at least one date.".
- `frontend/src/routes/settings/microsoft/+page.svelte` — the entire page, plus the nav entry
`'Microsoft OAuth'` in `settings/+layout.svelte:16`.
- `frontend/src/routes/event-types/[slug]/+page.svelte` — "Max bookings per day cannot be negative.",
the Limits & Buffers dropdown labels (`BUFFER_OPTIONS`, `NOTICE_OPTIONS`), and
`QuestionsPanel.svelte:601` "Required"/"Optional".
## Required outcome
- New operator-visible strings go through `$t`/`tr` with entries in both `en.json` and `fr.json`;
do not replace already-translated strings with literals.
- Keep the existing catalogue entries referenced or remove them deliberately (dead keys are not
detected by `check-i18n.mjs`).
## Open questions for the human
- Is French coverage expected for these new screens now, or explicitly deferred? Either is fine,
but the current mix is accidental rather than chosen.deepseek-v4.1-flash | 𝕏
…crosoft SSO, reschedule caps, atomic availability)
There was a problem hiding this comment.
Caution
The fix commit closes most of the previous review, but the booking.css right-column rewrite still leaves one of the three booking surfaces broken: /manage/{token} renders its entire action pane — the scheduled time, Reschedule, Cancel, and the cancelled/expired state messages — at width:0; opacity:0. Two smaller regressions came out of the same commit: the Microsoft identity switch changes which string is used for account lookup, and reschedule cap rejections surface as 500s.
Reviewed changes
- Reworked the add-question dialog so
addQuestionreturns a success flag and the dialog closes only after a successful POST. - Made copy-hours create the new rules before deleting the old ones, rolling back the partial create on failure, and kept failed deletes in
day.blockson the day toggle. - Added
CountFrequencyBookingsExcludingand enforced frequency caps inService.Reschedule, excluding the booking being moved. - Switched Microsoft sign-in identity from Graph
mailtouserPrincipalName, rejecting#ext#guest UPNs, and made an empty client ID or secret store a nil OAuth config. - Blocked JIT member provisioning while the instance is unclaimed so
/v1/auth/claimstays available, with a test for it. - Moved single-use prefill to
?name/?emailquery params and dropped the request fields the create endpoint never decoded. - Taught the embed widget to add
has-day/is-confirminapplyStep, and let.card.step-rightreveal the right column.
Verification I ran: go build ./... and go vet ./internal/booking ./internal/handler clean; go test ./internal/booking and go test ./internal/handler both pass now, including TestSingleUseLinks_lifecycleBookReplayAndManageReschedule. The manage-card computed styles below were measured in headless Chromium against the real booking.css at 1280px and 390px.
deepseek-v4.1-flash | 𝕏
| upn := strings.ToLower(strings.TrimSpace(info.UserPrincipalName)) | ||
| if strings.Contains(upn, "#ext#") { | ||
| return "", fmt.Errorf("auth: Microsoft account is a B2B guest identity, not a verifiable email") | ||
| } | ||
| email := upn | ||
| if email == "" { | ||
| upn := strings.ToLower(strings.TrimSpace(info.UserPrincipalName)) | ||
| if strings.Contains(upn, "#ext#") { | ||
| return "", fmt.Errorf("auth: Microsoft account is a B2B guest identity, not a verifiable email") | ||
| } | ||
| email = upn | ||
| email = strings.ToLower(strings.TrimSpace(info.Mail)) | ||
| } |
There was a problem hiding this comment.
Switching the identity to userPrincipalName closes the unverified-mail hole, but it also changes the key used for both the users.email lookup and the allowed_signup_domains check. Calnode accounts are created from the operator-typed mailbox address, while Entra keeps many UPNs on *.onmicrosoft.com even when the mailbox is on the custom domain — those users now get a 403 (or, if the onmicrosoft.com suffix is also allowlisted, a second is_admin=0 member row) instead of signing in. Microsoft's own guidance says not to use UPN to identify a user or make authorization decisions.
Technical details
# UPN replaces the mailbox address as the account identity
## Affected sites
- `internal/handler/auth_microsoft.go:115-122` — `email := upn` with `mail` used only when UPN is empty.
- `internal/handler/auth_oauth.go:61-62` — exact-match lookup on `users.email` (created from operator input in `claim.go`/`invites.go`, i.e. the mailbox domain); there is no alias match.
- `internal/handler/auth_oauth.go:83-86` — `emailDomainAllowed` is evaluated on that same value before JIT provisioning.
- `frontend/src/routes/settings/microsoft/+page.svelte` — the field is documented as "email domains", and the same value is shared with Google sign-in, where it does mean the mailbox domain.
## Evidence
- Entra Connect: "If the UPN suffix of John, for example contoso.com, doesn't match a verified domain in Microsoft Entra ID, then Microsoft Entra ID replaces the UPN suffix with contoso.onmicrosoft.com" — https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/plan-connect-design-concepts
- "Also don't use the `upn` claim for authorization. While the UPN is unique, it often changes over the lifetime of a user principal" — https://learn.microsoft.com/en-us/entra/identity-platform/claims-validation
## Required outcome
- An existing user still signs in when their Entra UPN and mailbox differ, and the domain allowlist is still evaluated on a tenant-verified domain (never on `mail`).
## Suggested approach
- Keep the verified UPN for the allowlist decision but accept either candidate when resolving the existing `users.email` (UPN first, then `mail`, both with the `#ext#` rejection); or bind the account to `tid`+`oid` as Microsoft recommends.
- Note that the `#ext#` filter also rejects guests invited into the operator's own tenant, who resolved by `mail` before this change.… management, and rescheduling
There was a problem hiding this comment.
Caution
The fix for the manage page's collapsed action pane trades one break for another: is-confirm also hides #cal-col, which is that page's reschedule date picker, so /manage/{token} can no longer reschedule a booking. The second commit also puts Microsoft identity back on mail, which re-opens the new JIT signup allowlist to an attribute the signing-in tenant controls.
Reviewed changes
- Restored the manage page's right-hand action pane by adding
is-confirmto both manage cards (scheduled time, Reschedule/Cancel, and the cancelled/expired state pages). - Switched Microsoft sign-in identity from
userPrincipalNameback to Graphmail(UPN as fallback) and documented the specific-tenant requirement in a code comment. - Made copy-hours diff-based: blocks are keyed by
start_time-end_time, existing ones are reused, and only blocks absent from the template are deleted. - Mapped
ErrFrequencyCapReachedto a 409 with a readable message in bothRescheduleByTokenandRescheduleBooking. - Removed the dead
dealId/PrefillDealIDprefill plumbing frombook.goandbook.html, trimming?name/?emailon the way in. - Genericized test domains and base URLs from
formaprime.vctoexample.com.
Verification I ran: go build ./... and go vet ./internal/booking ./internal/handler ./internal/config clean; go test ./internal/booking ./internal/config pass and the full go test ./internal/handler (51s) passes. The .cal-col computed style below was measured in headless Chromium against the real booking.css.
deepseek-v4.1-flash | 𝕏
|
|
||
| {{else}} | ||
| <div class="card"> | ||
| <div class="card is-confirm"> |
There was a problem hiding this comment.
is-confirm brings the action pane back, but it is the same class that removes the date picker: .card.is-confirm .cal-col { display: none } (booking.css:38), and this card is the one that owns #cal-col. showView('reschedule-view') un-hides #cal-col into that cascade, so the invitee gets the slots pane, the "pick a day" hint, and no calendar — rescheduling is unusable on desktop and on the mobile m-rcal step. Measured display: none in headless Chromium against the real stylesheet; the right column itself now computes correctly (490px, opacity: 1).
Technical details
# `is-confirm` hides the manage page's reschedule calendar
## Affected sites
- `internal/handler/templates/manage.html:131` — the main card is now `class="card is-confirm"`.
- `internal/handler/templates/booking.css:38` — `.card.is-confirm .cal-col { display: none; }` (specificity 0,3,0).
- `internal/handler/templates/manage.html:167` — `#cal-col` is the date picker rendered inside that card.
- `internal/handler/templates/manage.html:319` — `showView()` toggles `hidden` on `#cal-col` for `reschedule-view`.
- `internal/handler/templates/manage.html:95` — the mobile `.cal-col` rule sets no `display`, so nothing restores it there either.
## Required outcome
- `/manage/{token}` shows the calendar when the invitee starts a reschedule, on desktop and mobile, while the scheduled time / Reschedule / Cancel pane stays visible.
## Suggested approach
- Give the manage card its own marker (e.g. `card.reveal-right`) that restores `.right-col` without the `.cal-col` hiding, or scope the cal-col rule to the surfaces that need it (`book.html`'s form/confirm steps). `is-confirm` also pins `.info` to `290px` and the card to `780px`, which a manage-specific class avoids.
- Re-check all three surfaces at 1280px and 390px afterwards.There was a problem hiding this comment.
Important
The new manage-card marker restores the manage page's action pane but caps the card at 780px, which leaves the reschedule slots pane 127px wide and makes the time-period labels overlap. The Microsoft JIT gate now uses the UPN, but only for the literal common authority — organizations, Microsoft's other multi-tenant authority, still falls back to the spoofable mail attribute.
Reviewed changes
- Replaced the
is-confirmmarker on both manage cards with a newmanage-cardclass that restores.right-coland the 780px card width without triggering the.card.is-confirm .cal-colhide, so the reschedule date picker is visible again. - Split Microsoft sign-in identity in two:
fetchMicrosoftIdentityreturns Graphmail(existing-user lookup) anduserPrincipalName(domain-verified), rejecting#ext#guest UPNs. - Added
finishOAuthLoginWithJITEmailso the lookup email and the JIT-provisioned email can differ, with the UPN substituted when the OAuth authority iscommon; Google keeps the previous single-email path.
deepseek-v4.1-flash | 𝕏
There was a problem hiding this comment.
✅ No new issues in this commit — both findings from the previous review are fixed, and the layout fix is confirmed by measurement.
Reviewed changes
- Microsoft JIT gate covers every multi-tenant authority — the new
isMultiTenantMicrosoftAuthoritymatchescommon,organizationsandconsumerscase-insensitively, so the tenant-verified UPN gates JIT provisioning under any multi-tenant alias rather than only the literalcommon. - Manage page card restored to its pre-PR width —
.card.manage-cardnow shares the 860pxhas-daywidth and the right-column reveal moved to a:where()-scoped rule at (0,1,0), somanage.html's own mobile padding applies again.
Measured against the real booking.css in headless Chromium: at 1280px the reschedule pane is 271px wide with 63.7px period buttons, a two-column slot grid and no label overflow (previously 127px content and one column); at 700px and 500px the right column takes the page's 16px gutters. go build ./..., go vet ./internal/handler and the Microsoft/OAuth handler tests are clean.
Submitted as a comment rather than an approval because the earlier thread on internal/handler/auth_microsoft.go:115-122 — lookup by Graph mail while JIT provisions on the UPN — is still open and unchanged by this commit.
deepseek-v4.1-flash | 𝕏
|
Thanks for the work, but I have to be straight with you: none of this was pre-approved. There is no issue or discussion asking for a UI overhaul, and this PR links none. The admin's current look is a deliberate choice rather than neglect, and a wholesale restyle is not a direction we are looking for. That does not make the work worthless. It means a 58-file PR that mixes a restyle, three migrations and several new features cannot be reviewed, and would not be merged even if every part of it were good. What I would take, as separate PRs, smallest first:
Two specifics:
If you want to start with the smallest useful piece, the Entra tenant field is the one with the clearest standalone value: it lets an operator restrict SSO to their own directory, which is a real security improvement with a contained diff. |
|
Good news: the maintainer has looked at the pieces separately, so here is the actual priority order rather than my guess. Same rule applies to all of them: one concern per PR, migration numbers starting at 00073 (00072 is now taken). 1. Single-use booking links. Do this one first. This is the piece that is actually needed, so it is the one worth your time. Backend plus its migration plus the UI, as one PR. 2. Microsoft OAuth admin settings. Fine to proceed, provided the feature is genuinely needed rather than a nice-to-have — please say in the PR what breaks without it. Name the column 3. Light/dark theming for the admin SPA. Welcome as its own PR. Scope it to the admin and leave the public booking pages alone. 4. Any change to the public booking or manage pages needs screenshots first. Before/after, at desktop and mobile widths. Those pages are what a customer sees, so we will look at them and decide, rather than approving a diff blind. 5. The rest is fine if it is done properly, each as its own PR with a short statement of what it fixes or enables. Nothing there is blocked in principle. One practical note: your branch is currently a single commit series on top of an older main. Starting the single-use-link work as a fresh branch off current |
|
Yeah, no problem at all! I made most of these improvements for myself and my team, and I also added other Cal.com features my team had requested in my fork. I really appreciate the work you put into the original and thought I'd contribute what I had already written. I'll close this PR out, start a fresh branch off current main, and open a focused PR just for single-use booking links (starting at 00073), then divide up the rest of my changes later. Btw, in the future, if you want, you can take any of the code in my fork and incorporate it into your project. Just a fair warning that my current main branch isn't completely stable since it's an ongoing upgrade based on team requests. I created a few checkpoint branches that are in a better state if you do look through it (I'd avoid branches 3a and 3b, though, because they were a little ad-hoc to add the features and lack polish in the UI, which is what I'm currently working on fixing). |

Hey! I've been using Calnode and really like the core scheduling engine, so I spent some time modernizing the UI/UX and adding a few quality-of-life features in my fork. I wanted to contribute these improvements upstream so everyone can benefit.
I'm also planning a few larger backend features on my fork next (such as team/holiday OOO, dynamic group links, scheduled timezone changes, per-link webhooks, and admin user impersonation). If any of those align with your roadmap, I'd be happy to open separate PRs for them later, just let me know!
Summary of Changes
Theme & Layout: Added light/dark/system theme support (app.css, app.html, theme.svelte.ts, +layout.svelte, vite.config.ts).
Event Types & Editor:
Core Pages: Updated availability, bookings, calendar, and login pages.
Settings: Improved mobile responsiveness (settings/+layout.svelte), fixed wrapping status badges (ai, branding, payments, storage, video, zoom), and simplified Google OAuth redirect URIs with Copy buttons (settings/google/+page.svelte).
Booking Frequency Caps: Simultaneous per-day and per-week booking caps (caps.go, 00072_event_type_frequency_caps.sql, service.go, slots_handler.go, event_type.go, mcp.go) with unit tests (service_test.go).
Single-Use Booking Links: Native ephemeral single-use links (single_use_handler.go, 00073_single_use_tokens.sql, book.go, booking_handler.go) with tests (single_use_test.go).
Microsoft OAuth Admin Settings: Admin UI (settings/microsoft/+page.svelte) and backend configuration (microsoft_settings.go, 00074_microsoft_oauth_settings.sql, auth_oauth.go, auth_microsoft.go, config.go, server.go) with tests.