Skip to content

fix: show gifted credits in sidebar balance popup#985

Merged
lefarcen merged 3 commits intomainfrom
fix/issue-910-gifted-credit-breakdown
Apr 9, 2026
Merged

fix: show gifted credits in sidebar balance popup#985
lefarcen merged 3 commits intomainfrom
fix/issue-910-gifted-credit-breakdown

Conversation

@anthhub
Copy link
Copy Markdown

@anthhub anthhub commented Apr 9, 2026

What

Fix the desktop sidebar balance popup so it shows current gifted and plan credit balances instead of reusing cumulative reward progress.

Why

Closes #910.

The popup was showing progress.earnedCredits, which is a cumulative rewards metric, not the current gifted balance bucket. That made signup and reward credits appear in the total balance without appearing under Gifted credits.

How

  • extend the desktop rewards balance schema with giftedBalance and planBalance
  • add cloud credit-record fetches in the controller and derive current gifted / plan balances from active grants
  • update the sidebar popup to render cloudBalance.giftedBalance and cloudBalance.planBalance instead of earnedCredits
  • update EN / ZH copy so the popup clearly describes current balance buckets
  • add controller and web tests for the new breakdown behavior

Affected areas

  • Desktop app (Electron shell)
  • Controller (backend / API)
  • Web dashboard (React UI)
  • OpenClaw runtime
  • Skills
  • Shared schemas / packages
  • Build / CI / Tooling

Checklist

  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes
  • pnpm generate-types run (if API routes/schemas changed)
  • No credentials or tokens in code or logs
  • No any types introduced (use unknown with narrowing)

Screenshots / recordings

Manual verification in the sidebar popup showed:

  • Total credits = 400
  • Gifted credits = 400
  • Plan credits = 0

Notes for reviewers

  • The popup intentionally no longer uses progress.earnedCredits; that field remains cumulative rewards progress for the rewards page.
  • giftedBalance + planBalance now tracks the current balance breakdown shown in the sidebar popup.

@sentry
Copy link
Copy Markdown

sentry Bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 25.72816% with 153 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
apps/controller/src/store/nexu-config-store.ts 25.23% 80 Missing ⚠️
...ps/controller/src/services/cloud-reward-service.ts 2.43% 40 Missing ⚠️
apps/web/src/layouts/workspace-layout.tsx 39.58% 29 Missing ⚠️
apps/web/src/i18n/locales/en.ts 0.00% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db51360030

ℹ️ 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".

Comment thread apps/desktop/main/index.ts Outdated
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 9, 2026

Deploying nexu-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2c90343
Status: ✅  Deploy successful!
Preview URL: https://09ff0423.nexu-docs.pages.dev
Branch Preview URL: https://fix-issue-910-gifted-credit.nexu-docs.pages.dev

View logs

@lefarcen lefarcen merged commit 68f4c84 into main Apr 9, 2026
12 checks passed
@lefarcen lefarcen mentioned this pull request Apr 10, 2026
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.

Registration reward points not displayed in 'Gifted credits' category

2 participants