Skip to content

fix(TreeSelect): prevent clear-button slot error in Popover (DS-5393) - #449

Merged
KamilEmeleev merged 1 commit into
mainfrom
fix/ds-5393
Aug 6, 2026
Merged

fix(TreeSelect): prevent clear-button slot error in Popover (DS-5393)#449
KamilEmeleev merged 1 commit into
mainfrom
fix/ds-5393

Conversation

@KamilEmeleev

@KamilEmeleev KamilEmeleev commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue that could cause a clearable TreeSelect to throw an error when rendered inside an open popover.
    • Preserved existing TreeSelect rendering and behavior across popover contexts.

@KamilEmeleev KamilEmeleev added the bug Something isn't working label Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 97ac36fa-41a6-418d-b00e-c0eedffeb337

📥 Commits

Reviewing files that changed from the base of the PR and between 3bf6163 and 52c3a13.

📒 Files selected for processing (2)
  • packages/components/src/components/TreeSelect/TreeSelect.test.tsx
  • packages/components/src/components/TreeSelect/TreeSelect.tsx

📝 Walkthrough

Walkthrough

TreeSelect now provides Button slot context for its rendered form and popover content. A regression test verifies that a clearable TreeSelect renders inside an open Popover.Body without throwing.

Changes

TreeSelect popover rendering

Layer / File(s) Summary
Provide Button slot context
packages/components/src/components/TreeSelect/TreeSelect.tsx
TreeSelect imports the required primitive context APIs and wraps its output in a Provider with default and clear-button ButtonContext slots.
Cover Popover rendering
packages/components/src/components/TreeSelect/TreeSelect.test.tsx
The test renders a clearable TreeSelectFixture inside an open Popover.Body and verifies that rendering does not throw.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the TreeSelect bug fix covered by the changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ds-5393

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 52c3a13):

https://react-koobiq-next--prs-449-q6jatdap.web.app

(expires Tue, 11 Aug 2026 12:19:53 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: fc29847d4a9e5cb1adf458c76a9b681c76e2eeff

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Ready to approve

The change matches established patterns in similar components and includes a targeted regression test for the reported render error.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

Fixes a runtime render error when TreeSelect is used inside a Popover with isClearable enabled by ensuring the expected ButtonContext slots are always defined for the clear button.

Changes:

  • Wrap TreeSelectInner markup with a @koobiq/react-primitives Provider that defines ButtonContext slots for the default and clear-button slots.
  • Add a regression test that renders a clearable TreeSelect inside Popover and asserts it does not throw.
File summaries
File Description
packages/components/src/components/TreeSelect/TreeSelect.tsx Adds a Provider supplying ButtonContext slot definitions to prevent slot-related errors when nested under other providers (e.g., Popover).
packages/components/src/components/TreeSelect/TreeSelect.test.tsx Adds a regression test to verify clearable TreeSelect renders without throwing inside a Popover.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

@KamilEmeleev

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@KamilEmeleev
KamilEmeleev merged commit 6571a61 into main Aug 6, 2026
8 of 9 checks passed
@KamilEmeleev
KamilEmeleev deleted the fix/ds-5393 branch August 6, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants