Skip to content

Feat/implement pricing page#10

Merged
arxja merged 7 commits into
mainfrom
feat/implement-pricing-page
Jun 14, 2026
Merged

Feat/implement pricing page#10
arxja merged 7 commits into
mainfrom
feat/implement-pricing-page

Conversation

@arxja

@arxja arxja commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Launched a new pricing page with multiple billing plan options.
    • Added billing cycle toggle to switch between monthly and yearly pricing with savings calculations.
    • Implemented animated pricing cards with "Most Popular" highlighting and plan-specific call-to-action buttons.
  • Tests

    • Added comprehensive test coverage for pricing page functionality and user interactions.

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@arxja, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 28 minutes and 59 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 477ee179-57a4-4ce8-a7e6-cbdf8ea2d39c

📥 Commits

Reviewing files that changed from the base of the PR and between fb25b3b and 5004040.

📒 Files selected for processing (3)
  • __tests__/components/Pricing.test.tsx
  • components/Pricing.tsx
  • lib/config/index.ts
📝 Walkthrough

Walkthrough

Adds a new client-side Pricing component with GSAP scroll animations, a monthly/yearly billing toggle, and a plan card grid that builds CTA links from a Stripe checkout env var or a mailto: address. Wires it to a new Next.js /pricing route and covers it with a Vitest/RTL test suite.

Changes

Pricing Feature

Layer / File(s) Summary
Pricing component: imports, state, GSAP, helpers
components/Pricing.tsx
Registers ScrollTrigger, initializes billingCycle state and element refs, sets up useGSAP scroll-triggered fromTo animations for the heading and each card, and adds helpers for price display, period suffix, and yearly savings text.
Pricing component: UI rendering and Next.js route
components/Pricing.tsx, app/(root)/pricing/page.tsx
Renders animated heading, billing-cycle toggle, and a plan cards grid with conditional "Most Popular" styling, CTA Link elements using NEXT_PUBLIC_STRIPE_CHECKOUT_URL query params or mailto:, feature lists, limit indicators, and a free-plan footer note. The route page simply renders <Pricing />.
Test suite
__tests__/components/Pricing.test.tsx
Mocks gsap, controls NEXT_PUBLIC_STRIPE_CHECKOUT_URL per test, and asserts rendering, billing toggle, CTA href values, visual/responsive classes, edge cases (missing env var, savings messaging), and accessibility (heading hierarchy, focus classes).

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant PricingPage as /pricing route
  participant Pricing as Pricing component
  participant GSAP as GSAP + ScrollTrigger
  participant Stripe as Stripe Checkout URL

  User->>PricingPage: navigates to /pricing
  PricingPage->>Pricing: renders <Pricing />
  Pricing->>GSAP: register ScrollTrigger, attach fromTo on heading and cards
  User->>Pricing: scrolls into view
  GSAP-->>Pricing: triggers heading and card animations

  User->>Pricing: clicks billing toggle (monthly → yearly)
  Pricing->>Pricing: setBillingCycle("yearly")
  Pricing-->>User: re-renders prices with /year suffix and savings badge

  User->>Pricing: clicks Pro CTA
  Pricing->>Stripe: href = NEXT_PUBLIC_STRIPE_CHECKOUT_URL?plan=pro&billing=yearly
  Stripe-->>User: Stripe checkout session
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 Hippity-hoppity, new pricing in place,
With GSAP animations that glide into space!
Toggle monthly to yearly, the savings appear,
Checkmarks and badges all crystal-clear.
Tests hop along checking each href and link,
This bunny approves — it's better than I think! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Feat/implement pricing page' clearly summarizes the main change—adding a new pricing page component with animations and billing toggle functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/implement-pricing-page

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@__tests__/components/Pricing.test.tsx`:
- Around line 241-248: The test assertion in the "handles missing environment
variables gracefully" test is expecting the broken href value
"undefined?plan=pro&billing=monthly", which is not graceful fallback behavior.
Update the test assertion to expect the actual fallback value that should be
implemented in the Pricing component when NEXT_PUBLIC_STRIPE_CHECKOUT_URL is
missing, or assert that the link is intentionally disabled (e.g., has no href
attribute or a placeholder value), rather than asserting the broken
"undefined?..." URL as the expected behavior.

In `@components/Pricing.tsx`:
- Around line 152-171: The toggle button for the billing cycle toggle lacks
accessibility semantics, preventing screen reader users from understanding its
purpose and current state. Add role="switch" to the button element to identify
it as a toggle switch, add an aria-checked attribute bound to the billingCycle
state (true when "yearly", false when "monthly") to communicate the current
state, and add an aria-label that clearly describes the control's purpose and
includes the current billing cycle setting so screen reader users understand
what the toggle controls and what option is currently selected.
- Around line 269-275: The href construction in the Pricing component does not
validate that the NEXT_PUBLIC_STRIPE_CHECKOUT_URL environment variable is set
before using it, resulting in broken links like "undefined?plan=..." when the
environment variable is missing. Add a check to verify that
process.env.NEXT_PUBLIC_STRIPE_CHECKOUT_URL is defined and non-empty before
constructing the checkout URL in the href ternary operator. If the environment
variable is missing for non-enterprise plans, either disable the link, show an
appropriate fallback, or prevent the button from being clickable to avoid
user-facing failures on paid CTAs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dd4df1fc-f9f8-488a-b8c2-0390e59acfcf

📥 Commits

Reviewing files that changed from the base of the PR and between 4b64038 and fb25b3b.

📒 Files selected for processing (3)
  • __tests__/components/Pricing.test.tsx
  • app/(root)/pricing/page.tsx
  • components/Pricing.tsx

Comment thread __tests__/components/Pricing.test.tsx Outdated
Comment thread components/Pricing.tsx
Comment thread components/Pricing.tsx
@arxja arxja merged commit 6ec01ea into main Jun 14, 2026
2 checks passed
@arxja arxja deleted the feat/implement-pricing-page branch June 14, 2026 07:56
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