fix(signals): state the org-wide PR allowance where PRs are turned on - #75897
fix(signals): state the org-wide PR allowance where PRs are turned on#75897posthog[bot] wants to merge 1 commit into
Conversation
The free PR tier and the usage limit are allocated per organization, but the switch that spends them (autostart_enabled) is per project, and the only place the org-wide scope was stated was two hover tooltips on the usage widget. Move that scope into visible copy: on the PR generation panel, where someone turns generation on, and on the usage widget next to the count and the free-tier figure. Also name the scope in the onboarding pricing line and the PR limit modal, since both promise a free allowance without saying whose it is. No billing logic changes. Generated-By: PostHog Code Task-Id: a67a2ca9-4915-4b63-924f-477621b3f775
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
🤖 CI report
|
| Root | Eager (shipped) | Δ vs base | Budget |
|---|---|---|---|
entry (logged-out pages, app bootstrap)src/index.tsx |
1.25 MiB · 22 files | no change | ███░░░░░░░ 27.7% of 4.51 MiB |
authenticated shell (every logged-in page)src/scenes/AuthenticatedShell.tsx |
8.12 MiB · 3,023 files | no change | ████████░░ 83.6% of 9.71 MiB |
🟢 node_modules/monaco-editor/ stays out of src/index.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/index.tsx
🟢 [object Object] stays out of src/index.tsx
🟢 [object Object] stays out of src/index.tsx
🟢 node_modules/monaco-editor/ stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/scenes/AuthenticatedShell.tsx
🟢 [object Object] stays out of src/scenes/AuthenticatedShell.tsx
🟢 [object Object] stays out of src/scenes/AuthenticatedShell.tsx
Largest files eagerly shipped from src/index.tsx
| Size | File |
|---|---|
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 24.6 KiB | ../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.js |
| 6.3 KiB | ../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js |
| 4.5 KiB | ../node_modules/.pnpm/@jspm+core@2.1.0/node_modules/@jspm/core/nodelibs/browser/process.js |
| 3.9 KiB | ../node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.production.min.js |
| 1.4 KiB | ../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js |
| 1.3 KiB | src/RootErrorBoundary.tsx |
| 912 B | ../node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js |
| 789 B | src/scenes/ChunkLoadErrorBoundary.tsx |
| 762 B | src/index.tsx |
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx
| Size | File |
|---|---|
| 285.3 KiB | ../node_modules/.pnpm/posthog-js@1.409.2/node_modules/posthog-js/dist/rrweb.js |
| 267.7 KiB | ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
| 235.5 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 231.4 KiB | ../node_modules/.pnpm/posthog-js@1.409.2/node_modules/posthog-js/dist/module.js |
| 154.3 KiB | ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js |
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 105.2 KiB | src/lib/api.ts |
| 94.7 KiB | ../packages/quill/packages/quill/dist/index.js |
| 93.3 KiB | ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js |
| 90.6 KiB | ../node_modules/.pnpm/@tiptap+core@3.20.6_@tiptap+pm@3.20.6/node_modules/@tiptap/core/dist/index.js |
Posted automatically by check-eager-graph · sizes are eager output bytes (shipped, post-tree-shake) from the esbuild metafile · part of #32479
✅ Toolbar bundle — eager 2.19 MiB within budget
What the toolbar ships to customer pages, measured from the esbuild output (minified, post-tree-shake). The eager set is the entry plus everything statically imported from it — fetched before any feature runs; deferred chunks load lazily. The eager guardrail is 5.72 MiB. Each output file must also stay below 10 MB, where CloudFront stops compressing it. The module boundary is enforced separately by check-toolbar-graph.
| Metric | Size | Δ vs base | Budget |
|---|---|---|---|
| Eager (shipped) entry + static imports |
2.19 MiB · 17 files | no change | ████░░░░░░ 38.3% of 5.72 MiB |
| Deferred (lazy) | 2.08 MiB · 33 files | no change | n/a — loads on demand |
Loader dist/toolbar.js |
1.1 KiB | no change | █░░░░░░░░░ 5.8% of 19.5 KiB |
Largest eagerly-shipped chunks
| Size | File |
|---|---|
| 717.8 KiB | dist/toolbar/toolbar-app-2QFKEBT7.css |
| 551.1 KiB | dist/toolbar/chunk-chunk-5FDJUV5A.js |
| 484.6 KiB | dist/toolbar/chunk-chunk-QCKKTYHY.js |
| 133.6 KiB | dist/toolbar/chunk-chunk-UDBJ4EGL.js |
| 131.8 KiB | dist/toolbar/chunk-chunk-T5KY5WYR.js |
| 71.0 KiB | dist/toolbar/toolbar-app-DBANC7W5.js |
| 69.0 KiB | dist/toolbar/chunk-chunk-27JL52RE.js |
| 35.6 KiB | dist/toolbar/chunk-chunk-QFZQEUXB.js |
| 20.9 KiB | dist/toolbar/chunk-chunk-HWIVFWBZ.js |
| 12.2 KiB | dist/toolbar/chunk-chunk-PIK3PADE.js |
Posted automatically by check-toolbar-size · sizes are toolbar output bytes (shipped, post-tree-shake) from the esbuild metafile
✅ Dist folder size — 🔺 +1.2 KiB (+0.0%)
Total size of the built frontend/dist folder (all assets), compared against the base branch.
Total: 1370.99 MiB · 🔺 +1.2 KiB (+0.0%)
|
👋 Visual changes detected for this PR. Review and approve in PostHog Visual Review If these changes are unexpected, they may be caused by a flaky test or a broken snapshot on master. Don't approve — rerun the job or wait for a fix. |
Problem
The free PR tier and the PR usage limit are allocated per organization. The switch that spends them is per project. Nothing on screen connected the two.
period_billable_credits_for_organdcredited_refund_credits_for_orginproducts/signals/backend/billing.pyboth roll up across every team in the org, andcustom_limits_usdis org-level too. But the only place we said so was two hover tooltips on the usage widget, and hover text only reaches someone who is already suspicious. MeanwhileSignalTeamConfig.autostart_enabledis team-scoped, and the panel that renders it never mentioned billing at all.So you flip a per-project switch, get an org-level bill, and the free allowance you thought you had per project turns out to be shared. That reaches us as billing surprise via support, which is the most expensive way to find out.
Why: a customer asked why they were charged when they expected the PRs to be free. They had PRs across two projects and reasonably read the free tier as per project.
Changes
Copy and layout only. No billing logic touched.
SelfDrivingSection.tsx– the panel with the switch now states the scope where the decision gets made, and points at the Usage section further down the same rail:InboxUsageWidget.tsx– both tooltips are gone. The org-wide scope and the free-tier figure are visible copy under the card title. The bar and the count are plain elements again, so thetabIndexthat existed only to make the tooltip keyboard-reachable is no longer needed.Two more places promised a free allowance without saying whose it is, so they get the scope too:
custom_limits_usd, so its description and free-tier line now say so.Note
Deliberately out of scope: whether the free tier should be per project is a pricing call, not an engineering one. Separately, a team with no
SignalTeamConfigrow defaults toPriority.P4, so a brand-new team autostarts PRs at every priority. That deserves a product decision rather than a quiet change in a copy PR.How did you test this code?
No automated tests added. Asserting a string back to itself catches nothing a reviewer reading the diff doesn't.
What I actually ran:
pnpm --filter=@posthog/frontend typescript:check– clean for these files. The only remaining errors in this environment come from unbuilt workspace packages (@posthog/hogvm) and are present onmastertoo.pnpm --filter=@posthog/frontend fix(Oxlint + Oxfmt) andhogli ci:preflight --fix– both clean.railandstackedlayouts.Existing
InboxUsageWidgetstories cover the states and now render the new line.Automatic notifications
Docs update
Not needed. No documented workflow, API, or setting changes.
🤖 Agent context
Autonomy: Fully autonomous
Claude (Claude Code, Opus 5) wrote this from a PostHog Inbox report. I confirmed the report's claim before changing anything: read both
_for_orgbilling helpers,SignalTeamConfig, andinboxUsageLogic, which already carries a comment noting usage and refunds are org-wide. Invoked/writing-user-facing-copy.Decisions along the way:
AgentSetupColumna short scroll apart, so an in-page anchor would mean anidplusscrollIntoViewplumbing, or a hash the SPA router would have to tolerate, to replace a sentence that already works.text-secondaryrather than the faintertext-tertiaryfor the new lines. The failure mode here was copy nobody read, so fine print would have reproduced the tooltip problem at a different opacity.The report also flagged that there is no instrumentation on either surface, so the confusion can only be sized by support volume. I did not add capture calls here to keep this reviewable as a pure copy change.
Created with PostHog Code from an inbox report