-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: Add column freezing in data browser #2877
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
feat: Add column freezing in data browser #2877
Conversation
🚀 Thanks for opening this pull request! |
The label |
Warning Rate limit exceeded@mtrezza has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 25 minutes and 14 seconds before requesting another review. ⌛ 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. 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe changes collectively implement column freezing functionality in a data browser table. New props and state are introduced to track the frozen column index, calculate sticky left offsets for columns and resize handles, and propagate these values to header and row components. Context menu handling and conditional sticky positioning logic are added for interactive freezing and unfreezing of columns. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant DataBrowser
participant BrowserTable
participant DataBrowserHeaderBar
participant BrowserRow
participant BrowserCell
User->>DataBrowserHeaderBar: Right-clicks column header
DataBrowserHeaderBar->>DataBrowserHeaderBar: handleContextMenu(index)
DataBrowserHeaderBar->>DataBrowser: freezeColumns(index) or unfreezeColumns()
DataBrowser->>DataBrowser: Updates frozenColumnIndex state
DataBrowser->>BrowserTable: Passes freezeIndex, freezeColumns, unfreezeColumns
BrowserTable->>DataBrowserHeaderBar: Passes stickyLefts, handleLefts, freezeIndex
BrowserTable->>BrowserRow: Passes stickyLefts, freezeIndex
BrowserRow->>BrowserCell: Passes stickyLeft, rowBackground
BrowserCell->>BrowserCell: Renders with sticky style if stickyLeft defined
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 (3)
src/dashboard/Data/Browser/DataBrowser.react.js (1)
546-552
: Simple and effective freeze/unfreeze methods.The methods are straightforward and handle the state updates correctly. Consider adding bounds checking for the index parameter to prevent potential issues.
freezeColumns(index) { + if (index < 0 || index >= this.state.order.length) { + return; + } this.setState({ frozenColumnIndex: index }); }src/dashboard/Data/Browser/BrowserTable.react.js (2)
122-133
: Correct sticky position calculation logic.The algorithm properly calculates cumulative left offsets for sticky positioning, accounting for visible columns and the checkbox column width.
Fix the variable declarations based on static analysis hints:
- let stickyLefts = []; - let handleLefts = []; + const stickyLefts = []; + const handleLefts = [];
565-591
: Fix indentation issues in DataBrowserHeaderBar props.The indentation is inconsistent according to the linting rules.
- <DataBrowserHeaderBar - selected={ - !!this.props.selection && - !!this.props.data && - Object.values(this.props.selection).filter(checked => checked).length === - this.props.data.length - } - selectAll={checked => - this.props.data.forEach(({ id }) => this.props.selectRow(id, checked)) - } + <DataBrowserHeaderBar + selected={ + !!this.props.selection && + !!this.props.data && + Object.values(this.props.selection).filter(checked => checked).length === + this.props.data.length + } + selectAll={checked => + this.props.data.forEach(({ id }) => this.props.selectRow(id, checked)) + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
src/components/BrowserCell/BrowserCell.react.js
(1 hunks)src/components/BrowserRow/BrowserRow.react.js
(3 hunks)src/components/DataBrowserHeaderBar/DataBrowserHeaderBar.react.js
(5 hunks)src/dashboard/Data/Browser/BrowserTable.react.js
(5 hunks)src/dashboard/Data/Browser/DataBrowser.react.js
(6 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/components/DataBrowserHeaderBar/DataBrowserHeaderBar.react.js (1)
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.
🧬 Code Graph Analysis (1)
src/components/DataBrowserHeaderBar/DataBrowserHeaderBar.react.js (1)
src/components/DragHandle/DragHandle.example.js (1)
handleStyle
(59-67)
🪛 GitHub Check: Lint
src/components/DataBrowserHeaderBar/DataBrowserHeaderBar.react.js
[failure] 44-44:
'setContextMenu' is assigned a value but never used
[failure] 43-43:
'unfreezeColumns' is assigned a value but never used
[failure] 42-42:
'freezeColumns' is assigned a value but never used
src/dashboard/Data/Browser/BrowserTable.react.js
[failure] 123-123:
'handleLefts' is never reassigned. Use 'const' instead
[failure] 122-122:
'stickyLefts' is never reassigned. Use 'const' instead
[failure] 572-572:
Expected indentation of 10 spaces but found 8
[failure] 571-571:
Expected indentation of 10 spaces but found 8
[failure] 567-567:
Expected indentation of 12 spaces but found 10
[failure] 566-566:
Expected indentation of 10 spaces but found 8
[failure] 565-565:
Expected indentation of 8 spaces but found 6
⏰ 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). (1)
- GitHub Check: Docker linux/amd64
🔇 Additional comments (8)
src/components/BrowserCell/BrowserCell.react.js (1)
635-641
: Well-implemented sticky positioning logic.The conditional styling approach correctly applies sticky positioning properties only when
stickyLeft
is defined. The background color preservation ensures visual consistency for frozen columns.src/components/DataBrowserHeaderBar/DataBrowserHeaderBar.react.js (3)
16-24
: Clean context menu implementation for freeze/unfreeze functionality.The conditional menu items based on freeze state and column index provide intuitive user interaction for column freezing.
63-67
: Consistent sticky positioning implementation across headers and handles.The sticky positioning logic properly handles both header cells and resize handles with appropriate z-index and background styling.
Also applies to: 108-114
42-44
: Static analysis false positives - props are used correctly.The linting warnings about unused variables are false positives. These props are actively used in the
handleContextMenu
method and for prop passing to child components.src/dashboard/Data/Browser/DataBrowser.react.js (1)
52-52
: Proper state management for frozen column index.The initialization and reset logic correctly handles the frozen column state, ensuring it resets when the class name or column order changes.
Also applies to: 94-94, 107-107
src/components/BrowserRow/BrowserRow.react.js (2)
74-75
: Consistent row styling and sticky positioning implementation.The alternating background colors and sticky positioning for the checkbox cell align well with the header implementation.
Also applies to: 82-86
145-146
: Proper prop passing to BrowserCell for sticky positioning.The conditional passing of
stickyLeft
and consistentrowBackground
ensure cells render correctly when frozen.src/dashboard/Data/Browser/BrowserTable.react.js (1)
186-187
: Consistent prop passing to BrowserRow components.The freeze-related props are correctly passed to all BrowserRow instances (clone rows, new rows, and data rows).
Also applies to: 269-270, 362-363
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/BrowserTable.react.js (2)
122-136
: Fix variable declarations and improve code clarity.The sticky positioning calculation logic is correct, but there are style improvements needed:
- Use
const
instead oflet
for variables that are never reassigned- Consider adding comments to explain the calculation logic
Apply this diff to address the issues:
- let stickyLefts = []; - let handleLefts = []; + const stickyLefts = []; + const handleLefts = []; if ( typeof this.props.freezeIndex === 'number' && this.props.freezeIndex >= 0 ) { + // Calculate sticky left positions for frozen columns let left = 30; headers.forEach((h, i) => { stickyLefts[i] = left; handleLefts[i] = left + h.width; if (h.visible) { left += h.width; } }); }
568-594
: Fix indentation issues in DataBrowserHeaderBar component.The component props and logic are correctly implemented, but there are indentation inconsistencies that need to be addressed.
Apply this diff to fix the indentation:
- <DataBrowserHeaderBar - selected={ - !!this.props.selection && - !!this.props.data && - Object.values(this.props.selection).filter(checked => checked).length === - this.props.data.length - } + <DataBrowserHeaderBar + selected={ + !!this.props.selection && + !!this.props.data && + Object.values(this.props.selection).filter(checked => checked).length === + this.props.data.length + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/dashboard/Data/Browser/BrowserTable.react.js
(5 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/BrowserTable.react.js (2)
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.
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.
🪛 GitHub Check: Lint
src/dashboard/Data/Browser/BrowserTable.react.js
[failure] 123-123:
'handleLefts' is never reassigned. Use 'const' instead
[failure] 122-122:
'stickyLefts' is never reassigned. Use 'const' instead
[failure] 575-575:
Expected indentation of 10 spaces but found 8
[failure] 574-574:
Expected indentation of 10 spaces but found 8
[failure] 570-570:
Expected indentation of 12 spaces but found 10
[failure] 569-569:
Expected indentation of 10 spaces but found 8
[failure] 568-568:
Expected indentation of 8 spaces but found 6
⏰ 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). (1)
- GitHub Check: Docker linux/amd64
🔇 Additional comments (1)
src/dashboard/Data/Browser/BrowserTable.react.js (1)
189-190
: Consistent prop passing implementation looks good.The sticky positioning props are being passed consistently to all row types (edit clone rows, new rows, and regular rows), which ensures uniform behavior across the table.
Also applies to: 272-273, 365-366
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/components/BrowserCell/BrowserCell.react.js
(1 hunks)src/components/BrowserRow/BrowserRow.react.js
(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/components/BrowserCell/BrowserCell.react.js
🧰 Additional context used
🧠 Learnings (1)
📓 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.
🪛 GitHub Check: Lint
src/components/BrowserRow/BrowserRow.react.js
[failure] 90-90:
Expected indentation of 14 spaces but found 16
[failure] 89-89:
Expected indentation of 16 spaces but found 18
[failure] 88-88:
Expected indentation of 16 spaces but found 18
[failure] 87-87:
Expected indentation of 16 spaces but found 18
[failure] 86-86:
Expected indentation of 16 spaces but found 18
[failure] 85-85:
Expected indentation of 16 spaces but found 18
⏰ 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). (2)
- GitHub Check: Node 18
- GitHub Check: Docker linux/amd64
🔇 Additional comments (2)
src/components/BrowserRow/BrowserRow.react.js (2)
54-55
: LGTM! New props for column freezing functionality.The
stickyLefts
andfreezeIndex
props are well-named and appropriately positioned to support the column freezing feature.
151-152
: LGTM! Proper conditional prop passing for column freezing.The conditional logic correctly applies sticky positioning only to frozen columns (
freezeIndex >= j
) and maintains consistent background styling across all cells.
# [7.3.0-alpha.4](7.3.0-alpha.3...7.3.0-alpha.4) (2025-07-09) ### Features * Add column freezing in data browser ([#2877](#2877)) ([29f4a88](29f4a88))
🎉 This change has been released in version 7.3.0-alpha.4 |
# [7.3.0](7.2.1...7.3.0) (2025-08-01) ### Bug Fixes * Changing "Relative dates" option of saved filter does not enable save button ([#2947](#2947)) ([4f4977d](4f4977d)) * Class object counters in sidebar not updating ([#2950](#2950)) ([0f1920b](0f1920b)) * Clicking linked pointer with Cmd key in view table doesn't open page in new browser tab ([#2902](#2902)) ([101b194](101b194)) * Fails to generate MFA code with CLI command `parse-dashboard --createMFA` ([#2883](#2883)) ([544df1f](544df1f)) * Gracefully fail when trying to get new features in latest version of dashboard ([#2880](#2880)) ([1969a0e](1969a0e)) * Header checkbox in data browser does not indicate when a few rows are selected ([#2957](#2957)) ([e4ab666](e4ab666)) * Hyperlink in Views table ignores `urlQuery` key ([#2926](#2926)) ([c5eedf4](c5eedf4)) * Incorrect table cell width in App Settings table ([#2933](#2933)) ([d46765b](d46765b)) * Info panel scroll-to-top setting not persistent across dashboard sessions ([#2938](#2938)) ([2b78087](2b78087)) * Invalid clipboard content for multi-cell copy in data browser ([#2882](#2882)) ([22a2065](22a2065)) * Legacy filters without `filterId` cannot be deleted in data browser ([#2946](#2946)) ([65df9d6](65df9d6)) * Legacy filters without `filterId` do not appear in sidebar ([#2945](#2945)) ([fde3769](fde3769)) * Modal text input can be resized smaller than its cell in Safari browser ([#2930](#2930)) ([82a0cdc](82a0cdc)) * Move settings button on data browser toolbar for better UI ([#2940](#2940)) ([c473ce6](c473ce6)) * Pagination footer bar hides rows in data browser ([#2879](#2879)) ([6bc2da8](6bc2da8)) * Race condition on info panel request shows info panel data not corresponding to selected cell ([#2909](#2909)) ([6f45bb3](6f45bb3)) * Saved legacy filter in data browser cannot be deleted or cloned ([#2944](#2944)) ([15da90d](15da90d)) * Saved legacy filter with classname in query cannot be deleted ([#2948](#2948)) ([05ee5b3](05ee5b3)) * Selected text in info panel cannot be copied using Ctrl+C ([#2951](#2951)) ([0164c19](0164c19)) * Views not sorted alphabetically in sidebar ([#2943](#2943)) ([4c81fe4](4c81fe4)) * Warning dialog is shown after executing script on selected rows ([#2899](#2899)) ([027f1ed](027f1ed)) ### Features * Add additional values in info panel key-value element ([#2904](#2904)) ([a8f110e](a8f110e)) * Add AI agent for natural language interaction with Parse Server ([#2954](#2954)) ([32bd6e8](32bd6e8)) * Add clipboard icon to copy value of key-value element in info panel ([#2871](#2871)) ([7862c42](7862c42)) * Add Cloud Function as data source for views with optional text or file upload ([#2939](#2939)) ([f5831c7](f5831c7)) * Add column freezing in data browser ([#2877](#2877)) ([29f4a88](29f4a88)) * Add custom data views with aggregation query ([#2888](#2888)) ([b1679db](b1679db)) * Add environment variable support for AI agent configuration ([#2956](#2956)) ([2ac9e7e](2ac9e7e)) * Add hyperlink support in Views table ([#2925](#2925)) ([06cfc11](06cfc11)) * Add inclusive date filters "is on or after", "is on or before" in data browser ([#2929](#2929)) ([c8d621b](c8d621b)) * Add quick-add button to array parameter in Cloud Config ([#2866](#2866)) ([e98ccb2](e98ccb2)) * Add row number column to data browser ([#2878](#2878)) ([c0aa407](c0aa407)) * Add Settings menu to scroll info panel to top when browsing through rows ([#2937](#2937)) ([f339cb8](f339cb8)) * Add support for "not equal to" filter for Boolean values in data browser and analytics explorer ([#2914](#2914)) ([d55b89c](d55b89c)) * Add support for `Image` type in View table to display images ([#2952](#2952)) ([6a6b1f0](6a6b1f0)) * Add type mismatch warning when quick-adding entry to Cloud Config array parameter ([#2875](#2875)) ([bb1837f](bb1837f)) * Add view edit icon to views list in sidebar ([#2901](#2901)) ([96e33b9](96e33b9)) * Allow editing filter without loading data in data browser ([#2949](#2949)) ([9623580](9623580)) * Allow editing saved filters in data browser ([#2942](#2942)) ([daaccaa](daaccaa)) * Allow freeform text view resizing in modal dialogs ([#2910](#2910)) ([1399162](1399162)) * Persist info panel visibility when navigating across classes in data browser ([#2908](#2908)) ([1a3610a](1a3610a)) * Prefetch info panel data with config options `prefetchObjects` and `prefetchStale` ([#2915](#2915)) ([54a8156](54a8156)) * Warn when leaving data browser page with selected rows ([#2887](#2887)) ([206ead1](206ead1)) ### Performance Improvements * Add config option `enableResourceCache` to cache dashboard resources locally for faster loading in additional browser tabs ([#2920](#2920)) ([41a4963](41a4963))
Summary
Testing
npm test
(fails: Config options › should reject to start if config and other options are combined)https://chatgpt.com/codex/tasks/task_e_686e465b6d54832d90e5d6c30ee22080
Summary by CodeRabbit
New Features
Style