Skip to content

fix(extension): preserve shared popup close-state behavior in builds#1257

Merged
mengxi-ream merged 1 commit intomainfrom
fix/shared-popup-close-state-build
Mar 30, 2026
Merged

fix(extension): preserve shared popup close-state behavior in builds#1257
mengxi-ream merged 1 commit intomainfrom
fix/shared-popup-close-state-build

Conversation

@ananaBMaster
Copy link
Copy Markdown
Collaborator

@ananaBMaster ananaBMaster commented Mar 30, 2026

Type of Changes

  • 🐛 Bug fix (fix)
  • ✨ New feature (feat)
  • 📝 Documentation change (docs)
  • 💄 UI/style change (style)
  • ♻️ Code refactoring (refactor)
  • ⚡ Performance improvement (perf)
  • ✅ Test related (test)
  • 🔧 Build or dependencies update (build)
  • 🔄 CI/CD related (ci)
  • 🌐 Internationalization (i18n)
  • 🧠 AI model related (ai)
  • 🔄 Revert a previous commit (revert)
  • 📦 Other changes that do not modify src or test files (chore)

Description

This PR moves the popup closed-state contract into a shared Base UI helper so popup primitives preserve the correct closed-state behavior in production builds.

  • add a shared closed-state class with data-closed:pointer-events-none and data-closed:[animation-fill-mode:forwards]
  • apply that shared contract across popup-like Base UI primitives, including dialogs, sheets, popovers, tooltips, selects, comboboxes, dropdown menus, hover cards, and alert dialogs
  • remove the selection-tooltip-specific forced hide workaround so the selection tooltip relies on the shared popup contract instead of bespoke closed-state classes
  • add unit coverage for the shared helper and for the affected selection tooltip interactions

Related Issue

Closes #

How Has This Been Tested?

  • Added unit tests
  • Verified through manual testing

Commands run:

  • SKIP_FREE_API=true pnpm exec vitest run src/components/ui/base-ui/__tests__/popup-animation-classes.test.ts src/entrypoints/selection.content/components/__tests__/action-tooltips.test.tsx src/entrypoints/selection.content/components/__tests__/selection-toolbar-footer-content.test.tsx
  • pnpm exec eslint src/components/ui/base-ui/alert-dialog.tsx src/components/ui/base-ui/combobox.tsx src/components/ui/base-ui/dialog.tsx src/components/ui/base-ui/dropdown-menu.tsx src/components/ui/base-ui/hover-card.tsx src/components/ui/base-ui/popover.tsx src/components/ui/base-ui/select.tsx src/components/ui/base-ui/sheet.tsx src/components/ui/base-ui/tooltip.tsx src/components/ui/base-ui/popup-animation-classes.ts src/components/ui/base-ui/__tests__/popup-animation-classes.test.ts src/entrypoints/selection.content/components/selection-toolbar-footer-content.tsx src/entrypoints/selection.content/components/selection-tooltip.tsx
  • pnpm type-check
  • pnpm build

Screenshots

Not applicable.

Checklist

  • I have tested these changes locally
  • I have updated the documentation accordingly if necessary
  • My code follows the code style of this project
  • My changes do not break existing functionality
  • If my code was generated by AI, I have proofread and improved it as necessary.

Additional Information

tmp/selection-repro.html was kept local and is not part of the PR.


Summary by cubic

Fixes popup close-state regressions in production builds by centralizing the closed-state styles and applying them to all Base UI popups. Closed popups are now non-interactive and their exit animations complete reliably.

  • Bug Fixes
    • Introduced a shared closed-state class with pointer-events disabled and animation fill preserved.
    • Applied across Dialog, Sheet, Popover, Tooltip, Select, Combobox, Dropdown Menu, Hover Card, and Alert Dialog.
    • Removed the selection tooltip’s bespoke forced-hide CSS; it now relies on the shared contract.
    • Added unit tests for the shared helper and key selection tooltip interactions.

Written for commit 22a7f31. Summary will update on new commits.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 30, 2026

🦋 Changeset detected

Latest commit: 22a7f31

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@read-frog/extension Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Mar 30, 2026
@github-actions github-actions bot added the fix label Mar 30, 2026
@dosubot dosubot bot added the app: browser extension Related to browser extension label Mar 30, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 14 files

@mengxi-ream mengxi-ream merged commit 8d3baa8 into main Mar 30, 2026
6 checks passed
@mengxi-ream mengxi-ream deleted the fix/shared-popup-close-state-build branch March 30, 2026 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: browser extension Related to browser extension fix size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants