Skip to content

fix(billing-ui): open settings when enterprise sub folks press usage indicator#1194

Merged
waleedlatif1 merged 1 commit intostagingfrom
fix/billing-ui
Aug 29, 2025
Merged

fix(billing-ui): open settings when enterprise sub folks press usage indicator#1194
waleedlatif1 merged 1 commit intostagingfrom
fix/billing-ui

Conversation

@waleedlatif1
Copy link
Collaborator

@waleedlatif1 waleedlatif1 commented Aug 29, 2025

Summary

  • open settings when enterprise sub folks press usage indicator
    • previously, we open the settings indicator for users that are on the team plan and users that are blocked
    • now, we show the settings for enterprise users all around as well

Type of Change

  • Bug fix

Testing

Tested manually.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Aug 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sim Building Building Preview Comment Aug 29, 2025 11:09pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Aug 29, 2025 11:09pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR fixes a user experience issue in the billing UI where enterprise subscription users were incorrectly shown the subscription upgrade modal when clicking the usage indicator. The change modifies the onClick handler in the sidebar component to check both the existing billing block status and a new condition using canUpgrade() from the subscription store.

The modification extracts the subscription store state once to avoid multiple calls, then evaluates two conditions: whether billing is blocked (isBlocked) and whether the user can upgrade their subscription (!canUpgrade). If either condition is true, the system now dispatches an 'open-settings' event with the subscription tab instead of showing the subscription modal. This creates a more logical user flow where enterprise users (who are already on the highest tier) are directed to their subscription settings rather than being presented with upgrade options that don't apply to them.

This change integrates well with the existing subscription management system, utilizing the established useSubscriptionStore and the existing settings modal infrastructure. The fix maintains the current behavior for users who can upgrade while providing a more appropriate experience for enterprise users who cannot.

PR Description Notes:

  • The PR template fields are not filled out (Summary, Type of Change, Testing sections are incomplete)
  • No issue number is referenced in the "Fixes #(issue)" placeholder
  • Testing approach and focus areas are not specified

Confidence score: 4/5

  • This PR addresses a clear UX issue with minimal risk and uses existing patterns
  • Score reflects solid logic but lacks comprehensive testing details in the description
  • No files require special attention as the change is straightforward and well-contained

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit 7e23e94 into staging Aug 29, 2025
3 of 4 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/billing-ui branch August 29, 2025 23:11
Sg312 pushed a commit that referenced this pull request Aug 30, 2025
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
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