Skip to content

[01694] Extract useScrollShadow hook from HeaderLayout and DataTable#3024

Merged
nielsbosma merged 1 commit intomainfrom
plan-01694-Ivy-Framework
Apr 4, 2026
Merged

[01694] Extract useScrollShadow hook from HeaderLayout and DataTable#3024
nielsbosma merged 1 commit intomainfrom
plan-01694-Ivy-Framework

Conversation

@nielsbosma
Copy link
Copy Markdown
Contributor

Summary

Changes

Extracted the scroll-triggered shadow pattern from HeaderLayoutWidget into a reusable useScrollShadow() hook. The hook encapsulates useState, useRef, and useEffect for tracking scroll position on Radix ScrollArea viewports. HeaderLayoutWidget was refactored to use the hook, replacing 14 lines of inline logic with a single hook call.

DataTable was investigated but does not currently use this scroll shadow pattern, so no changes were needed there.

API Changes

  • New: useScrollShadow(selector?) hook exported from @/hooks/use-scroll-shadow
    • selector parameter (default: "[data-radix-scroll-area-viewport]") — CSS selector for the scroll container
    • Returns { isScrolled: boolean, scrollRef: React.RefObject<HTMLDivElement> }

Files Modified

  • New hook: src/frontend/src/hooks/use-scroll-shadow.ts
  • New tests: src/frontend/src/hooks/use-scroll-shadow.test.ts (12 tests)
  • Refactored: src/frontend/src/widgets/layouts/HeaderLayoutWidget.tsx — replaced inline scroll logic with useScrollShadow() hook

Commits

  • 53c4f7d [01694] Extract useScrollShadow hook from HeaderLayoutWidget

Create reusable useScrollShadow() hook that tracks scroll position
to trigger shadow effects. Refactor HeaderLayoutWidget to use the
hook instead of inline useState/useRef/useEffect pattern.
@nielsbosma nielsbosma merged commit c432785 into main Apr 4, 2026
11 checks passed
@nielsbosma nielsbosma deleted the plan-01694-Ivy-Framework branch April 4, 2026 15:13
@artem-ivy-ai
Copy link
Copy Markdown
Collaborator

Deploy timed out

I'm preparing your docs & samples for this PR. I'll update the comment as Sliplane reports progress.

Logs

No terminal state received from Sliplane after 30 minutes.

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