Skip to content

Conversation

@samejr
Copy link
Member

@samejr samejr commented Jan 5, 2026

  • Adds 4 additional alert thresholds to ensure customers are emailed if they have runaway usage.
  • Separated these into a new section called "Spike alerts" with a tooltip so it's clear what they are.
  • Tooltip message is: "Catch runaway usage from bugs or errors. We recommend keeping these enabled as a safety net."
  • A billing service PR now returns all orgs to populate the email list, rather than oldest 5.
  • Adds defaultChecked logic to honour existing orgs who have configured alerts in the DB. New orgs get all alerts checked on by default.
CleanShot 2026-01-05 at 09 43 56@2x

@changeset-bot
Copy link

changeset-bot bot commented Jan 5, 2026

⚠️ No Changeset found

Latest commit: 17b6e5a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 5, 2026

Walkthrough

The pull request introduces two changes: a syntax fix in Tooltip.tsx that adds a trailing comma in variantClasses, and a new optional disableHoverableContent boolean prop added to InfoIconTooltip with a default value of false. Additionally, a new Spike alerts UI group is added to the billing-alerts route with checkbox options for alert levels (10.0, 20.0, 50.0, 100.0), each displaying formatted percentages and corresponding currency amounts, along with an informational tooltip.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive The description provides clear context about the changes, includes implementation details, explains the purpose, and includes a screenshot. However, it does not follow the required template structure with checklist, testing section, and changelog sections. Follow the repository's PR description template: include the checklist with checkmarks, a 'Testing' section describing test steps, and a 'Changelog' section with a summary of changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Chore(webapp): Adds additional billing alerts' directly and clearly describes the main change: adding new billing alert functionality.
✨ Finishing touches
  • 📝 Generate docstrings

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@vibe-kanban-cloud
Copy link

Review Complete

Your review story is ready!

View Story

Comment !reviewfast on this PR to re-generate the story.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.billing-alerts/route.tsx (1)

278-310: LGTM! Spike alerts section well-implemented.

The new Spike alerts UI group is well-structured with:

  • Clear labeling and helpful tooltip explaining the purpose
  • Proper use of formatNumber for large percentages (displays as 1,000%, 2,000%, etc.)
  • Consistent formatting with the existing alert levels section
  • Correct form field binding to alertLevels.name for unified submission

The defaultChecked logic correctly implements the intended behavior: preserve existing settings from the database, but enable all spike alerts by default for organizations that don't have them set yet (both new orgs and existing orgs seeing this feature for the first time).

💡 Optional: Add explanatory comment for defaultChecked logic

The defaultChecked logic at lines 303-306 is correct but relatively complex. Consider adding a brief comment to clarify the intent for future maintainers:

                      defaultChecked={
+                       // Preserve DB settings if spike alert exists, otherwise default to checked (safety net for new/existing orgs)
                        alerts.alertLevels.includes(level) ||
                        !spikeAlertLevels.some((l) => alerts.alertLevels.includes(l))
                      }
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between edf5b14 and 17b6e5a.

📒 Files selected for processing (2)
  • apps/webapp/app/components/primitives/Tooltip.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.billing-alerts/route.tsx
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Use types over interfaces for TypeScript
Avoid using enums; prefer string unions or const objects instead

Files:

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.billing-alerts/route.tsx
  • apps/webapp/app/components/primitives/Tooltip.tsx
{packages/core,apps/webapp}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use zod for validation in packages/core and apps/webapp

Files:

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.billing-alerts/route.tsx
  • apps/webapp/app/components/primitives/Tooltip.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use function declarations instead of default exports

Files:

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.billing-alerts/route.tsx
  • apps/webapp/app/components/primitives/Tooltip.tsx
apps/webapp/app/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/webapp.mdc)

Access all environment variables through the env export of env.server.ts instead of directly accessing process.env in the Trigger.dev webapp

Files:

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.billing-alerts/route.tsx
  • apps/webapp/app/components/primitives/Tooltip.tsx
apps/webapp/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/webapp.mdc)

apps/webapp/**/*.{ts,tsx}: When importing from @trigger.dev/core in the webapp, use subpath exports from the package.json instead of importing from the root path
Follow the Remix 2.1.0 and Express server conventions when updating the main trigger.dev webapp

Files:

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.billing-alerts/route.tsx
  • apps/webapp/app/components/primitives/Tooltip.tsx
**/*.{js,ts,jsx,tsx,json,md,css,scss}

📄 CodeRabbit inference engine (AGENTS.md)

Format code using Prettier

Files:

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.billing-alerts/route.tsx
  • apps/webapp/app/components/primitives/Tooltip.tsx
🧬 Code graph analysis (2)
apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.billing-alerts/route.tsx (2)
apps/webapp/app/components/primitives/Tooltip.tsx (1)
  • InfoIconTooltip (109-133)
apps/webapp/app/utils/numberFormatter.ts (2)
  • formatNumber (9-11)
  • formatCurrency (25-27)
apps/webapp/app/components/primitives/Tooltip.tsx (1)
packages/core/src/v3/schemas/style.ts (1)
  • Variant (8-8)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (23)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (3, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (8, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (6, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (5, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (2, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (7, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (1, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (1, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (4, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (7, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (2, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (3, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (8, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (4, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (5, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (6, 8)
  • GitHub Check: units / packages / 🧪 Unit Tests: Packages (1, 1)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (4)
apps/webapp/app/components/primitives/Tooltip.tsx (2)

9-9: LGTM! Formatting consistency improved.

The trailing comma follows Prettier conventions and maintains consistency with multi-line object formatting.


61-61: LGTM! New prop properly implemented.

The disableHoverableContent prop is correctly threaded through the component hierarchy from InfoIconTooltipSimpleTooltipTooltipProvider. The default value of false maintains backward compatibility, and the prop is properly typed throughout.

Also applies to: 75-75, 85-85, 114-114, 120-120, 130-130

apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.billing-alerts/route.tsx (2)

27-27: LGTM! Appropriate imports added.

The imports for InfoIconTooltip and formatNumber are correctly added to support the new spike alerts UI functionality.

Also applies to: 33-33


187-187: LGTM! Spike alert thresholds well-defined.

The spike alert levels (10x, 20x, 50x, 100x) are appropriate for catching runaway usage scenarios and align with the PR's objective of providing a "safety net" for customers.

@matt-aitken matt-aitken merged commit 1733805 into main Jan 7, 2026
32 checks passed
@matt-aitken matt-aitken deleted the chore(webapp)-additional-billing-alerts branch January 7, 2026 14:10
@mintlify mintlify bot mentioned this pull request Jan 7, 2026
samejr pushed a commit that referenced this pull request Jan 7, 2026
Updated the billing alerts documentation to reflect the new spike alerts
feature added in PR #2829. The documentation now explains both standard
alerts (75%, 90%, 100%, 200%, 500%) and spike alerts (10x, 20x, 50x,
100x) that help catch runaway usage from bugs or errors.

## Files changed
- `docs/how-to-reduce-your-spend.mdx` - Added section explaining the two
types of billing alerts

Generated from [Chore(webapp): Adds additional billing
alerts](#2829) @samejr

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
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.

3 participants