Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: render projected amount at top of page #29195

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

zlwaterfield
Copy link
Contributor

@zlwaterfield zlwaterfield commented Feb 25, 2025

Changes

If the project amount is > 0 and the feature flag is on then render the rolled up total. Behind ff for now to test.

Screenshot 2025-02-25 at 11 15 50 AM

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Does this work well for both Cloud and self-hosted?

It doesn't have an impact.

How did you test this code?

Manually

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Added a feature to display projected billing totals on the billing page when enabled by a feature flag.

  • Added new feature flag PROJECTED_TOTAL_AMOUNT in frontend/src/lib/constants.tsx with owner attribution
  • Extended BillingType interface in frontend/src/types.ts with projected_total_amount_usd and projected_total_amount_usd_after_discount properties
  • Implemented conditional rendering in frontend/src/scenes/billing/Billing.tsx to show projected totals alongside current bill when the feature flag is enabled and projected amount > 0
  • Added informative tooltip to explain the projected total amount to users

3 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +209 to +210
billing?.projected_total_amount_usd
)}
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Optional chaining is redundant here since we already check for billing?.projected_total_amount_usd on line 194

Suggested change
billing?.projected_total_amount_usd
)}
billing.projected_total_amount_usd
)}

Copy link
Contributor

github-actions bot commented Feb 25, 2025

Size Change: +625 B (+0.01%)

Total Size: 9.72 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 9.72 MB +625 B (+0.01%)

compressed-size-action

Copy link
Contributor

@patricio-posthog patricio-posthog left a comment

Choose a reason for hiding this comment

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

Looks good to me. This doesn't not break if the customer has also credits, right? Bceause it's in the same space.

Copy link
Member

@raquelmsmith raquelmsmith left a comment

Choose a reason for hiding this comment

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

Kewl 👍

@zlwaterfield
Copy link
Contributor Author

Looks good to me. This doesn't not break if the customer has also credits, right? Bceause it's in the same space.

Yeah they will just show side by side

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