Skip to content

Conversation

@2hu12
Copy link

@2hu12 2hu12 commented Jan 4, 2026

remove JS scroll mask state computation in favor of computed data attrs from base-ui

Summary by CodeRabbit

  • Chores

    • Replaced one UI dependency with its renamed package and updated the version range for improved compatibility.
  • Refactor

    • Redesigned scroll-area visuals and fade/mask behavior for simpler, more consistent rendering; no changes to public APIs or component usage.
    • Updated internal UI imports to align with the renamed package.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Jan 4, 2026

@2hu12 is attempting to deploy a commit to the SameerJS6's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link

coderabbitai bot commented Jan 4, 2026

📝 Walkthrough

Walkthrough

Updated dependency and import targets from @base-ui-components/react to @base-ui/react; refactored ScrollArea to remove JS-driven per-side mask state and computations, replacing them with CSS-driven size variables and group-based selectors; tabs import path updated accordingly.

Changes

Cohort / File(s) Summary
Package Dependency Migration
package.json
Replaced dependency \@base-ui-components/react`with`@base-ui/react`and changed version from1.0.0-beta.2to^1.0.0`.
Import Path Updates
components/ui/tabs.tsx, registry/base-ui/scroll-area.tsx
Updated imports from \@base-ui-components/react/...`to`@base-ui/react/...``.
ScrollArea Refactor
registry/base-ui/scroll-area.tsx
Removed JS-managed per-side Mask type, visibility checks, resizing and effects; introduced CSS-driven mask sizing via single size prop and CSS variables (vertical/horizontal mask sizes); added group class usage and adjusted ScrollMask props and className compositions; ensured masks render in both touch and non-touch branches.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I hopped through imports, swift and neat,

Replaced some names and tuned the feat,
Masks now whisper in CSS light,
Grouped selectors dance out of sight,
A tiny hop — the UI feels right.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: migrating to @base-ui/react and simplifying scroll masks, which are the primary objectives reflected in the file summaries.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dda5979 and aedc163.

📒 Files selected for processing (1)
  • registry/base-ui/scroll-area.tsx
🧰 Additional context used
🧬 Code graph analysis (1)
registry/base-ui/scroll-area.tsx (1)
lib/utils.ts (1)
  • cn (4-6)
🔇 Additional comments (4)
registry/base-ui/scroll-area.tsx (4)

5-5: LGTM!

Import path correctly updated to match the new @base-ui/react package.


40-53: LGTM!

Clean simplification of the touch rendering path. The group class enables the new CSS-driven mask visibility, and passing size={maskHeight} aligns with the simplified ScrollMask API.


116-122: LGTM!

Clean API simplification from showMask/maskHeight to a single size prop.


146-166: LGTM!

Horizontal mask implementation is consistent with the vertical mask pattern. The same syntax considerations from lines 137-140 apply here.


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.

Copy link

@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: 3

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6c19348 and 3aaed9b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • components/ui/tabs.tsx
  • package.json
  • registry/base-ui/scroll-area.tsx
🔇 Additional comments (5)
package.json (1)

21-21: Package migration looks correct.

The dependency has been updated from the beta package to the stable v1.0.0 release with a caret version constraint. The caret (^) will allow automatic updates to compatible minor and patch versions while preventing major version changes.

Please verify the package migration compatibility using the web search results from the previous verification.

registry/base-ui/scroll-area.tsx (4)

5-5: Import path updated for package migration.

The ScrollArea import has been updated to use the new package name, consistent with the migration in other files.


47-52: Touch version correctly updated with group class and simplified mask logic.

The addition of the group class is essential for the Tailwind group-data-* modifiers in ScrollMask to work correctly. The mask rendering logic has been simplified from state-based (showMask) to a direct check on maskHeight > 0, which is cleaner and more straightforward.


70-70: Non-touch mask rendering correctly simplified.

The mask rendering logic matches the touch version, maintaining consistency across both code paths.


116-167: The refactored ScrollMask component correctly relies on data-overflow-y-start, data-overflow-y-end, data-overflow-x-start, and data-overflow-x-end attributes. @base-ui/react ScrollArea automatically sets these attributes on the Root element based on scroll position and edge overflow state, as confirmed by the library documentation. The component implementation is sound.

import * as React from "react";

import { Tabs as TabsPrimitive } from "@base-ui-components/react/tabs";
import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

@base-ui/react version 1.0.0 breaking changes from @base-ui-components/react beta

💡 Result:

Quick summary of breaking changes to expect when moving from the @base-ui-components/react beta series to @base-ui/react v1.0.0:

  • Package rename: package moved from @base-ui-components/react → @base-ui/react (must change imports). [1]
  • Event callback signature: many callbacks now receive an eventDetails object (e.g., onOpenChange(open, eventDetails) instead of onOpenChange(open, event, reason)). [1][2]
  • Focus/prop renames:
    • loop → loopFocus. [3]
    • trackAnchor (boolean) → disableAnchorTracking (invert semantics). [3]
  • Checkbox / form behavior changes:
    • Checkbox unchecked value behavior changed (unchecked value no longer submitted unless using new uncheckedValue prop in some releases / checked-state handling refinements). [1][2]
    • Checkbox Group: submission behavior changed (use value on Checkbox.Root for grouped submission). [2]
  • Accordion API:
    • Items must have explicit value (no longer infer by DOM index). openMultiple renamed to multiple. [1]
  • initialFocus / finalFocus: initialFocus now must return element directly (support for functions; finalFocus added as function support) — change in how focus refs are supplied. [2]
  • Event reason names refined (e.g., 'hover' → 'trigger-hover', 'click' → 'trigger-press', 'focus' → 'trigger-focus'). [2]
  • Other component-level breaking changes introduced across beta releases (Collapsible render handling, Menu/Combobox prop changes, default tabIndex on parts, and accessibility/id behavior) — see changelogs for component-specific items you use. [1][2][3]

If you want, tell me which components/props you use and I’ll extract the exact migration steps and code diffs for them.

Sources: Base UI changelogs and release notes. [1] Base UI releases (v1.0.0 and changelog). [2] @base-ui-components/react beta changelogs (beta.3 / beta.0). [3] v1.0.0-beta.5 release notes.


🌐 Web query:

@base-ui/react Tabs API documentation stable release

💡 Result:

The stable Tabs API docs are on the official Base UI site: https://base-ui.com/react/components/tabs. See the component API reference there. [1][2]

Sources:

  1. Base UI — Tabs API reference. [1]
  2. Base UI — Quick start / Releases (package and release info). [2]

🌐 Web query:

@base-ui/react migration guide from beta to 1.0.0

💡 Result:

Summary migration checklist — beta → v1.0.0

  1. Update package name
  • Replace old package (e.g. @base-ui-components/react) with @base-ui/react and reinstall. [1][2]
  1. Event API changes
  • Callbacks now receive BaseUIChangeEventDetails (with event, reason, helpers). Update usages like onOpenChange(open, event) → onOpenChange(open, eventDetails). Review custom event handlers and types. [1]
  1. Rename/replace props
  • trackAnchor → disableAnchorTracking (invert boolean semantics if you used trackAnchor={false}). [1]
  • loop → loopFocus. [1]
  1. Component-specific breaking changes to check and update
  • Accordion: items must have explicit value; fallback to composite index removed. If you relied on index inference, add explicit value props. openMultiple → multiple. [1]
  • Autocomplete: onItemHighlighted now uses reason (not type); cols → grid. [1]
  • Combobox / Select: itemToStringValue now applied to onFormSubmit; Select accepts null as a value. Verify form submit behavior. [1]
  • Menu/Popover/Tooltip/NavigationMenu/Tabs/Toast/ToggleGroup: check release notes for fixed behaviors (focus, transitions, indicator positioning, falsy values handling) and adjust any code that relied on previous quirks. [1]
  1. Types and refs
  • Some ref types and event/detail types were refined — update TypeScript types/imports to the new exported types (BaseUIChangeEventDetails / BaseUIGenericEventDetails). Run type-check and fix mismatches. [1]
  1. Styling/portal behavior
  • Portals and portal root guidance unchanged, but review Quick Start notes (ensure your layout isolation for portals). [2]
  1. Tests and QA
  • Run full test suite and accessibility checks; pay special attention to keyboard/focus interactions in Dialog, Menu, Popover, Tooltip and any components you heavily use (several focus/transition fixes were made). [1]
  1. Search changelogs for detailed per-component changes
  • Review the 1.0.0 changelog and prior beta changelogs for any other breaking edits that affect components you use. Address each item in your codebase. [1]

Useful links

  • Releases / changelog (v1.0.0 and betas) — use this to inspect component-by-component breaking changes. [1]
  • Quick start / install (@base-ui/react) — installation and portal guidance. [2]

If you want, tell me which Base UI components you use and I’ll produce a focused diff/patch list to update your code.


Update code to handle @base-ui/react v1.0.0 breaking changes.

The package migration from @base-ui-components/react to @base-ui/react v1.0.0 includes significant breaking changes beyond the import path update:

  • Event callback signatures changed: Callbacks now receive an eventDetails object instead of separate event and reason parameters. Update any Tabs event handlers (e.g., onOpenChange(open, eventDetails) instead of onOpenChange(open, event, reason)).
  • Prop renames: looploopFocus, trackAnchordisableAnchorTracking (with inverted boolean semantics).
  • Event reason names refined: Check if custom event reason handling exists; names like 'hover' may have changed.

Review the official Base UI v1.0.0 migration guide and Tabs API documentation for the complete list of changes and update all Tabs usage accordingly.

🤖 Prompt for AI Agents
In components/ui/tabs.tsx around line 5, the import was updated but the
component usage still assumes pre-v1.0.0 Tabs API; update Tabs props and
handlers to match @base-ui/react v1.0.0: change any event handler signatures to
accept (open, eventDetails) instead of (open, event, reason) and adapt code to
read eventDetails.reason if needed; rename prop loop to loopFocus; replace
trackAnchor with disableAnchorTracking and invert its boolean semantics (e.g.,
trackAnchor={true} → disableAnchorTracking={false}); review any custom logic
that checks event reason strings and adjust to the new reason names from the
v1.0.0 migration guide.

ref={ref}
data-slot="scroll-area"
className={cn("relative overflow-hidden", viewportClassName, className)}
className={cn("group relative overflow-hidden", viewportClassName, className)}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Remove incorrectly placed viewportClassName from Root.

The viewportClassName prop is applied to the Root component's className, but it should only be used on the Viewport component (line 64). This creates confusion about which element receives the viewport styles.

🔎 Proposed fix
-          className={cn("group relative overflow-hidden", viewportClassName, className)}
+          className={cn("group relative overflow-hidden", className)}
📝 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
className={cn("group relative overflow-hidden", viewportClassName, className)}
className={cn("group relative overflow-hidden", className)}
🤖 Prompt for AI Agents
In registry/base-ui/scroll-area.tsx around line 58, the Root element is
mistakenly receiving the viewportClassName prop in its className; remove
viewportClassName from the Root className expression so Root only uses "group
relative overflow-hidden" plus className, and ensure the Viewport component
(around line 64) receives viewportClassName (merged via cn with any existing
Viewport classes) so viewport-specific styles apply only to the Viewport
element.

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.

1 participant