Skip to content

fix(dashboard): preserve base price when reselecting paid plan - #2332

Open
charlietlamb wants to merge 2 commits into
devfrom
charlie/preserve-paid-plan-base-price
Open

fix(dashboard): preserve base price when reselecting paid plan#2332
charlietlamb wants to merge 2 commits into
devfrom
charlie/preserve-paid-plan-base-price

Conversation

@charlietlamb

@charlietlamb charlietlamb commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make selecting an already-paid plan a no-op
  • preserve the existing paid transition for non-paid plans
  • cover the serialized update request so its base price and feature items cannot regress

Verification

  • bun test tests/ (328 passed)
  • bun run ts
  • React Doctor changed-files scan (100/100)

Summary by cubic

Fixes a bug where reselecting the Paid plan in the plan editor could wipe the base price or feature items. Selecting Paid on an already-paid plan is now a no-op; switching from a non-paid plan to Paid still applies the expected defaults.

  • Bug Fixes
    • Preserve existing base price and feature items when Paid is reselected.
    • Keep non-paid → Paid transition behavior; added a unit test to ensure the serialized update request remains intact.

Written for commit 747eafd. Summary will update on new commits.

Review in cubic

Greptile Summary

This PR preserves paid-plan pricing when the paid option is selected again. The main changes are:

  • Bug fixes: Treat an already-paid plan selection as a no-op.
  • Improvements: Move paid-plan selection logic into a typed utility.
  • Improvements: Add a test covering preserved price and feature items in the update request.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
vite/src/views/products/plan/components/edit-plan-details/PlanTypeSection.tsx Uses the new helper when the paid plan option is selected.
vite/src/views/products/plan/utils/selectPaidPlanType.ts Preserves an existing paid product and retains the previous free-to-paid transition.
vite/tests/views/products/plan/plan-type-section.test.ts Tests that paid-plan price and feature items survive update-request serialization.

Reviews (1): Last reviewed commit: "fix(dashboard): 🐛 preserve base price w..." | Re-trigger Greptile

Context used:

  • Context used - When generating the key changes section of the sum... (source)

@capy-ai

capy-ai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Capy auto-review is paused for this organization because the usage-cycle auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews.

@charlietlamb
charlietlamb changed the base branch from main to dev July 21, 2026 11:47

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

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