Repository navigation
feat(reports): open new reports between dates, with limits on activations - #1527
Conversation
Admin Publishing gets a New reports row (Off, On, Between dates), a timezone, and limits on activations per day, week, month or the whole time open, each rolling or calendar. While closed, the Publish page says the period is over, and New report, Next and Activate wait. Mock state lives in localStorage.
…ions New reports get their own setting on Admin > Publishing, separate from the Publish switch: off (the default), on, or between two dates, with any number of limits on activations a day, a week, a month or the whole time open, each rolling or calendar in a chosen timezone. Signing and Activate refuse while new reports are closed, counted in the mutation that takes the place. The Publish page works out the same from forAuthors and its clock: New report, a draft's Next and Activate wait, and the page says the period is over and when the next starts. migrations/reportIntake keeps new reports open where publishing was on.
|
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: b4cde5a32d
ℹ️ 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".
Saves send only what changed, so one admin's change never puts back another's. A day whose midnight a clock change skips starts at the first instant after the gap. The payment dialog closes when the last place is taken, the closed notice opens by height under the step trail and above the list, an organisation admin sees it on a member's draft, and up to 50 limits.
At 50 limits and 5,000 activations the admin's counts took seconds, each row asking the calendar again; once per limit they take 16 ms.
For the Publithon: admins can open new reports for a set time and cap how many reports get activated, separately from the Publish switch.
Admin > Publishing > New reports
What authors see while closed
How it works
reportSettings.intake. A save sends only the fields that changed, and the server merges them. Nothing reads the clock in a query:forAuthorssends each limit'snth, which is the time of the count-th latest activation. The page works out full or open from that and its own 30-second clock (lib/reports/intake.ts).reportActivations.by_state_and_atindex. A charge that comes to nothing frees its place.signandactivation.beginrefuse withFEATURE_DISABLED, reasonintake, inside the mutation that takes the place.migrations/reportIntake:runkeeps new reports open, with no limit, on a deployment where publishing was already on, so deploying closes nothing. Run it right after the Convex push, then drop the file.Checks
lib/reports/intake.test.tscovers calendar starts in a timezone, including a daylight-saving change and Santiago's skipped midnight, the rolling boundary, and the reopen time.convex/reportsandlib/reports.tsc,check:ui-rules,check:convex-rules,check:user-actionsand the message placeholder test pass.next devpointed at it: the migration, saves and refusals all worked. In the browser, the admin meters, the list notice, the greyed New report, a real draft's notice with Next greyed out, and the closed new-report page all showed correctly. An open draft closed live when its limit filled.