Skip to content

chore(seer): Add seer automation alert on subscription page after checkout #93935

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

Merged
merged 6 commits into from
Jun 20, 2025

Conversation

roaga
Copy link
Member

@roaga roaga commented Jun 20, 2025

Adds a dismissible alert banner at the top of the subscription page that shows when being redirected there post-checkout with Seer purchased. It notifies the user that Seer automation is on and offers a link to settings.

I did not use the custom colors in the design because the Alert component did not play nicely with them. I also did not put the exact settings status because that would require making a network request for each project in an org. I tweaked the copy to make sense given that constraint.

Screenshot 2025-06-20 at 7 24 54 AM

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 20, 2025
Copy link

codecov bot commented Jun 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #93935   +/-   ##
=======================================
  Coverage   88.03%   88.03%           
=======================================
  Files       10343    10343           
  Lines      597355   597355           
  Branches    23217    23217           
=======================================
  Hits       525870   525870           
  Misses      70981    70981           
  Partials      504      504           

@roaga roaga marked this pull request as ready for review June 20, 2025 15:40
@roaga roaga requested a review from a team as a code owner June 20, 2025 15:40

export default function SeerAutomationAlert({organization}: SeerAutomationAlertProps) {
const location = useLocation();
const isCheckoutRedirect = !!location.query.referrer; // only show this alert when redirected to this page, such as from the checkout page
Copy link
Member

Choose a reason for hiding this comment

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

i don't think looking at the presence of referrer alone is sufficient here

there are a couple in-product places where we redirect to this page and provide a referrer that aren't from checkout

Copy link
Member

Choose a reason for hiding this comment

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

instead, we can modify the redirect in submitCheckout to pass a query parameter when the user has just bought seer, ie.

hasBoughtSeer = // whatever logic to indicate a user just bought seer
normalizeUrl(
        `/settings/${organization.slug}/billing/overview/?referrer=${referrer}&show_seer_automation_alert={hasBoughtSeer}`
      )

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Copy link
Member

@isabellaenriquez isabellaenriquez left a comment

Choose a reason for hiding this comment

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

just one thing i should've clarified! lgtm otherwise, thanks rohan

@@ -625,14 +625,18 @@ export async function submitCheckout(
addSuccessMessage(t('Success'));
recordAnalytics(organization, subscription, data, isMigratingPartnerAccount);

const justBoughtSeer = data.seer;
Copy link
Member

Choose a reason for hiding this comment

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

the only thing with this is that this would set showSeerAutomationAlert=true everytime a user went through checkout and either just bought Seer or already had it purchased

Suggested change
const justBoughtSeer = data.seer;
const alreadyHadSeer = !isTrialPlan && (subscription.reservedBudgets?.some(budget => (budget.apiName as string as SelectableProduct) ===
SelectableProduct.SEER && budget.reservedBudget > 0));
const justBoughtSeer = data.seer && !alreadyHadSeer;

what alreadyHadSeer does is checks that the customer already had Seer enabled by looking at the current state of subscription (which is not yet refreshed); if they were on a trial plan at checkout time they had a seer budget > 0 but we don't count that as having purchased Seer already

@roaga roaga merged commit 72fab5d into master Jun 20, 2025
46 checks passed
@roaga roaga deleted the seer/alert-after-checkout branch June 20, 2025 16:24
@github-actions github-actions bot locked and limited conversation to collaborators Jul 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants