[tooltip] Fix provider delay group lifecycle#4887
Conversation
commit: |
Bundle size
PerformanceTotal duration: 1,339.59 ms -52.06 ms(-3.7%) | Renders: 50 (+0) | Paint: 2,053.74 ms -75.32 ms(-3.5%)
11 tests within noise — details Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codex Review (GPT-5.5)Dominant type: bug-fix, with regression-test coverage. I reviewed the full PR diff against freshly fetched 1. Bugs / Issues (None)No actionable issues found. Root Cause & Patch AssessmentThe patch addresses the two relevant root causes: inactive consumers no longer clear the active delay-group context on unmount, and provider delay changes now refresh the backing refs without breaking the current instant-open phase. The cleanup now keys off the active Test Coverage AssessmentCoverage is well targeted. The new Validated:
RecommendationApprove ✅ The change is small, focused, and has regression tests that demonstrate the previous behavior was broken against the fresh base branch. |
Summary
Bug
FloatingDelayGroupcaptures the initial delay only once, so laterTooltip.ProvidercloseDelay updates are ignored. Its cleanup also clears the shared current context for any consumer unmount, meaning an inactive tooltip unmount can prevent the next tooltip from closing the active one.Reproduction
Test plan
pnpm test:jsdom FloatingDelayGroup --no-watchpnpm test:jsdom TooltipProvider --no-watchpnpm test:chromium TooltipProvider --no-watchpnpm eslintpnpm typescript