feat: enhance tab navigation with scroll buttons and improve code for…#86
feat: enhance tab navigation with scroll buttons and improve code for…#86
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 35 minutes and 54 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA component enhancement that adds horizontal scroll controls to tabs in DataViews. The implementation introduces scroll state tracking via refs and state, integrates ResizeObserver for dynamic scroll capability detection, and adds conditional arrow button UI for navigation without altering existing logic. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/components/wordpress/dataviews.tsx`:
- Around line 907-971: The left/right arrow Buttons should not be conditionally
unmounted (which causes focus loss); always render both Button elements next to
the tabs container and toggle their disabled state based on
canScrollTabsLeft/canScrollTabsRight and make onClick a no-op when disabled (use
scrollTabsByArrow('left'|'right') only when enabled). Update the Button render
around tabsScrollRef so both Buttons are present, use the btn props
variant/size/className and wrap className values with cn(...) (as required by
src/components/**/*.{ts,tsx}) to merge Tailwind classes, and keep existing
aria-labels and Chevron icons unchanged so keyboard users retain focus while
arrows are visually/operationally unavailable.
- Around line 97-100: Guard against null before calling Object.keys on
v.filters: change the condition that sets the local variable filters (currently
using typeof v.filters === 'object') to also verify v.filters is not null (e.g.,
v.filters != null) and that it has keys (Object.keys(v.filters).length > 0);
update the assignment for filters (the variable named filters derived from
v.filters) to only JSON.stringify when v.filters is non-null and an object with
keys, otherwise set filters to null.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 43929e56-28ff-46ec-bafb-ad18dd134c2a
📒 Files selected for processing (1)
src/components/wordpress/dataviews.tsx
…matting
Summary by CodeRabbit
New Features
Refactor