Skip to content

Show the upgrade in Builder from the Upgrade dialog - #189

Merged
jelveh merged 1 commit into
mainfrom
in-page-upgrade
Nov 20, 2026
Merged

jelveh merged 1 commit into
mainfrom
in-page-upgrade

Conversation

@jelveh

@jelveh jelveh commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

What changed

The Upgrade button in the "Upgrade your Puter plan" dialog used to always open Puter's upgrade page in a new tab. It now asks puter.js to show the upgrade first, and only opens the page when puter.js has nothing to show.

  • On the web, signed in, on a Puter address: puter.ui.requestUpgrade() shows the upgrade in a frame over Builder.
  • Inside the Puter desktop: the same call opens the desktop's upgrade window.
  • Anywhere else (localhost, for one): the button is still a link to the upgrade page, and opens it in a new tab as before.

If the frame can't open, puter.js opens the upgrade page itself.

After the upgrade

A payment made in the frame is checked for as soon as the frame closes, so the success dialog and Upgrade Completed no longer wait for the tab to regain focus. The plan is read up to five times, two seconds apart, in case it isn't on the account yet. If it still isn't, the click stays pending and the existing focus check picks it up.

Not changed

  • The "See plans" link a paid user sees in the same dialog still opens the page.
  • The out-of-credits dialog's Upgrade button still opens the page.

Testing

  • scripts/test-upgrade-pending.mjs now covers the new path against the real code from ui.js: the frame, the desktop, each case where the link is followed instead, a plan that lands late, and a frame closed without paying.
  • npm test passes.
  • Not tried in a browser: the frame only shows on a Puter address, so a local dev server always takes the link path.

The Upgrade button in the "Upgrade your Puter plan" dialog now asks
puter.js to show the upgrade first: in a frame over the page on the web,
or the desktop's upgrade window inside Puter. Where puter.js has neither
(localhost, for one), the button still opens Puter's upgrade page in a
new tab, as before.

A payment made in the frame is checked for as soon as the frame closes,
so the success dialog and 'Upgrade Completed' no longer wait for the tab
to regain focus.
@jelveh
jelveh merged commit b97d0da into main Nov 20, 2026
1 check passed
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.

1 participant