Skip to content

fix(web): render balance popup via portal to fix sidebar clipping#990

Merged
Siri-Ray merged 2 commits intomainfrom
fix/balance-popup-overflow
Apr 9, 2026
Merged

fix(web): render balance popup via portal to fix sidebar clipping#990
Siri-Ray merged 2 commits intomainfrom
fix/balance-popup-overflow

Conversation

@lefarcen
Copy link
Copy Markdown
Collaborator

@lefarcen lefarcen commented Apr 9, 2026

Summary

  • Credit balance popup was being clipped by overflow-hidden on the sidebar shell and root layout containers
  • Render popup via createPortal to document.body with position: fixed + getBoundingClientRect() positioning
  • Fix click-outside handler to exclude the portal element, preventing it from swallowing button clicks inside the popup
  • Move setShowBalancePopup(false) after openExternalUrl to ensure the link opens before the popup unmounts

Closes #964

Test plan

  • Click credit balance → popup fully visible, not clipped by sidebar
  • Tooltip on "earned credits" info icon fully visible
  • Click "View Usage" → opens browser, then popup closes
  • Click outside popup → popup closes

🤖 Generated with Claude Code

lefarcen and others added 2 commits April 9, 2026 17:48
…clipping

The credit balance popup was being clipped by two overflow-hidden
ancestors (sidebar shell and root layout). Render via createPortal to
document.body with fixed positioning computed from the trigger button's
bounding rect. Tooltip z-index also raised to ensure visibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The balance popup is rendered via portal to document.body, so clicks
inside the portal are outside balanceRef. The mousedown click-outside
handler was closing the popup before button onClick could fire.

- Exclude the portal element from click-outside detection
- Move setShowBalancePopup(false) after openExternalUrl call

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sentry
Copy link
Copy Markdown

sentry Bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 2.63158% with 74 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
apps/web/src/layouts/workspace-layout.tsx 2.63% 74 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: 409c14234f

ℹ️ 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/web/src/layouts/workspace-layout.tsx
@Siri-Ray Siri-Ray merged commit f86f2a2 into main Apr 9, 2026
14 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.

[Bug][Windows] Gifted credits tooltip text is partially obscured

2 participants