Files
puter/src/gui
Nariman Jelveh f0d44a5d4f feat(puter-js): <puter-user-menu> can show an Upgrade button (#4711)
* feat(puter-js): <puter-user-menu> can show an Upgrade button

With the show-upgrade attribute, the user menu shows an Upgrade button to
the left of the Apps button for a signed-in user. It is hidden by default,
and while signed out or on a temporary account. Clicking it shows the
upgrade in a frame over a first-party page, and opens the dashboard's
upgrade page in a new tab anywhere else.

The dashboard upgrade URL always carries the upgrade parameter, empty when
no refused call is behind it, so the tab opens the upgrade flow either way.

* feat(puter-js): the user menu's Upgrade button reads Manage plan for an account with a plan

The button's label follows whoami's subscribed: Upgrade without a plan,
Manage plan with one (manage-plan-label overrides it). An upgrade made in
the frame the button opens changes the label when the frame closes. The
button is hidden for a seat, whose team changes the plan.

* fix(puter-js): the user menu's Upgrade button reads Manage plan after any framed upgrade

An upgrade made in a frame opened by puter.ui.requestUpgrade(), such as from
the usage limit dialog, gave the cached whoami a plan but left the button
reading Upgrade. The UI module now tells internal listeners when a framed
upgrade gives the user a plan, and the menu re-renders its plan state from it.

* fix(puter-js): a double-click on the user menu's Upgrade button opens one tab

On a page that can't frame the upgrade, each click of a double-click opened
the dashboard's upgrade page in its own tab. The button now ignores the
second click of a double-click.

* docs(puter-js): the user menu's label follows any framed upgrade

* fix(puter-js): the user menu's Upgrade button shows its pressed state under a mouse

The :hover rule came later at the same specificity, so a press looked the same as a hover.
2026-11-19 19:54:42 -07:00
..
…