fix(billing-ui): open settings when enterprise sub folks press usage indicator#1194
fix(billing-ui): open settings when enterprise sub folks press usage indicator#1194waleedlatif1 merged 1 commit intostagingfrom
Conversation
There was a problem hiding this comment.
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
Summary
Type of Change
Testing
Tested manually.
Checklist