-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix: AggregationPanel retains scroll position when loading from cache #2919
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
base: alpha
Are you sure you want to change the base?
Conversation
The label |
📝 WalkthroughWalkthroughA React ref named Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant DataBrowser
participant AggregationPanel
User->>DataBrowser: Changes AggregationPanelData or selectedObjectId
DataBrowser->>AggregationPanel: Checks if panel is visible and ref is set
DataBrowser->>AggregationPanel: Sets scrollTop to 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 error code ERR_SSL_WRONG_VERSION_NUMBER 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (2)📓 Common learnings
src/dashboard/Data/Browser/DataBrowser.react.js (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (3)
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 (
|
🚀 Thanks for opening this pull request! |
🎉 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 (2)
src/dashboard/Data/Browser/DataBrowser.react.js (2)
738-740
: Consider also guarding horizontal scroll & potential null-state
- If the aggregation panel can scroll horizontally, you may also want to reset
scrollLeft
alongsidescrollTop
:+ this.aggregationPanelRef.current.scrollLeft = 0;
handleCallCloudFunction
can be triggered before the panel is mounted (e.g. panel hidden), in which casethis.aggregationPanelRef.current
will still benull
despite the outer null-check succeeding earlier in the lifecycle. You’re safe now, but keep it in mind if the call chain changes.
909-912
: Ensure the container actually scrolls
scrollTop
will have no effect unless.aggregationPanelContainer
sets an overflow style (e.g.overflow-y: auto
). Double-checkDatabrowser.scss
contains something like:.aggregationPanelContainer { overflow-y: auto; }Without it, the new behaviour will appear to work only when content exceeds the viewport by coincidence.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/dashboard/Data/Browser/DataBrowser.react.js
(3 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: mtrezza
PR: parse-community/parse-dashboard#2726
File: src/components/ContextMenu/ContextMenu.react.js:56-74
Timestamp: 2025-05-24T18:24:15.988Z
Learning: In the Parse Dashboard ContextMenu component, the one-time positioning calculation using hasPositioned ref works well even with window resizing and movement, so additional window resize event listeners are not necessary for menu positioning.
src/dashboard/Data/Browser/DataBrowser.react.js (1)
Learnt from: mtrezza
PR: parse-community/parse-dashboard#2828
File: src/dashboard/Data/Browser/Browser.react.js:1605-1607
Timestamp: 2025-05-27T12:09:47.644Z
Learning: In script execution dialogs in Parse Dashboard (specifically the `confirmExecuteScriptRows` method in `src/dashboard/Data/Browser/Browser.react.js`), individual `setState` calls to update `processedScripts` counter should be kept as-is rather than batched, because this provides real-time progress feedback to users in the dialog UI.
🔇 Additional comments (1)
src/dashboard/Data/Browser/DataBrowser.react.js (1)
135-136
: Ref addition is correct and idiomaticCreating
aggregationPanelRef
withReact.createRef()
in the constructor is the right approach for accessing the DOM node in a class component. No issues spotted.
Summary
Testing
npm test
https://chatgpt.com/codex/tasks/task_e_6878f341055c832d8a72f833a9edf071
Summary by CodeRabbit