Repository navigation
Conversation
…lnode#254) A per-event-type setting, off by default, adds a button above the time list that opens the soonest free day. Worked out from the free slots only, bounded by max_future_days, and silent on a failed or degraded check. Shown on the booking and reschedule pages; the embed widget is left for a follow-up.
|
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.
Important
The new button's label renders as the literal string next_available_hint on every non-English locale. t() on both pages is I18N[key] || key, and I18N is loc.JSON() — the resolved locale's strings only, with no English merge — so the missing key surfaces on the page instead of falling back to English.
Approach: sound — one opt-in column threaded through create/PATCH/duplicate and both server-rendered surfaces, with the search itself in the shared, unit-tested booking-logic.js rather than reimplemented per page, and the embed widget deferred until it can load that module.
Reviewed changes
- Setting and API — migration 00073 (
DEFAULT 0, mirroring 00057), the shared column list and row scan, create and PATCH, the duplicate copy, and the admin type/checkbox withen/frcopy. - Booking and reschedule pages —
loadNextAvailableon both surfaces, the desktop/mobile pair of buttons,booking.css, and the one new public i18n key. - Shared helpers and tests —
earliestFreeSlot,monthsToProbeand six node tests, plus Go tests for the opt-in round-trip and for both pages' markup. - Docs — CHANGELOG entry and the ARCHITECTURE subsection beside the booked-times one.
deepseek-v4.1-flash | 𝕏
- Add next_available_hint to every locale. The pages' client-side t() reads the locale's own strings with no English merge, so a locale without the key showed the raw key name. - Drop the booking's own slot by instant rather than by string. /slots spells starts in the requested timezone, so outside UTC the string never matched. - Share one in-flight /slots request per month and timezone between the calendar and the next-available search, so opting in no longer doubles the first request.
Call it a button throughout, match the admin hint examples to the page label, and drop a stray blank line.
There was a problem hiding this comment.
✅ No new issues found.
Approach: unchanged — the follow-ups fix the three review points inside the existing design (shared booking-logic.js helper, one opt-in column, both server-rendered pages) without broadening scope.
Reviewed changes
Reviewed the two commits since the prior pullfrog review (4f47a01, 167dda5):
- Locale coverage —
next_available_hintis now in all 11 non-English catalogues, so the client-sideI18N[key] || keyfallback can no longer render the raw key. - Instant-based slot exclusion —
earliestFreeSlotcomparesDate.parsed starts, with a regression test coveringZvs+02:00spellings. - Shared slots request — both pages route
/slotsthrough a per-URL in-flight promise, so the calendar and the next-available probe share the visible month's response instead of fetching it twice. - Copy and comments — example dates in the CHANGELOG and admin hint, the migration comment, and the test names were tidied.
Verified locally: go test ./internal/i18n/, node --test internal/handler/assets/booking-logic.test.js (21 pass), and the targeted next-available/duplicate handler tests all pass.
deepseek-v4.1-flash | 𝕏
|
Thanks for the review. All three points were right, and the fixes are in the second commit (the third only tidies wording):
Checked again in Chromium on both pages: one |

Adds an opt-in
show_next_availableevent type setting, default off. When on, a button above the time list shows the soonest free time, such as "Next available: Wed, Dec 9, 10:00 AM", and opens that day when clicked. This is the change agreed in #254.How it follows the points raised there:
event_type_duplicate.go, and a checkbox in the event type editor next to the booked-times one.maxDate, so it cannot run pastmax_future_days.degradedresponse shows nothing./slots. The page only formats, with the existing formatters. A timezone change restarts the search.<button>, styled like a time button inbooking.css.earliestFreeSlotandmonthsToProbeare inbooking-logic.jswith unit tests.next_available_hint. The admin strings areenandfr.book.htmlandmanage.htmlchange together. On the reschedule page the booking's own current time is left out, so it offers the next time the booking could move to.booking-logic.js, so it needs its own mirrored copy.On narrow screens the calendar step hides the right column, so a second copy of the button sits above the calendar there, and
booking.cssshows one at a time.ARCHITECTURE.mdhas a new subsection beside the booked-times one, and the CHANGELOG has an entry.Checked:
go test ./...,go vet ./...andgofmt -l .are clean.node --test internal/handler/assets/booking-logic.test.js: 20 pass.pnpm check,pnpm check:i18nandpnpm buildpass.pnpm test:visual(no change to the ui components,app.cssor the theme) and the embed widget (untouched).