feat(components): base ScrollArea on RekaUI ScrollArea component by mikenewbon ¡ Pull Request #6140 ¡ nuxt/ui

🧹 Nitpick comments (3)
src/runtime/components/ScrollArea.vue (1)

270-275: Consider extracting a single viewport getter for both exposed aliases.

$el and viewport currently duplicate the same lookup/cast. A shared getter would reduce drift risk.

â™ģī¸ Optional cleanup
+const getViewportElement = () => rootRef.value?.viewport as HTMLElement | undefined
+
 defineExpose({
   get $el() {
-    return rootRef.value?.viewport as HTMLElement | undefined
+    return getViewportElement()
   },
   get viewport() {
-    return rootRef.value?.viewport as HTMLElement | undefined
+    return getViewportElement()
   },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/runtime/components/ScrollArea.vue` around lines 270 - 275, Both $el and
viewport duplicate the same lookup/cast from rootRef.value?.viewport; extract a
single shared getter (e.g., a private computed or function like getViewport or
viewportEl) that returns rootRef.value?.viewport as HTMLElement | undefined and
have the existing getters $el and viewport simply return that single getter;
update references in the component to use the new shared getter name and remove
the duplicated casting logic from $el and viewport.
docs/content/docs/2.components/scroll-area.md (1)

245-247: Include corner in the UI customization note for completeness.

This note currently mentions scrollbar and thumb, but corner is also now customizable in this PR.

📝 Suggested doc tweak
- The scrollbar appearance can be customized via the `ui` prop using the `scrollbar` and `thumb` slots.
+ The scrollbar appearance can be customized via the `ui` prop using the `scrollbar`, `thumb`, and `corner` slots.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/content/docs/2.components/scroll-area.md` around lines 245 - 247, Update
the docs note about ScrollArea UI customization to list the new `corner` slot
alongside `scrollbar` and `thumb`; specifically, edit the sentence that
currently reads "The scrollbar appearance can be customized via the `ui` prop
using the `scrollbar` and `thumb` slots." to include `corner` (e.g.,
"`scrollbar`, `thumb`, and `corner` slots") so the `ui` prop customization
description and references to slots (scrollbar, thumb, corner) are accurate for
the ScrollArea component.
test/components/ScrollArea.spec.ts (1)

28-35: Add a type: 'glimpse' render case to complete the variant matrix.

You already cover auto/always/scroll/hover; adding glimpse would align tests with the documented prop options.

✅ Suggested test case
     ['with type auto', { props: { ...props, type: 'auto' } }],
     ['with type always', { props: { ...props, type: 'always' } }],
     ['with type scroll', { props: { ...props, type: 'scroll' } }],
     ['with type hover', { props: { ...props, type: 'hover' } }],
+    ['with type glimpse', { props: { ...props, type: 'glimpse' } }],
     ['with scrollHideDelay', { props: { ...props, type: 'scroll', scrollHideDelay: 1000 } }],
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/components/ScrollArea.spec.ts` around lines 28 - 35, Add a new test case
entry to the existing test cases array in ScrollArea.spec.ts to cover the
missing "glimpse" variant: create an entry like ['with type glimpse', { props: {
...props, type: 'glimpse' } }] alongside the other type cases (the array that
currently includes 'with type auto', 'with type always', 'with type scroll',
'with type hover'); ensure it uses the same props spread pattern and naming
convention so the render matrix includes the documented type option.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs/content/docs/2.components/scroll-area.md`:
- Around line 245-247: Update the docs note about ScrollArea UI customization to
list the new `corner` slot alongside `scrollbar` and `thumb`; specifically, edit
the sentence that currently reads "The scrollbar appearance can be customized
via the `ui` prop using the `scrollbar` and `thumb` slots." to include `corner`
(e.g., "`scrollbar`, `thumb`, and `corner` slots") so the `ui` prop
customization description and references to slots (scrollbar, thumb, corner) are
accurate for the ScrollArea component.

In `@src/runtime/components/ScrollArea.vue`:
- Around line 270-275: Both $el and viewport duplicate the same lookup/cast from
rootRef.value?.viewport; extract a single shared getter (e.g., a private
computed or function like getViewport or viewportEl) that returns
rootRef.value?.viewport as HTMLElement | undefined and have the existing getters
$el and viewport simply return that single getter; update references in the
component to use the new shared getter name and remove the duplicated casting
logic from $el and viewport.

In `@test/components/ScrollArea.spec.ts`:
- Around line 28-35: Add a new test case entry to the existing test cases array
in ScrollArea.spec.ts to cover the missing "glimpse" variant: create an entry
like ['with type glimpse', { props: { ...props, type: 'glimpse' } }] alongside
the other type cases (the array that currently includes 'with type auto', 'with
type always', 'with type scroll', 'with type hover'); ensure it uses the same
props spread pattern and naming convention so the render matrix includes the
documented type option.

â„šī¸ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

đŸ“Ĩ Commits

Reviewing files that changed from the base of the PR and between 390060c and 2c743c4.

⛔ Files ignored due to path filters (2)
  • test/components/__snapshots__/ScrollArea-vue.spec.ts.snap is excluded by !**/*.snap
  • test/components/__snapshots__/ScrollArea.spec.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (4)
  • docs/content/docs/2.components/scroll-area.md
  • src/runtime/components/ScrollArea.vue
  • src/theme/scroll-area.ts
  • test/components/ScrollArea.spec.ts