Skip to content

fix(web): move budget banner to persistent layout to prevent re-mount flicker#1138

Open
JujiuYey wants to merge 7 commits intonexu-io:mainfrom
JujiuYey:main
Open

fix(web): move budget banner to persistent layout to prevent re-mount flicker#1138
JujiuYey wants to merge 7 commits intonexu-io:mainfrom
JujiuYey:main

Conversation

@JujiuYey
Copy link
Copy Markdown

Fixes #1091

What

将 BudgetWarningBanner 从页面组件(home.tsx)提升到 workspace-layout.tsx 的布局层渲染.

Why

路由切换时(Home → Sessions),banner 会 unmount/remount 导致视觉闪烁。

How

  • getBudgetBannerRouteVariant: home 路由从 inline 改为 global,与 sessions 统一
  • home.tsx: 移除两处 BudgetWarningBanner 渲染及相关 hook 引用
  • workspace-layout.tsx: 已有的 global banner 逻辑自动覆盖,无需改动

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)

Notes for reviewers

Banner 的 DEV 调试面板(BudgetBannerDebugPanel)保留在 home.tsx 中未做改动,它是独立的开发工具组件,不影响本次修复。

Copy link
Copy Markdown
Collaborator

@lefarcen lefarcen left a comment

Choose a reason for hiding this comment

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

Hey @JujiuYey! 👋

Thanks for the update on this PR! 🎉 Clean and targeted fix - moving the BudgetWarningBanner to the persistent layout is the right approach to eliminate re-mount flicker across route changes (Home → Sessions).

Quick review of changes:

  • getBudgetBannerRouteVariant: Perfect logic unification - now /workspace/home correctly returns global alongside sessions routes
  • home.tsx: Surgical removal of banner + hooks (imports, uses, two render sites) without touching unrelated code
  • ✨ No new issues introduced, checklist solid (typecheck/lint pass, no secrets/any types)

This looks production-ready! 🚀

Join our communities:

Thanks for making Nexu better!
Nexu Team

Copy link
Copy Markdown
Collaborator

@lefarcen lefarcen left a comment

Choose a reason for hiding this comment

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

Hey @JujiuYey! 👋

Quick re-review after your latest push - still looking great! 🎉 The core budget banner fix remains solid:

use-desktop-budget-guard.ts & home.tsx changes unchanged and correct
docs/github-metrics.svg updated with fresh repo stats (nice touch for docs!)

No issues - ready to ship! 🚀

Join communities:

Thanks!
Nexu Team

Copy link
Copy Markdown
Collaborator

@lefarcen lefarcen left a comment

Choose a reason for hiding this comment

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

Hey @JujiuYey! 👋 Thanks for keeping this PR fresh with repo metric updates! 📊 The budget banner fix continues to look excellent:

✅ Core changes (hooks/home.tsx) unchanged & solid
✅ docs/github-metrics.svg: Latest stats + simplified contributors (if intentional)

No issues spotted. Ship it! 🚀

Join communities:

Nexu Team

Comment thread docs/github-metrics.svg

<!-- Footer -->
<text x="480" y="390" text-anchor="middle" font-size="10" fill="#8b949e">Updated 2026-03-27 · nexu-io/nexu</text>
<text x="480" y="390" text-anchor="middle" font-size="10" fill="#8b949e">Updated 2026-04-20 · nexu-io/nexu</text>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

P3 Note: Top contributors section fully cleared (was showing users like lefarcen/claude). Confirm if intentional for this PR scope, or should retain prior data? Otherwise LGTM!

Copy link
Copy Markdown
Collaborator

@lefarcen lefarcen left a comment

Choose a reason for hiding this comment

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

Hey @JujiuYey! 🎉

Excellent work keeping the metrics current! The banner fix is solid across all pushes:

✅ No new issues
✅ Prior nits addressed/clarified
✅ Ready to merge 🚀

(Admin confirm for final approve per policy)

Join communities:

Nexu Team

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.

[UX] Jarring transition effect for 'Low Balance' banner during navigation

2 participants