Skip to content

feat: expose additional base props#723

Merged
rohanchkrabrty merged 5 commits intomainfrom
expose-handle
Mar 30, 2026
Merged

feat: expose additional base props#723
rohanchkrabrty merged 5 commits intomainfrom
expose-handle

Conversation

@rohanchkrabrty
Copy link
Copy Markdown
Contributor

Summary

  • Update @base-ui/react package and migrate Drawer to the stable API
  • Expose additional base component props (open/close handlers, modal flag) on AlertDialog, Combobox, Dialog, Menu, Popover, and Tooltip
  • Add scrollbarVisibility prop to ScrollArea scrollbar
  • Fix breaking tests and update playground/docs examples for Drawer changes
  • Update pnpm lock file for dependency changes

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
apsara Ready Ready Preview, Comment Mar 30, 2026 6:49am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 30, 2026

📝 Walkthrough

Walkthrough

This pull request upgrades the Base UI library dependency from version 1.2.0 to 1.3.0 and synchronizes component implementations across the codebase. Changes include: migrating Drawer component imports from DrawerPreview to Drawer, updating Drawer trigger usage patterns from asChild wrapping to a render prop approach in demos and tests, and exposing createHandle static properties on multiple components (AlertDialog, Dialog, Drawer, Menu, Popover, Tooltip). Additionally, the Combobox component now exports useFilter and useFilteredItems hooks, and ScrollArea scrollbar adds a keepMounted prop for improved behavior.

Suggested reviewers

  • rohilsurana
  • rsbh
  • paanSinghCoder
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: expose additional base props' accurately captures the main objective of adding createHandle and other base props to multiple components, though it doesn't mention the Drawer migration which is also a significant part of the changeset.
Description check ✅ Passed The pull request description directly relates to the changeset, covering the major changes including @base-ui/react update, Drawer migration, exposed props on multiple components, ScrollArea changes, test fixes, and documentation updates.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

@rohanchkrabrty rohanchkrabrty changed the title feat: update Base UI and expose additional base props feat: expose additional base props Mar 30, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/raystack/components/scroll-area/scroll-area-scrollbar.tsx`:
- Line 22: The ScrollAreaScrollbar component currently forces keepMounted
(creating invisible interactive hitboxes); make keepMounted a configurable prop
on the component (e.g., add keepMounted?: boolean to the component props and
default it to false), replace the hardcoded keepMounted usage with the prop
(pass props.keepMounted into the underlying Scrollbar/primitive where
keepMounted was hardcoded), and update any callsites to pass true where the old
behavior is required; also ensure CSS for hidden states still sets
pointer-events appropriately (or document that enabling keepMounted may require
pointer-events:none when hidden) so hidden scrollbars don't intercept clicks.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 47691794-ee57-4c02-ad4d-52475c648c59

📥 Commits

Reviewing files that changed from the base of the PR and between 17ad20e and 4e88d7d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (15)
  • apps/www/src/components/playground/drawer-examples.tsx
  • apps/www/src/content/docs/components/drawer/demo.ts
  • packages/raystack/components/alert-dialog/alert-dialog.tsx
  • packages/raystack/components/combobox/combobox.tsx
  • packages/raystack/components/dialog/dialog.tsx
  • packages/raystack/components/drawer/__tests__/drawer.test.tsx
  • packages/raystack/components/drawer/drawer-content.tsx
  • packages/raystack/components/drawer/drawer-misc.tsx
  • packages/raystack/components/drawer/drawer-root.tsx
  • packages/raystack/components/drawer/drawer.tsx
  • packages/raystack/components/menu/menu.tsx
  • packages/raystack/components/popover/popover.tsx
  • packages/raystack/components/scroll-area/scroll-area-scrollbar.tsx
  • packages/raystack/components/tooltip/tooltip.tsx
  • packages/raystack/package.json

return (
<ScrollAreaPrimitive.Scrollbar
orientation={orientation}
keepMounted
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Verify forced mounting and where ScrollAreaScrollbar is instantiated without override.
rg -n --type=tsx 'keepMounted|ScrollAreaScrollbar\s+orientation=' \
  packages/raystack/components/scroll-area/scroll-area-scrollbar.tsx \
  packages/raystack/components/scroll-area/scroll-area.tsx

# Verify hidden-state CSS still allows pointer interactions.
rg -n --type=css 'scrollbar|opacity:\s*0|pointer-events' \
  packages/raystack/components/scroll-area/scroll-area.module.css

Repository: raystack/apsara

Length of output: 86


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# List files to verify they exist
echo "=== Files to verify ==="
fd -e tsx -e css packages/raystack/components/scroll-area/

# Read scroll-area-scrollbar.tsx around Line 22
echo -e "\n=== scroll-area-scrollbar.tsx (Lines 1-35) ==="
cat -n packages/raystack/components/scroll-area/scroll-area-scrollbar.tsx | head -35

# Read the CSS file
echo -e "\n=== scroll-area.module.css (full content) ==="
cat -n packages/raystack/components/scroll-area/scroll-area.module.css

# Check scroll-area.tsx for ScrollAreaScrollbar usage
echo -e "\n=== scroll-area.tsx (full content) ==="
cat -n packages/raystack/components/scroll-area/scroll-area.tsx

Repository: raystack/apsara

Length of output: 569


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# List files in the directory correctly
echo "=== Files in scroll-area directory ==="
fd . 'packages/raystack/components/scroll-area/'

# Read scroll-area-scrollbar.tsx
echo -e "\n=== scroll-area-scrollbar.tsx ==="
cat -n packages/raystack/components/scroll-area/scroll-area-scrollbar.tsx

# Read scroll-area.module.css
echo -e "\n=== scroll-area.module.css ==="
cat -n packages/raystack/components/scroll-area/scroll-area.module.css

# Read scroll-area.tsx
echo -e "\n=== scroll-area.tsx ==="
cat -n packages/raystack/components/scroll-area/scroll-area.tsx

Repository: raystack/apsara

Length of output: 4782


Hardcoded keepMounted creates invisible interactive hitboxes on hidden scrollbars.

At Line 22, keepMounted is hardcoded with no option to override per-instance. Combined with your CSS where hidden modes use opacity: 0 (lines 71–73) while keeping pointer-events: auto (line 26), invisible scrollbars remain in the DOM and can intercept clicks near edges.

Make keepMounted configurable instead of forced:

Proposed fix
 export function ScrollAreaScrollbar({
   className,
   orientation = 'vertical',
   type = 'hover',
+  keepMounted = false,
   ...props
 }: ScrollAreaScrollbarProps) {
   return (
     <ScrollAreaPrimitive.Scrollbar
       orientation={orientation}
-      keepMounted
+      keepMounted={keepMounted}
       className={cx(styles.scrollbar, styles[`scrollbar-${type}`], className)}
       {...props}
     >
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
keepMounted
export function ScrollAreaScrollbar({
className,
orientation = 'vertical',
type = 'hover',
keepMounted = false,
...props
}: ScrollAreaScrollbarProps) {
return (
<ScrollAreaPrimitive.Scrollbar
orientation={orientation}
keepMounted={keepMounted}
className={cx(styles.scrollbar, styles[`scrollbar-${type}`], className)}
{...props}
>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/raystack/components/scroll-area/scroll-area-scrollbar.tsx` at line
22, The ScrollAreaScrollbar component currently forces keepMounted (creating
invisible interactive hitboxes); make keepMounted a configurable prop on the
component (e.g., add keepMounted?: boolean to the component props and default it
to false), replace the hardcoded keepMounted usage with the prop (pass
props.keepMounted into the underlying Scrollbar/primitive where keepMounted was
hardcoded), and update any callsites to pass true where the old behavior is
required; also ensure CSS for hidden states still sets pointer-events
appropriately (or document that enabling keepMounted may require
pointer-events:none when hidden) so hidden scrollbars don't intercept clicks.

@rohanchkrabrty rohanchkrabrty merged commit 337dadd into main Mar 30, 2026
5 checks passed
@rohanchkrabrty rohanchkrabrty deleted the expose-handle branch March 30, 2026 07:07
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.

2 participants