Skip to content

fix(web): preserve subscription-only preference display#6228

Open
495696116 wants to merge 1 commit into
QuantumNous:mainfrom
495696116:fix/6222-billing-preference-display
Open

fix(web): preserve subscription-only preference display#6228
495696116 wants to merge 1 commit into
QuantumNous:mainfrom
495696116:fix/6222-billing-preference-display

Conversation

@495696116

@495696116 495696116 commented Jul 15, 2026

Copy link
Copy Markdown

⚠️ 提交说明 / PR Notice

Important

  • 请提供人工撰写的简洁摘要,避免直接粘贴未经整理的 AI 输出。

📝 变更描述 / Description

无生效订阅时,前端会把 subscription_only 显示成 wallet_first,但后端不会回退钱包。

本 PR 同步修改 default/classic:只有 subscription_first 使用钱包回退显示;subscription_only 保留真实值,也不再显示错误的钱包回退提示。后端逻辑不变。

AI-assisted disclosure:实现和说明由 AI 辅助完成,并已依据实际 diff 与验证结果核对。

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix) - 请关联对应 Issue,避免将设计取舍、理解偏差或预期不一致直接归类为 bug
  • ✨ 新功能 (New feature) - 重大特性建议先通过 Issue 沟通
  • ⚡ 性能优化 / 重构 (Refactor)
  • 📝 文档更新 (Documentation)

🔗 关联任务 / Related Issue

✅ 提交前检查项 / Checklist

  • 人工确认: 我已整理此描述,并逐项核对修改和验证结果,没有粘贴未经核实的生成内容。
  • 非重复提交: 我已搜索现有的 IssuesPRs,确认不是重复提交。
  • Bug fix 说明: 本 PR 已关联对应 Issue。
  • 变更理解: 我已理解这些更改的工作原理及可能影响。
  • 范围聚焦: 本 PR 未包含任何与当前任务无关的代码改动。
  • 本地验证: 已在本地运行下述检查。
  • 安全合规: 代码中无敏感凭据,且符合项目代码规范。

📸 运行证明 / Proof of Work

通过:

  • default:目标文件 oxfmt、oxlint;bun run typecheckbun run build
  • classic:目标文件 Prettier、ESLint
  • repository:git diff --check

classic 的 bun run build 在应用代码编译前因现有 date-fns-tz/date-fns exports 不兼容而失败;本 PR 未修改依赖或 lockfile。

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Both subscription plan card implementations now fall back to displaying wallet_first only for saved subscription_first preferences without active subscriptions. The fallback notice consistently labels the saved preference as subscription-first.

Changes

Subscription preference display

Layer / File(s) Summary
Restrict displayed fallback preference
web/classic/src/components/topup/SubscriptionPlansCard.jsx, web/default/src/features/wallet/components/subscription-plans-card.tsx
Introduces shouldFallbackToWallet so only subscription_first is displayed as wallet_first when no active subscription exists.
Align saved-preference notices
web/classic/src/components/topup/SubscriptionPlansCard.jsx, web/default/src/features/wallet/components/subscription-plans-card.tsx
Updates the notice condition and consistently renders the translated subscription-first label.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • QuantumNous/new-api#2879: Updates overlapping subscription-first fallback behavior in the subscription UI and billing flow.

Suggested reviewers: t0ng7u

Poem

I’m a rabbit with a wallet to fill,
Subscription-first now bends to its will.
No active plan? The display makes it clear,
“Subscription first” remains sincere.
subscription_only won’t hop away—
Its saved choice stays on display.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes match issue #6222 by preserving subscription_only display and limiting wallet fallback to subscription_first.
Out of Scope Changes check ✅ Passed The PR only touches the two subscription plan cards needed for the reported display bug, with no evident unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main UI change: preserving the subscription-only preference display instead of forcing wallet fallback.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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.

[Bug] 无有效订阅时「仅用订阅」被前端错误显示为「优先钱包」

1 participant