Skip to content

Comments

Added ability to upgrade to pro from the tray#8452

Merged
jigar-f merged 1 commit intomainfrom
myles/tray-upgrade-to-pro
Feb 9, 2026
Merged

Added ability to upgrade to pro from the tray#8452
jigar-f merged 1 commit intomainfrom
myles/tray-upgrade-to-pro

Conversation

@myleshorton
Copy link
Contributor

This pull request enhances the system tray menu by introducing dynamic behavior based on the user's subscription status. The main improvement is the addition of an "Upgrade to Pro" menu item for non-Pro users, and the notifier now listens for changes in the user's Pro status to update the tray menu accordingly.

User subscription awareness and tray menu updates:

  • Added a _isUserPro field to SystemTrayNotifier and initialized it using the isUserProProvider. The notifier now listens for changes to the user's Pro status and updates the tray menu when it changes. [1] [2]
  • Updated the tray menu to conditionally show an "Upgrade to Pro" menu item for non-Pro users, which opens the plans page when clicked.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR makes the system tray menu subscription-aware by adding an “Upgrade to Pro” entry for non‑Pro users and refreshing the tray menu when the user’s Pro status changes.

Changes:

  • Added _isUserPro state to SystemTrayNotifier and wired it to isUserProProvider with a listener that triggers tray menu refresh.
  • Updated the tray menu to conditionally include an “Upgrade to Pro” action that opens the app window and navigates to the Plans screen.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 77 to 88
MenuItem.separator(),
if (!_isUserPro)
MenuItem(
key: 'upgrade_to_pro',
label: 'upgrade_to_pro'.i18n,
onClick: (_) {
ref.read(windowProvider.notifier).open(focus: true);
appRouter.push(Plans());
},
),
MenuItem.separator(),
MenuItem(
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

When _isUserPro is true, the if (!_isUserPro) MenuItem(...) is skipped but the following MenuItem.separator() is still added, resulting in two consecutive separators in the tray menu (the separator at line 77 and the one at line 87). Make the separator conditional (or restructure the items list) so separators only appear between actual menu items.

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +36
ref.listen<bool>(
isUserProProvider,
(previous, next) async {
_isUserPro = next;
await updateTrayMenu();
},
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

ref.listen callbacks are declared async and await updateTrayMenu(), but Riverpod does not await the returned Future. This can lead to overlapping updateTrayMenu() executions (from both the VPN status listener and this Pro-status listener) and out-of-order menu state if an earlier update completes after a later one. Consider making the listener callback synchronous and serializing/coalescing tray updates inside the notifier (e.g., via a queued update or a single in-flight refresh).

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@jigar-f jigar-f left a comment

Choose a reason for hiding this comment

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

LGTM.

@jigar-f jigar-f merged commit e630faf into main Feb 9, 2026
15 checks passed
@jigar-f jigar-f deleted the myles/tray-upgrade-to-pro branch February 9, 2026 10:46
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.

2 participants