Skip to content

feat(reports): open new reports between dates, with limits on activations - #1527

Merged
sickerine merged 4 commits into
devfrom
feat/new-report-limits
Nov 24, 2026
Merged

sickerine merged 4 commits into
devfrom
feat/new-report-limits

Conversation

@sickerine

@sickerine sickerine commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • Off (the default for a new setup), On, or Between dates (opens and closes, either left empty).
  • Up to 50 limits. Each one is N activations a day, a week, a month, or the whole time open. Day, week and month are rolling (last 24 hours, 7 days, 30 days) or calendar (midnight, Monday, the 1st) in a chosen timezone.
  • Each limit shows a meter of this period's activations and when its count starts again. The heading chip says Open, Opens…, Full until…, or Ended….

What authors see while closed

  • The Publish switch still shows the page, the list and editing.
  • New report is greyed out with a tooltip giving the reason. A new report's page says the period is over and when the next one starts, if one is set.
  • A draft that has never been live shows the same notice, which opens by height under the step trail. Its Next buttons and Activate are greyed out with the reason, and an open payment confirmation closes.
  • A payment already under way finishes.

How it works

  • Settings are saved on reportSettings.intake. A save sends only the fields that changed, and the server merges them. Nothing reads the clock in a query: forAuthors sends each limit's nth, 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).
  • A place is taken when Activate starts: activations that are charging, pending or live count, read from the new reportActivations.by_state_and_at index. A charge that comes to nothing frees its place.
  • sign and activation.begin refuse with FEATURE_DISABLED, reason intake, inside the mutation that takes the place.
  • migrations/reportIntake:run keeps 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.
  • New words are in all 13 locales.

Checks

  • lib/reports/intake.test.ts covers calendar starts in a timezone, including a daylight-saving change and Santiago's skipped midnight, the rolling boundary, and the reopen time.
  • New Convex tests: signing is refused while new reports are off or not yet open. Activate is refused once a place is taken, and an activation the bank refused doesn't count. The Activate test fails with the refusal removed.
  • 220 tests pass in convex/reports and lib/reports. tsc, check:ui-rules, check:convex-rules, check:user-actions and the message placeholder test pass.
  • Cross-family review (GPT-6.1 Sol): five findings, all fixed in cdcb5e1. Codex bot: two findings, both handled (ae5888d, and the runtime check below).
  • Runtime check on a throwaway Convex Cloud project with next dev pointed 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.

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.
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0f40330b-19e7-4947-8c61-70fa67f2bbd7
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T13:16:30.067318Z b4cde5a PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread lib/reports/intake.ts Resolved
Comment thread components/reports/admin-settings.tsx Resolved
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.
@sickerine
sickerine merged commit fbbf089 into dev Nov 24, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant