Conversation
Deploying nexu-docs with
|
| Latest commit: |
783750f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1858c740.nexu-docs.pages.dev |
| Branch Preview URL: | https://worktree-frolicking-petting.nexu-docs.pages.dev |
- Introduced new API endpoints for triggering automatic fallback to BYOK provider and restoring the default model to a managed (cloud) model. - Updated OpenAPI schema to include new properties related to BYOK usage and fallback status. - Implemented QuotaFallbackService to handle fallback logic and model restoration. - Added BudgetWarningBanner component to notify users about credit status in the UI. - Enhanced existing services and routes to integrate new quota management features.
- Updated the rewards link to use a flex layout for better alignment and spacing. - Increased the size of the Coins icon for improved visibility. - Adjusted the display of claimed and total credits to enhance readability. - Refined the progress bar styling for a more polished appearance.
- Updated OpenAPI schema to include cloud balance properties. - Implemented CloudRewardService for managing rewards status and claims. - Enhanced NexuConfigStore to fetch and convert cloud rewards status. - Added tests for CloudRewardService and updated existing tests for NexuConfigStore. - Updated UI components to display cloud balance information. - Localized new cloud balance strings in English and Chinese.
…ity and localization - Introduced a status configuration for the BudgetWarningBanner to manage different states (warning and depleted) with corresponding styles and texts. - Updated the component to utilize the new configuration for rendering, improving code readability and maintainability. - Added new localization strings for budget warning and depleted states in English and Chinese. - Implemented a debug panel for development purposes to simulate budget banner states. - Added tests for the BudgetWarningBanner to ensure correct rendering based on status.
…rds status handling - Added logic to automatically trigger a fallback to BYOK when the managed model's cloud balance is depleted. - Integrated logging for fallback failures to improve error tracking. - Created unit tests for the new fallback functionality to ensure reliability. - Updated the BudgetWarningBanner and related UI components to reflect changes in rewards status and actions. - Enhanced localization strings for clarity in user messaging regarding rewards and credits.
…rds status handling - Added logic to automatically trigger a fallback to BYOK when the managed model's cloud balance is depleted. - Integrated logging for fallback failures to improve error tracking. - Created a new test suite for desktop rewards routes to validate fallback behavior and status retrieval. - Updated existing UI components and localization strings to reflect changes in rewards status messaging.
- Remove 5 investigation markdown files accidentally committed to repo root - Fix cloudConnecting state not reset in "Connection already in progress" path - Extract handleCloudConnect + polling effects into shared useCloudConnect hook - Deduplicate formatRewardAmount by exporting from home-rewards-teaser
- Introduced six new PNG images for reward sharing. - Created a new module for managing reward share assets, including types and functions for selecting and downloading assets. - Implemented tests to ensure the integrity of the reward share assets and their download functionality.
- Keep both rewards budget debug panel and seedance promo features - Fix welcome.tsx merge: replace removed setCloudStatus with refetchDesktopCloudStatus
…ling - Show skeleton placeholders instead of fallback tasks during loading - Add autoFallbackTriggered flag to rewards status schema - Display warning toast when BYOK auto-fallback is triggered - Add refetchInterval: 60s to detect balance changes in background
…new headlines and actions - Refactored the BudgetWarningBanner to use new headline keys for warning and depleted states. - Updated the UI to include an upgrade action button and removed the previous earn credits button. - Enhanced localization strings for better clarity in user messaging regarding budget status. - Added a new RewardTaskIcon component for rendering task icons dynamically.
- Updated the rewards status hook to disable retries for fetching data. - Added new localization strings for balance details in English and Chinese. - Improved the WorkspaceLayout to display rewards balance information with a detailed popup. - Refactored HomePage to manage session and channel data more effectively, ensuring proper rendering based on session history. - Added tests to verify the rendering of rewards components and their behavior during loading states.
- Added a new module for handling virtual reward checks, including functions to manage task status and delay. - Updated localization strings in English and Chinese for task checking and claiming processes. - Refactored the RewardConfirmModal to utilize the new virtual check functionality, improving user feedback during reward processing. - Introduced tests to validate the behavior of the virtual reward check and description key retrieval.
…t banner enhancements - Introduced a new `ensureDesktopControllerReady` function to manage the readiness of the desktop controller, including polling and recovery logic. - Refactored the `DesktopShell` and `useDesktopRuntimeConfig` to utilize the new controller readiness management. - Enhanced the budget banner functionality in the `HomePage` to handle dismissal states more effectively, using session storage for tracking. - Added a new `BudgetDepletedDialog` component to provide user feedback when budget is exhausted. - Implemented tests for the controller readiness logic and budget banner dismissal behavior to ensure reliability.
- Added a new `GithubStarVerificationService` to manage GitHub star session preparation and verification. - Enhanced the desktop rewards routes to include a new endpoint for preparing GitHub star verification sessions. - Updated the claim reward logic to validate proof URLs and GitHub session IDs before processing claims. - Introduced new localization strings for handling proof URL inputs and GitHub session errors. - Added tests to ensure the correct behavior of the new verification and proof handling features.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f8c6818b70
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (data?.error === "Connection attempt already in progress") { | ||
| setCloudConnecting(false); | ||
| toast.info(t("welcome.cloudConnectInProgress")); |
There was a problem hiding this comment.
Keep polling when cloud connect is already in progress
When the backend returns "Connection attempt already in progress", this branch sets cloudConnecting to false and exits, which disables the polling loop that is responsible for detecting when OAuth eventually completes. A common case is reloading the page during an active login flow and clicking connect again: the UI stops polling and can remain "disconnected" indefinitely even after the browser auth succeeds.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Addressed in 783750f: keep cloudConnecting true when the backend reports an in-progress connect so polling continues across page reloads.
| const recoveryAttempts = | ||
| options.recoveryAttempts ?? (startController === null ? 0 : 1); | ||
| const attemptTimeoutMs = options.attemptTimeoutMs ?? 15_000; |
There was a problem hiding this comment.
Avoid hard-failing controller readiness after fixed timeout
The default readiness logic now only allows two 15s polling windows (initial + one recovery) before returning false. On slower cold starts (e.g., first build or busy machines), startup can legitimately exceed ~30s, so the app marks the controller as failed even though it may become ready shortly after. This creates a false-negative startup failure path instead of continuing to wait.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Addressed in 783750f: the final readiness attempt now continues polling instead of hard-failing after a fixed timeout, and the desktop readiness tests were updated to cover the new contract.
What
Add a desktop rewards center — users can view cloud balance, claim reward tasks (daily / opensource / social), and connect to Nexu Cloud from the rewards page.
Why
Enable desktop users to earn credits through engagement tasks (GitHub star, social sharing, daily login) and monitor their cloud balance, driving adoption and retention for the Nexu Cloud integration.
How
packages/shared): New Zod schemas for rewards (rewards.ts) and credits (credit.ts) with full type safetyCloudRewardServicefor Cloud API communication,QuotaFallbackServicefor auto-BYOK fallback when balance depleted, new desktop rewards routesrewards.tsx), budget warning banner, home rewards teaser, shareduseCloudConnecthook for cloud connection flow,useDesktopRewardshook for rewards statusAffected areas
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (631 tests, 59 files)pnpm generate-typesrun (API routes/schemas changed)anytypes introduced (useunknownwith narrowing)Notes for reviewers
rewards.tsxis 600+ lines — consider splitting icons/modal intocomponents/rewards/in a follow-up/api/internal/desktop/rewardshas a side effect (auto-fallback trigger) — intentional for seamless UX but worth notingnexu-config-store.tsusesasassertions — tracked for future Zod safe-parse migration