Repository navigation
feat(reports): open new reports at daily hours, with an optional live session link - #1623
Conversation
Between dates gets Daily hours: all day, or from and to times on picked weekdays, with each day drawn and how far through its hours now is. A meeting link (Zoom, Google Meet, Teams or any call) is optional: authors see a Join button on the Publish page while new reports are open, and a shut one with the next opening while they wait for the hours. Mock state lives in this browser, so shared dev's settings are never changed.
…ng for today's hours
…s sign-up page A Zoom registration link is told apart by its address and offers Sign up on Zoom at any time, with Zoom emailing the link to join; a call's link still offers Join only while new reports are open. The Publithon setup uses the Africa Evidence Week registration.
… session link Between dates can open only during set hours on picked weekdays, read on the admin's timezone clock. Signing and activating are refused outside them, a day's limit reopens at the next day's hours, and the Publish page says when they open next in the reader's own time. An optional session link shows on the Publish page: the call, joined while new reports are open, or its sign-up page (Zoom registration is recognised), open whenever a session is still to come. Saving one date no longer drops what is being typed in the other.
Hours on the night clocks go back end the first time the clock reads their end. A limit that never reopens is said to be full rather than waiting for the next hours. Drawn days stay within the dates. The notice reads the true end and the reader's weekdays from the days the hours really fall on. Hours saved elsewhere go into their boxes.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 458eb519d4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| * the first time round, so hours on the night clocks go back are no longer than on any other. | ||
| */ | ||
| function onClock(year: number, month: number, day: number, minutes: number, timeZone: string) { | ||
| const at = zoned(year, month, day, Math.floor(minutes / 60), minutes % 60, timeZone); |
There was a problem hiding this comment.
Clamp skipped opening times to the end of the DST gap
When daily hours start inside a spring-forward gap, zoned() shifts the start forward by the gap rather than to the first valid instant, which can eliminate the entire session. For example, Sunday 02:30–03:30 in America/New_York on 14 March 2027 produces identical start and end instants of 07:30 UTC. At 03:15 local time, intakeAt() consequently reports closed, and refuseClosed() rejects signing and activation; at 03:30 it skips to the following Sunday without ever opening. Resolve skipped clock times to the gap's end so the valid remainder of the configured hours remains available.
Useful? React with 👍 / 👎.
| await intake({ mode: "dates", opensAt: Date.now() - 1, closesAt: Date.now() + 3_600_000 }); | ||
| // Between the dates, but not on a day its hours fall on. | ||
| const today = new Date().getUTCDay(); | ||
| const allDay = { from: 0, to: 24 * 60 - 1 }; |
There was a problem hiding this comment.
Freeze the clock for the daily-hours integration test
When this test runs between 23:59:00 and midnight UTC, the supposedly allDay hours have already ended because to is exclusive. The final sign() therefore rejects with FEATURE_DISABLED instead of returning R100001, causing a time-dependent CI failure. This test and its setup use the real clock; freeze the date at a known time inside the configured hours and restore it afterward.
Useful? React with 👍 / 👎.
| if (end <= start || end - start > DRAWN_DAYS * DAY) return null; | ||
| const days = hoursBetween(hours, start, end, timeZone, DRAWN_DAYS); | ||
| const sessions = days.filter((day) => day.open); | ||
| const left = sessions.filter((day) => day.end > now).length; |
There was a problem hiding this comment.
Include the final calendar date in the session summary
A range of fourteen elapsed days can touch fifteen calendar dates, so it passes the duration guard but is silently truncated by the fourteen-row cap. For example, with UTC dates 30 November 2026 at 12:00 through 14 December at 12:00 and weekday hours 11:00–13:00, the calendar ends on 13 December and omits the valid session on 14 December. At 11:30 that final Monday, the summary reports zero days left even though intake is open. Count the calendar dates before deciding whether to draw this summary, or include every date in the accepted range rather than calculating totals from a truncated list.
Useful? React with 👍 / 👎.
Hours that start in the hour the clocks skip open at the jump rather than vanishing. The days are drawn only when every calendar day the dates touch fits, so the summary never misses the last one. The flow test runs at a fixed noon, not whenever the suite does.
For the Publithon at Africa Evidence Week (Mon 30 Nov to Fri 4 Dec, 12:00 to 13:00 GMT). The 24 November build (#1527) let new reports open between two dates, but not for a set hour each day.
Settings > Publications > New reports
Publish page
Server
reportSettings.intakegains optionalhoursandmeeting. Rows saved before this keep working, so no migration is needed.savetakes and checks both.refuseClosedrefuses signing and activating outside the hours. A day's limit, once full, reopens at the next day's hours rather than at midnight. A limit that never reopens shows as full rather than "opens at the next hours".Checks
npx tsc --noEmit,check:ui-rulesandcheck:convex-rulespass.lib/reports/intake.test.ts,convex/reports/flow.test.tsandconvex/reports/activation.test.ts, 97 passed. New cases cover the hours, picked days, timezone, a day's limit, a limit that never reopens, the night the clocks go back, days drawn within the dates, the checks on save, and signing refused on a day not picked.All 13 languages carry the new strings.