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

[Usage-based] Update billing page layout for teams and personal accounts #13564

Merged
merged 7 commits into from
Oct 10, 2022

Conversation

jankeromnes
Copy link
Contributor

@jankeromnes jankeromnes commented Oct 4, 2022

Description

Update billing page layout for usage-based teams and personal accounts.

Related Issue(s)

Fixes #13405

How to test

  1. Create a team called "Gitpod [Something]"
  2. Check the Team Billing UI
  3. Upgrade the team by adding a credit card
  4. Check the Team Billing UI again
  5. Go to /billing (your individual billing settings)
  6. Check your User Billing UI
  7. Upgrade your user by adding a credit card
  8. Check your User Billing UI again

Release Notes

NONE

Documentation

Werft options:

  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-payment
  • /werft with-integration-tests=all
    Valid options are all, workspace, webapp, ide

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Oct 4, 2022

/werft run

👍 started the job as gitpod-build-jx-improve-billing-ui.1
(with .werft/ from main)

@jankeromnes jankeromnes force-pushed the jx/improve-billing-ui branch from 6eedc93 to 4cfb758 Compare October 4, 2022 10:03
@roboquat roboquat added size/L and removed size/M labels Oct 4, 2022
@jankeromnes jankeromnes force-pushed the jx/improve-billing-ui branch from 4cfb758 to 438c78e Compare October 4, 2022 13:41
@jankeromnes
Copy link
Contributor Author

jankeromnes commented Oct 4, 2022

/werft run

👍 started the job as gitpod-build-jx-improve-billing-ui.4
(with .werft/ from main)

@jankeromnes jankeromnes force-pushed the jx/improve-billing-ui branch 2 times, most recently from 48dd275 to bf4cc13 Compare October 6, 2022 06:56
@jankeromnes jankeromnes force-pushed the jx/improve-billing-ui branch from bf4cc13 to c09132b Compare October 6, 2022 08:11
@roboquat roboquat added size/XL and removed size/L labels Oct 6, 2022
@jankeromnes
Copy link
Contributor Author

Screenshots

Billing Mode Light Dark
Team Billing (before upgrade) Screenshot 2022-10-06 at 10 47 12 Screenshot 2022-10-06 at 10 47 30
Team Billing (after upgrade) Screenshot 2022-10-06 at 10 49 17 Screenshot 2022-10-06 at 10 49 49
User Billing (before upgrade) Screenshot 2022-10-06 at 10 50 26 Screenshot 2022-10-06 at 10 50 47
User Billing (after upgrade) Screenshot 2022-10-06 at 10 51 57 Screenshot 2022-10-06 at 10 52 13

@jankeromnes jankeromnes marked this pull request as ready for review October 6, 2022 08:58
@jankeromnes jankeromnes requested a review from a team October 6, 2022 08:58
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Oct 6, 2022
@jankeromnes jankeromnes requested a review from gtsiolis October 6, 2022 09:52
@laushinka
Copy link
Contributor

Thanks, @jankeromnes!
For some time this was NaN when I upgraded my team.
When I came back from another page it was correctly a number.

Screenshot 2022-10-06 at 12 04 49

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Oct 6, 2022

For some time this was NaN when I upgraded my team.

Aha, good catch @laushinka! This happens when the usage limit is 0 (divide-by-zero gives NaN). To be honest, I'm not quite sure what we're supposed to show here when the usage limit is set to 0... 🤔

But the NaN definitely looks weird. Maybe let's hide the percentage when it doesn't make sense. 👍

@laushinka
Copy link
Contributor

This happens when the usage limit is 0 (divide-by-zero gives NaN).

How about when the limit is 0, instead of "Manage usage limit" we show "Set usage limit" and hide the percentage?

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Oct 6, 2022

How about when the limit is 0, instead of "Manage usage limit" we show "Set usage limit" and hide the percentage?

I like this suggestion! But doesn't 0 currently mean "I want absolutely no usage"? (I.e. when it's set to 0, I believe Gitpod won't start any workspaces, and you'll see the "limit reached" notification.)

Personally, I'd be happy with revisiting the semantics of usageLimit = 0, e.g. redefine it as "unlimited usage"?

@gtsiolis
Copy link
Contributor

gtsiolis commented Oct 6, 2022

Looking at this now! 👀

@laushinka
Copy link
Contributor

laushinka commented Oct 6, 2022

But doesn't 0 currently mean "I want absolutely no usage"? (I.e. when it's set to 0, I believe Gitpod won't start any workspaces, and you'll see the "limit reached" notification.)

Personally, I'd be happy with revisiting the semantics of usageLimit = 0, e.g. redefine it as "unlimited usage"?

Ahh, right. No limit means unlimited usage, but limit zero means no usage. Then let's go with your initial suggestion 👍🏼

Copy link
Contributor

@gtsiolis gtsiolis left a comment

Choose a reason for hiding this comment

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

Excited to see this feature coming together! ✨

Thanks, @jankeromnes!

Left some comments below, hopefully not too overwhelming. 🏁

Let's open follow-up issues for anything that feels out of the scope of this PR and could significantly increase the scope of the changes here. 🏓

</div>
</div>
)}
{showUpgradeTeam && (
Copy link
Contributor

Choose a reason for hiding this comment

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

issue: Probably not the best line to add this, but could we easily avoid the back-to-back duplicate spinners when loading the team billing page?

team-billing.mov

Copy link
Contributor Author

@jankeromnes jankeromnes Oct 7, 2022

Choose a reason for hiding this comment

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

Good catch! But I think it's not that easy to do away with them -- the first one is when we figure out whether to show the old Chargebee UI or the new Stripe UI, and the second one is while we actually load all the Stripe-relevant data.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or, we could simply decide not to show the initial spinner. I generally don't like leaving any "loading states" as a blank page ("wait, that's it? is it doing anything? is it broken?") but if it always transitions rapidly to the Stripe Billing UI, then maybe we could do without the first spinner. 💭

components/dashboard/src/settings/Billing.tsx Outdated Show resolved Hide resolved
components/dashboard/src/settings/Billing.tsx Outdated Show resolved Hide resolved
@jankeromnes
Copy link
Contributor Author

jankeromnes commented Oct 6, 2022

Woohoo, many thanks @gtsiolis for the extensive UX review!

/hold so that I get a chance to address your comments and suggestions 👀

@jankeromnes jankeromnes force-pushed the jx/improve-billing-ui branch from f65f604 to f9414d2 Compare October 7, 2022 16:55
@jankeromnes
Copy link
Contributor Author

jankeromnes commented Oct 7, 2022

Phew. Okay I've now addressed most of the comments/suggestions, including fixing the NaN % edge case. 🎉

I'm leaving as potential follow-up improvements:

  • Improving the handling of usage limits
  • Fixing or removing all billing page titles/subtitles
  • One thing about a footnote (didn't understand sorry)
  • What to do about the two subsequent spinners in team billing

With that, I think we're ready to merge this whenever we want! 🚀 It would be good to deploy this early next week, to support Early Access for Individuals.

/unhold

@@ -97,9 +97,12 @@ export default function Menu() {
// Hide most of the top menu when in a full-page form.
const isMinimalUI = inResource(location.pathname, ["new", "teams/new", "open"]);
const isWorkspacesUI = inResource(location.pathname, ["workspaces"]);
const isAccountUI = inResource(location.pathname, [
const isPersonalSettingsUI = inResource(location.pathname, [
Copy link
Member

Choose a reason for hiding this comment

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

[random] inResource is super misleading. I expected this to check if the pathname contains that resource, but it's actually checking if it starts with those resources.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for calling this out @easyCZ! I must admit I only briefly skimmed this code while implementing my fix, but I agree about the name inResource being super unclear and unhelpful. Do you have a better suggestion in mind? 🙂

Copy link
Member

Choose a reason for hiding this comment

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

resourceStartsWith or locationStartsWith comes to mind. Mostly to communicate it's not just a substring match, but a starts with match

@roboquat roboquat merged commit a4aab09 into main Oct 10, 2022
@roboquat roboquat deleted the jx/improve-billing-ui branch October 10, 2022 13:38
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note-none size/XL team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update billing page layout for teams and personal accounts
5 participants