Skip to content

Conversation

@mtrezza
Copy link
Member

@mtrezza mtrezza commented Nov 26, 2025

New Pull Request Checklist

Issue Description

Sync-scrolling multiple panels jumps to bottom of shortest panel when scrolling up.

Approach

Fix scroll position algorithm.

Summary by CodeRabbit

  • Bug Fixes
    • Refined multi-panel scrolling synchronization in the data browser to better handle wheel-based interactions.
    • Improved active panel detection to prevent conflicting scroll updates when interacting with multiple panels.
    • Enhanced scroll handling for more consistent performance across panels.

✏️ Tip: You can customize this high-level summary in your review settings.

@parse-github-assistant
Copy link

parse-github-assistant bot commented Nov 26, 2025

🚀 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.

@coderabbitai
Copy link

coderabbitai bot commented Nov 26, 2025

📝 Walkthrough

Walkthrough

Modified DataBrowser.react.js to enhance multi-panel scroll synchronization. Added internal state fields activePanelIndex and isWheelScrolling with guards to prevent conflicting scroll operations. Implemented wheel-scroll debouncing with delta-based panel synchronization. Active panel tracking triggered by mouse enter, touch start, and focus events.

Changes

Cohort / File(s) Change Summary
Multi-panel scroll state and event handling
src/dashboard/Data/Browser/DataBrowser.react.js
Added activePanelIndex and isWheelScrolling state fields; enhanced handlePanelScroll with early-exit guards; refactored handleWrapperWheel to debounce wheel-scrolling flag and compute delta-based synchronization across panels; expanded panel column rendering hooks to update active panel index on mouse enter, touch start, and focus events

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI as DataBrowser UI
    participant ScrollLogic as Scroll Handler
    participant State as Internal State
    participant Panels as Panel Components

    User->>UI: Wheel scroll on wrapper
    UI->>ScrollLogic: handleWrapperWheel triggered
    ScrollLogic->>State: Set isWheelScrolling = true
    ScrollLogic->>ScrollLogic: Compute max scrollTop delta
    ScrollLogic->>Panels: Apply delta to all panels
    Note over ScrollLogic: Debounce clears flag
    ScrollLogic->>State: Set isWheelScrolling = false

    User->>UI: Mouse enter panel
    UI->>Panels: Trigger mouse enter handler
    Panels->>State: Update activePanelIndex
    
    User->>Panels: Scroll within active panel
    Panels->>ScrollLogic: handlePanelScroll triggered
    ScrollLogic->>ScrollLogic: Check guards: isWheelScrolling? activePanelIndex match?
    alt Guard passes
        ScrollLogic->>Panels: Sync panel scroll
    else Guard fails
        ScrollLogic->>ScrollLogic: Exit early
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Scroll synchronization logic: Multi-guard conditions in handlePanelScroll and delta computation in handleWrapperWheel require careful tracing to ensure no scroll conflicts or regressions occur
  • State lifecycle: Verify activePanelIndex and isWheelScrolling initialization, updates, and cleanup (especially debounce cleanup) across all event handlers
  • Event handler integration: Cross-check mouse enter, touch start, and focus event handlers for consistency and potential race conditions between state updates

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete. The 'Closes' field is not filled out, the Approach section lacks detail, and checkboxes for vulnerability disclosure and issue reference are not checked. Fill in the 'Closes: ISSUE_NUMBER' field with the relevant issue reference, complete the Approach section with implementation details, and properly check the vulnerability and issue reference checkboxes.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the bug being fixed: sync-scrolling panels jumping to the bottom of the shortest panel when scrolling up.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@parseplatformorg
Copy link
Contributor

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@mtrezza mtrezza changed the title fix: Sync-scrolling panels jumps to bottom of shortest panel when scrolling up fix: Sync-scrolling multiple panels jumps to bottom of shortest panel when scrolling up Nov 26, 2025
@mtrezza mtrezza merged commit 3f85f89 into parse-community:alpha Nov 26, 2025
10 of 11 checks passed
Copy link

@coderabbitai coderabbitai bot left a 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 (3)
src/dashboard/Data/Browser/DataBrowser.react.js (3)

917-927: Consider simplifying the guard condition.

The check this.activePanelIndex !== undefined is redundant since activePanelIndex is initialized to -1 and only ever assigned numeric values. This could be simplified.

-    if (
-      this.activePanelIndex !== -1 &&
-      this.activePanelIndex !== undefined &&
-      this.activePanelIndex !== index
-    ) {
+    if (this.activePanelIndex !== -1 && this.activePanelIndex !== index) {
       return;
     }

943-950: Declare wheelTimeout in the constructor for consistency.

The wheelTimeout property is used here but not declared in the constructor, unlike saveOrderTimeout (line 167). While JavaScript allows this, declaring it in the constructor improves code consistency and readability.

Add to the constructor around line 167:

this.saveOrderTimeout = null;
this.wheelTimeout = null;

1466-1469: Consider resetting activePanelIndex when leaving panels.

The active panel is tracked on enter/touch/focus but never reset when leaving. This could leave a stale value if the user moves the cursor outside all panels. Consider adding onMouseLeave to reset the index.

                              onMouseEnter={() => (this.activePanelIndex = index)}
+                             onMouseLeave={() => (this.activePanelIndex = -1)}
                              onTouchStart={() => (this.activePanelIndex = index)}
                              onFocus={() => (this.activePanelIndex = index)}
+                             onBlur={() => (this.activePanelIndex = -1)}
                              onScroll={(e) => this.handlePanelScroll(e, index)}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dd9ea49 and 8f011ba.

📒 Files selected for processing (1)
  • src/dashboard/Data/Browser/DataBrowser.react.js (4 hunks)
⏰ 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)
  • GitHub Check: Node 20
  • GitHub Check: Node 18
  • GitHub Check: Docker linux/amd64
🔇 Additional comments (3)
src/dashboard/Data/Browser/DataBrowser.react.js (3)

170-171: LGTM - Instance variables for scroll tracking.

Using instance variables instead of React state is appropriate here since these values are transient UI state that shouldn't trigger re-renders.


955-970: Scroll synchronization fix looks correct.

The approach of computing maxScrollTop across all panels and applying the delta uniformly addresses the issue where scrolling up would jump to the shortest panel's position. This ensures all panels scroll from the furthest scroll position, preventing the jump-to-bottom behavior.


912-936: Verify scroll behavior with panels of different heights.

The fix addresses the jump-to-bottom issue by using max scrollTop across panels. Confirm that when panels have significantly different content heights, the scroll synchronization behaves as expected (shorter panels will cap at their max scroll while longer panels continue scrolling).

parseplatformorg pushed a commit that referenced this pull request Nov 26, 2025
# [8.1.0-alpha.3](8.1.0-alpha.2...8.1.0-alpha.3) (2025-11-26)

### Bug Fixes

* Sync-scrolling multiple panels jumps to bottom of shortest panel when scrolling up ([#3023](#3023)) ([3f85f89](3f85f89))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 8.1.0-alpha.3

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Nov 26, 2025
@mtrezza mtrezza deleted the fix/sync-scroll-up branch November 26, 2025 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:released-alpha Released as alpha version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants