-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix: Data browser not scrolling to top when changing filter while cell selected #2821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review. |
📝 WalkthroughWalkthroughThe code refactors pagination reset logic in the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Browser
participant DataBrowserRef
User->>Browser: Trigger filterClicked/removeFilter/classClicked
Browser->>Browser: resetPage()
Browser->>DataBrowserRef: clearSelection()
Browser->>DataBrowserRef: cancelEditing()
Browser->>Window: scrollTo(top, smooth)
Browser->>Browser: setState({ skip: 0 })
Possibly related PRs
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
npm warn config production Use 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/dashboard/Data/Browser/Browser.react.js (1)
1922-1940
: Good implementation that addresses the stated issue, but consider adding null checking.The
resetPage()
method effectively centralizes the pagination reset logic and addresses the scrolling issue mentioned in the PR objectives. The implementation correctly:
- Clears cell selection and cancels editing
- Scrolls to the top with smooth behavior
- Resets pagination to the first page
Consider adding null checking for better defensive programming:
resetPage() { // Unselect any currently selected cell and cancel editing action - this.dataBrowserRef.current.setCurrent(null); - this.dataBrowserRef.current.setEditing(false); + if (this.dataBrowserRef.current) { + this.dataBrowserRef.current.setCurrent(null); + this.dataBrowserRef.current.setEditing(false); + } // Scroll to top window.scrollTo({ top: 0, behavior: 'smooth' }); // Reset pagination to page 1 this.setState({ skip: 0, }); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/dashboard/Data/Browser/Browser.react.js
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Docker linux/amd64
🔇 Additional comments (3)
src/dashboard/Data/Browser/Browser.react.js (3)
1906-1909
: LGTM! Good refactoring to centralize pagination reset logic.The replacement of direct
setState({ skip: 0 })
withthis.resetPage()
is a good improvement that consolidates the reset behavior and addresses the scrolling issue mentioned in the PR objectives.
1910-1913
: LGTM! Consistent with the refactoring pattern.Good use of the centralized
resetPage()
method for theremoveFilter
callback to ensure consistent reset behavior.
1914-1916
: LGTM! Completes the consistent refactoring pattern.The use of
resetPage()
in theclassClicked
callback maintains consistency with the other navigation actions.
Uffizzi Ephemeral Environment
|
# [7.2.0-alpha.7](7.2.0-alpha.6...7.2.0-alpha.7) (2025-05-25) ### Bug Fixes * Data browser not scrolling to top when changing filter while cell selected ([#2821](#2821)) ([c2527dc](c2527dc))
🎉 This change has been released in version 7.2.0-alpha.7 |
New Pull Request Checklist
Issue Description
Data browser not scrolling to top when changing filter while cell selected
Approach
When filter is applied or removed then scroll to top.
Summary by CodeRabbit