Skip to content

tier flags#1699

Merged
Alek99 merged 1 commit intomainfrom
carlos/disable-free-tier-flag
Dec 5, 2025
Merged

tier flags#1699
Alek99 merged 1 commit intomainfrom
carlos/disable-free-tier-flag

Conversation

@carlosabadia
Copy link
Copy Markdown
Collaborator

No description provided.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Dec 4, 2025

Greptile Overview

Greptile Summary

This PR introduces feature flags to control the visibility of different pricing tiers (Free and Pro) on the pricing page. When tiers are disabled, users see an alternative enterprise demo form instead of the full pricing cards.

Key changes:

  • Added ENABLE_FREE_TIER and ENABLE_PRO_TIER environment variables for flexible tier visibility control
  • Uncommented the previously hidden Pro tier pricing card, now conditionally rendered based on flags
  • Refactored pricing table feature definitions from tuples to a proper Feature dataclass for better type safety
  • Created fallback enterprise-only demo form for when free/pro tiers are disabled
  • Removed hosting banner from navbar

The implementation uses Reflex's conditional rendering (rx.cond) to dynamically adjust the UI layout based on tier availability, ensuring a clean user experience regardless of which tiers are enabled.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are well-structured and implement a straightforward feature flag system. The refactoring from tuples to dataclasses improves type safety. All conditional rendering logic is sound, and the changes are non-breaking - the default behavior (both flags false) shows enterprise-only content, while enabling flags progressively adds more pricing tiers. No security issues or logic errors detected.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
pcweb/constants.py 5/5 Added environment variables ENABLE_FREE_TIER and ENABLE_PRO_TIER to control tier visibility via feature flags
pcweb/pages/pricing/enable_tiers_state.py 5/5 New state class to manage tier visibility flags from environment variables
pcweb/pages/pricing/plan_cards.py 5/5 Uncommented Pro tier card and added conditional rendering based on EnableTiersState flags, with alternative enterprise demo form
pcweb/pages/pricing/table.py 5/5 Refactored feature data structure to use dataclass, added conditional column rendering based on tier flags

Sequence Diagram

sequenceDiagram
    participant ENV as Environment Variables
    participant Constants as constants.py
    participant State as EnableTiersState
    participant PricingPage as Pricing Page
    participant User as User Browser
    
    ENV->>Constants: ENABLE_FREE_TIER=true/false
    ENV->>Constants: ENABLE_PRO_TIER=true/false
    Constants->>State: Initialize enable_free_tier field
    Constants->>State: Initialize enable_pro_tier field
    
    User->>PricingPage: Load pricing page
    PricingPage->>State: Check enable_free_tier
    PricingPage->>State: Check enable_pro_tier
    
    alt enable_free_tier = true
        State->>PricingPage: Show header & pricing cards
        alt enable_pro_tier = true
            PricingPage->>User: Display Hobby + Pro + Enterprise (3 columns)
        else enable_pro_tier = false
            PricingPage->>User: Display Hobby + Enterprise (2 columns)
        end
    else enable_free_tier = false
        State->>PricingPage: Hide header, show demo form
        PricingPage->>User: Display enterprise demo form only
    end
    
    Note over PricingPage,User: Tables also conditionally render columns based on flags
Loading

Copy link
Copy Markdown
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.

7 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@Alek99 Alek99 merged commit eb6bd1d into main Dec 5, 2025
11 of 12 checks passed
@Alek99 Alek99 deleted the carlos/disable-free-tier-flag branch December 5, 2025 23:39
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