feat: Add context menu in data browser to add cell content or selected text to Cloud Config parameter#3123
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. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
Warning Rate limit exceeded
⌛ 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 (3)
📝 WalkthroughWalkthroughAdds "Add to config parameter..." context-menu flow: threads arrayConfigParams and onAddToArrayConfig through UI components, captures Alt+right-click in cells, string editors, and aggregation panels, shows a parameter-selection menu, opens AddArrayEntryDialog, and performs AddUnique updates to cloud config. Changes
Sequence DiagramsequenceDiagram
participant User
participant Cell as BrowserCell / StringEditor
participant Context as ContextMenu
participant DataBrowser as DataBrowser / AggregationPanel
participant Browser as Browser (state & handlers)
participant Dialog as AddArrayEntryDialog
participant Config as Config Store / Server
User->>Cell: Alt + Right-click (selected text)
Cell->>Cell: handleContextMenu(e) / build menu items
Cell->>Context: setContextMenu({position, items})
User->>Context: Click "Add to config parameter..." → choose param
Context->>Browser: onAddToArrayConfig(paramName, value)
Browser->>Browser: handleAddToArrayConfig(param, value) (open dialog)
Browser->>Dialog: show dialog with initialValue
User->>Dialog: Confirm add entry
Dialog->>Browser: handleConfirmAddToConfig(finalValue)
Browser->>Config: PUT config with AddUnique operation
Config-->>Browser: Success / Error
Browser->>Browser: fetchArrayConfigParams() refresh & close dialog
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
Add to config parameter to add cell content or selected text to Cloud Config parameter
Add to config parameter to add cell content or selected text to Cloud Config parameterThere was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/components/AggregationPanel/AggregationPanel.js (1)
153-190: Wire the context menu for nested panels, too.
onContextMenuis forwarded (Line 141), but the depth>0 render path never attaches it, so Alt+right‑click won’t surface the add‑to‑config menu inside nested panels.🐛 Proposed fix
- {isExpanded && ( - <div className={styles.nestedPanelContent}> + {isExpanded && ( + <div className={styles.nestedPanelContent} onContextMenu={onContextMenu}>
🤖 Fix all issues with AI agents
In `@src/components/BrowserCell/BrowserCell.react.js`:
- Around line 633-657: The menu builder getAddToConfigContextMenuOption can leak
real values for hidden cells because it only checks the stringified
copyableValue; add an explicit guard that returns early when the cell is hidden
(e.g., check this.props.hidden or an equivalent per-cell hidden flag) before
computing cellValue so the "Add to config parameter..." option is suppressed for
hidden fields; update the guard alongside arrayConfigParams and
onAddToArrayConfig checks and leave the rest of the mapping
(arrayConfigParams.map and onAddToArrayConfig callback) unchanged.
In `@src/components/ContextMenu/ContextMenu.react.js`:
- Around line 123-131: The submenu vertical offset is currently computed from
the index (path[level] * 30), which assumes fixed item height and breaks when
separators exist; update the mouse/hover handler that opens submenus (e.g., the
function handling item hover like
handleMouseEnter/openSubmenu/setSubmenuPosition) to compute the submenu top
using the hovered element's actual position (use event.currentTarget.offsetTop
relative to the parent menu or subtract parent.getBoundingClientRect().top from
event.currentTarget.getBoundingClientRect().top) and store that value instead of
index*30 so submenu alignment accounts for separators and variable item heights.
In `@src/dashboard/Data/Browser/Browser.react.js`:
- Around line 327-329: The component currently calls
this.fetchArrayConfigParams() only on mount, so arrayConfigParams can go stale
when the passed-in appId changes; add logic to componentDidUpdate(prevProps)
that compares prevProps.appId !== this.props.appId and, when different, calls
this.fetchArrayConfigParams() (and any related refresh methods) so the context
menu targets the correct app; apply the same change to the other Browser
instance/section that uses fetchArrayConfigParams (lines referenced around the
other block) to ensure both locations refresh on appId changes.
In `@src/dashboard/Data/Config/AddArrayEntryDialog.react.js`:
- Around line 17-21: The component's constructor sets state.value from
props.initialValue but doesn't normalize to a string or keep it in sync when
props change; update the constructor to coerce props.initialValue to a string
for state.value (e.g., String(props.initialValue || '')) and add a
componentDidUpdate(prevProps) that checks if prevProps.initialValue !==
this.props.initialValue and, if so, sets state.value to the normalized string of
this.props.initialValue; make sure this fixes TextInput's expectation of a
string and prevents stale state while the dialog is mounted.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/dashboard/Data/Browser/Browser.react.js`:
- Around line 2573-2600: The async method fetchArrayConfigParams sets state
after an await without checking component mount status; before calling
this.setState({ arrayConfigParams: arrayParams }) in fetchArrayConfigParams,
guard the update with the existing mount flag (this._isMounted) used elsewhere
(e.g., loadAllClassFilters) so you only call this.setState when this._isMounted
is true to avoid setting state on an unmounted component.
♻️ Duplicate comments (2)
src/components/BrowserCell/BrowserCell.react.js (1)
633-663: Hidden cell guard has been properly implemented.The method now correctly checks for
hiddenprop at the beginning (line 637-639) and returns early, preventing sensitive hidden field values from being exposed through the config menu. This addresses the security concern from the previous review.The filtering of special values (
(undefined),(null),(hidden)) at line 650 provides additional defense-in-depth.src/dashboard/Data/Browser/Browser.react.js (1)
327-328: Refetch config params when switching apps.
fetchArrayConfigParams()is only called on mount. When the user switches apps (appId changes), thearrayConfigParamsstate will contain stale data from the previous app, causing the context menu to target wrong config parameters.Add the call in
componentWillReceivePropswhen appId changes:🐛 Proposed fix
componentWillReceiveProps(nextProps, nextContext) { if (nextProps.params.appId !== this.props.params.appId) { this.removeLocation(); this.addLocation(nextProps.params.appId); + this.fetchArrayConfigParams(); }
🧹 Nitpick comments (1)
src/dashboard/Data/Browser/Browser.react.js (1)
2612-2632: Consider escaping quotes in the prefill value.When
lastType === 'string', the code wraps the selected text in quotes (line 2623). IfselectedTextcontains embedded quotes (e.g.,foo"bar), the resulting prefill value"foo"bar"would be invalid JSON. WhileAddArrayEntryDialoghandles this gracefully by falling back to the raw string, this may confuse users expecting the value to be pre-parsed correctly.♻️ Optional: Escape embedded quotes
// If the last item in the array is a string, wrap the prefilled text in quotes let prefillValue = selectedText; if (lastType === 'string') { - prefillValue = `"${selectedText}"`; + prefillValue = JSON.stringify(selectedText); }Using
JSON.stringifywill properly escape embedded quotes, newlines, and other special characters.
# [8.3.0-alpha.6](8.3.0-alpha.5...8.3.0-alpha.6) (2026-01-17) ### Features * Add context menu in data browser to add cell content or selected text to Cloud Config parameter ([#3123](#3123)) ([9bc5197](9bc5197))
|
🎉 This change has been released in version 8.3.0-alpha.6 |
# [8.3.0](8.2.0...8.3.0) (2026-02-05) ### Bug Fixes * Canvas graph element does not apply data filter option ([#3128](#3128)) ([00ff1aa](00ff1aa)) * Canvas is not expandable or scrollable beyond current view size ([#3140](#3140)) ([cb73122](cb73122)) * Cloud Config parameter modal cannot scroll when content scales beyond visible area ([#3124](#3124)) ([bb6de31](bb6de31)) * Context menu of header cell in info panel does not group related records by class name ([#3122](#3122)) ([230c1e2](230c1e2)) * Context menu sub-menu in data browser vertically misaligned when scrolling in parent menu ([#3120](#3120)) ([2acaa27](2acaa27)) * Dashboard crashes when adding Parse Pointer JSON to array field in data browser ([#3125](#3125)) ([70bf081](70bf081)) * Data browser graph requires value field even when calculated value is defined ([#3127](#3127)) ([53e4f2b](53e4f2b)) * Graph in canvas ignores date filter constraints ([#3137](#3137)) ([6d8b8e6](6d8b8e6)) * Group-by not using custom aggregation type for single-series graph ([#3159](#3159)) ([b8e8891](b8e8891)) * Incorrect percentage and average calculation for calculated values in graphs ([#3152](#3152)) ([14b4d48](14b4d48)) * Info panel auto-scrolling not pausing during UI interaction like text selection or context menu display ([#3165](#3165)) ([bfe4e8a](bfe4e8a)) * Name of calculated value in data browser graph allows leading and trailing spaces ([#3132](#3132)) ([9493b18](9493b18)) * Optimize data browser cell context menu grouping and readability ([#3141](#3141)) ([5c711e1](5c711e1)) * Security upgrade react-router and react-router-dom ([#3107](#3107)) ([b76b9d1](b76b9d1)) * Setting a keyboard shortcut to its default value creates an unnecessary dashboard config storage entry ([#3173](#3173)) ([4949053](4949053)) ### Features * Add auto-scrolling for info panels ([#3149](#3149)) ([3cd8197](3cd8197)) * Add canvas tree to sidebar instead of loading dialog and favorite functionality ([#3146](#3146)) ([e58dc82](e58dc82)) * Add cloning of element in canvas ([#3144](#3144)) ([dec06ad](dec06ad)) * Add context menu in data browser to add cell content or selected text to Cloud Config parameter ([#3123](#3123)) ([9bc5197](9bc5197)) * Add context menu in data browser to get related records from String and Number fields ([#3118](#3118)) ([824bebd](824bebd)) * Add context menu item to get related records for selected text in data browser cell ([#3142](#3142)) ([33d3595](33d3595)) * Add custom dashboard canvas with graphs and data tables ([#3126](#3126)) ([d45c27b](d45c27b)) * Add customizable styles for line and bar series in data browser graph ([#3131](#3131)) ([501dd4b](501dd4b)) * Add customizable Y-axis titles for data browser graphs ([#3130](#3130)) ([2946e64](2946e64)) * Add dialog to execute Cloud Job with parameters ([#3158](#3158)) ([da419e0](da419e0)) * Add expanded view for canvas elements graph, table, view ([#3156](#3156)) ([0ffd767](0ffd767)) * Add field `objectId` to get related records context menu in data browser ([#3161](#3161)) ([2847ccf](2847ccf)) * Add formula-based calculated value to data browser graph ([#3129](#3129)) ([7c5d1b3](7c5d1b3)) * Add keyboard shortcut for executing script on selected rows in data browser ([#3171](#3171)) ([75389ad](75389ad)) * Add more customization options for graphs in canvas ([#3134](#3134)) ([ddbd666](ddbd666)) * Add non-alphanumeric character detection in Cloud Config parameters ([#3143](#3143)) ([1594ec8](1594ec8)) * Add quick-remove button to array parameter in Cloud Config ([#3121](#3121)) ([b632074](b632074)) * Add support for server side storage of Cloud Config parameter history ([#3169](#3169)) ([964e540](964e540)) * Allow adding View elements to canvas ([#3133](#3133)) ([2f2ae9a](2f2ae9a)) * Allow to favorite canvas for quick-access via sidebar menu ([#3135](#3135)) ([1e3a3c7](1e3a3c7)) * Allow to pause auto-scroll of info panel by holding the Option key ([#3160](#3160)) ([db38f14](db38f14)) * Allow to use ESC key to cancel, Cmd + Enter key to submit, Tab key to navigate a modal dialog ([#3172](#3172)) ([debdc09](debdc09)) * Detect and warn about unprintable characters in Cloud Config parameter values ([#3119](#3119)) ([26c909c](26c909c)) * Improve usability and layout of canvas and elements ([#3148](#3148)) ([cd654dc](cd654dc)) * Optimize appearance of graph tick labels on x-axis for date values ([#3147](#3147)) ([a9edcaf](a9edcaf)) * Optimize canvas menu organization ([#3145](#3145)) ([1558826](1558826)) * Replace graph fields with graph series for more customization ([#3157](#3157)) ([51feba4](51feba4)) * Various improvements for auto-scrolling info panel ([#3151](#3151)) ([423d83a](423d83a))
New Pull Request Checklist
Feature
Adds "Add to config parameter..." context menu item to add cell content to Cloud Config array. When right-clicking on selected text inside the cell while in edit mode, or on selected text in the info panel, hold the
Altkey while clicking to show the custom context menu.Summary by CodeRabbit
New Features
Style
✏️ Tip: You can customize this high-level summary in your review settings.