Skip to content

Conversation

FranjoMindek
Copy link
Contributor

@FranjoMindek FranjoMindek commented Sep 17, 2025

Always display both subscription plan and credits information.
Currently, when subscriptions ends we don't display credits even though users use them.
This is because we rely on subscriptionStatus && subscriptionPlan && datePaid being null/undefined to show credits.

This fixes #503

Always display customer portal link button ("manage payment details") if possible. User's may use it to view past invoices, so it is important even when we don't have a subscription. Previously we only displayed it when we had subscription data.

Rename the "buy more/upgrade" button to "buy more credits" and move it to credits row.
Display it only if no active subscription.
If we want to manage/upgrade subscription we can always use the "manage payment details" button.
Only thing we need to navigate to pricing page for is to buy more credits.

# Conflicts:
#	template/app/src/user/AccountPage.tsx
#	template/e2e-tests/tests/utils.ts
@FranjoMindek
Copy link
Contributor Author

@infomiho this is not urgent, but you did self-assign.
Just commenting in case you forgot you self-assigned.

Copy link
Collaborator

@infomiho infomiho left a comment

Choose a reason for hiding this comment

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

Smaller comments - sorry it took so long to review!

Comment on lines 156 to 161
<WaspRouterLink
to={routes.PricingPageRoute.to}
className='font-medium text-sm text-primary hover:text-primary/80 transition-colors duration-200'
>
<Button variant='link'>Buy More Credits</Button>
</WaspRouterLink>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't we have some sort of asChild or as attribute on Link so it renders as a button?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not as far as I can tell.

<Separator />
<div className='py-4 px-6'>
<div className='grid grid-cols-1 sm:grid-cols-3 sm:gap-4'>
<dt className='text-sm font-medium text-muted-foreground'>Credits</dt>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was old code.
From what I can see we use "description list" but without <dl> to emulate what looks like a table.
Really weird.

If we want a table we should use table. I think it might be best to turn all of these into <div> for now.
Then later we can create a proper table.

Credits
</dt>
<dd className="text-foreground mt-1 text-sm sm:col-span-1 sm:mt-0">
{user.credits + " credits"}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
{user.credits + " credits"}
{user.credits} credits

Copy link
Contributor Author

@FranjoMindek FranjoMindek Oct 2, 2025

Choose a reason for hiding this comment

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

This screws up the <dd> rendering. It makes it have 2 children instead of one.
Which screws up locator text search in playwright.
Actually wanted to have it that way. 😞

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually works now that we no longer have <dd>

@FranjoMindek FranjoMindek merged commit a41fb47 into main Oct 9, 2025
1 check passed
@FranjoMindek FranjoMindek deleted the franjo/account-page-improvements branch October 9, 2025 13:40
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.

User credits not displayed after cancelling subscription

2 participants