Skip to content

feat(windsurf): add static recommended account sorting#674

Open
w2112515 wants to merge 1 commit intojlcodes99:mainfrom
w2112515:feature/windsurf-smart-recommend
Open

feat(windsurf): add static recommended account sorting#674
w2112515 wants to merge 1 commit intojlcodes99:mainfrom
w2112515:feature/windsurf-smart-recommend

Conversation

@w2112515
Copy link
Copy Markdown

@w2112515 w2112515 commented May 4, 2026

Motivation

Users managing many Windsurf Trial accounts get very little value from the existing By remaining credits sort, because most Trial accounts report identical or null prompt/add-on credits. Sorting by credits therefore produces an order that doesn't answer the practical question: "which account is most worth switching to right now?"

The new Recommended sort answers that question directly by combining daily/weekly quota remaining with reset/plan-cycle urgency, using exactly the numbers already shown on each account card. This is purely additive — the existing By remaining credits sort is untouched.

Summary

Adds a static "Recommended" sort mode to the Windsurf accounts page, so users with many similar Trial accounts can quickly spot which account is worth switching to based on remaining quota and urgency.

Changes

  • New computeWindsurfRecommendScoreStatic util: score = available quota × (1 + urgency boost), where quota is daily/weekly remaining % from the same summary the UI displays, and urgency comes from daily/weekly reset and plan cycle countdowns.
  • useProviderAccountsPage now accepts defaultSortBy so each page can override the initial sort; Windsurf defaults to recommended when no persisted preference exists.
  • Windsurf sort dropdown gains a "按推荐 / Recommended" option; desc/asc tooltips and labels are recommendation-aware.
  • Current account stays pinned to the top under all sort modes, including recommended asc/desc.
  • zh-CN and en locale strings for the new sort mode.

Scope intentionally excluded

  • Only zh-CN and en labels are added; other locales fall back to English.
  • Recommendation weights (half-life, urgency weight, quota weight) stay as code constants.
  • No multi-account day-level route planning.
  • No telemetry disclosure panel or first-run splash.

Validation

  • npx tsc --noEmit
  • npx vite build
  • git diff --check
  • npm run tauri dev launched from a VS 2022 Build Tools + Rust environment on Windows.
  • Verified in the real Windsurf page:
    • Recommended desc keeps the current account first; low-usage accounts rank ahead of high-usage ones; more urgent quota cycles outrank less urgent ones at equal usage.
    • Recommended asc keeps the current account first and reverses non-current ordering as expected.
    • Clicking the second recommended card triggered a real account switch and moved the "当前" badge to the clicked card.

Risk

Low. The change only adds a new sort mode plus a small hook parameter, and keeps the existing sort modes untouched. Default sort change only affects Windsurf users with no persisted sort preference; anyone with a saved sort keeps their current behavior.

- Add computeWindsurfRecommendScoreStatic util using quota remaining and urgency

- Add defaultSortBy to useProviderAccountsPage; set Windsurf default to recommended

- Add recommended sort branch that keeps the current account pinned

- Add recommended dropdown option and direction-aware tooltips

- Add zh-CN and en labels for the new sort mode
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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