fix: Layout issues when resizing Cloud Config parameter dialog#3241
fix: Layout issues when resizing Cloud Config parameter dialog#3241mtrezza merged 4 commits intoparse-community:alphafrom
Conversation
|
🚀 Thanks for opening this pull request! |
✅ 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. |
📝 WalkthroughWalkthroughThis PR modifies styling and component logic across four files. JsonEditor and ConfigConflictDiff stylesheets are updated to adjust overflow, width constraints, and height calculations. MultiSelect component gains a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/components/MultiSelect/MultiSelect.react.js (1)
84-84: AddmenuWidthto PropTypes.The new
menuWidthprop is used but not documented in the PropTypes definition at the end of the file. This affects API discoverability and type validation.📝 Proposed fix
Add the following to the PropTypes block after line 190:
menuWidth: PropTypes.number.describe('Explicit width of the dropdown menu in pixels. Defaults to the trigger element width.'),🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/MultiSelect/MultiSelect.react.js` at line 84, The component uses the menuWidth prop (see assignment to const width in MultiSelect.render where this.props.menuWidth is read) but it is missing from the component's PropTypes; add menuWidth to the PropTypes object for the MultiSelect component (the PropTypes block at the end of the file) as a number with a short description (e.g., "Explicit width of the dropdown menu in pixels. Defaults to the trigger element width.") so it is validated and documented.src/dashboard/Data/Config/ConfigDialog.react.js (1)
343-349: Remove or use theupdateOptionsMenuPosmethod.This method is defined but never called. The position calculation is duplicated inline in the onClick handler at lines 592-595.
♻️ Option 1: Remove unused method
- updateOptionsMenuPos = () => { - if (this.optionsRef.current) { - const pos = Position.inWindow(this.optionsRef.current); - pos.y -= 4; - this.setState({ optionsMenuPos: pos }); - } - }; -♻️ Option 2: Use the method in onClick
<Button value="Options ▾" onClick={() => { - const node = this.optionsRef.current; - const pos = Position.inWindow(node); - pos.y -= 4; // small gap above button - this.setState({ optionsMenuOpen: !this.state.optionsMenuOpen, optionsMenuPos: pos }); + this.updateOptionsMenuPos(); + this.setState({ optionsMenuOpen: !this.state.optionsMenuOpen }); }} />🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/dashboard/Data/Config/ConfigDialog.react.js` around lines 343 - 349, The updateOptionsMenuPos method is duplicated by inline position calculation in the options onClick handler—replace the inline Position.inWindow(...) logic with a call to this.updateOptionsMenuPos() (the method is already an arrow and uses this.optionsRef and setState) so the position calculation is centralized; ensure the onClick handler no longer mutates pos directly and simply invokes updateOptionsMenuPos, or if you prefer removal, delete updateOptionsMenuPos and the unused optionsMenuPos state so no dead code remains.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/components/JsonEditor/JsonEditor.scss`:
- Line 93: The min-width calc in JsonEditor.scss uses CSS variables that may be
undefined; update the rule in JsonEditor.scss to supply fallbacks like
Field.scss does so the expression becomes calc(var(--modal-min-width, 540px) *
(1 - var(--modal-label-ratio, 0.5))) to prevent layout collapse when
--modal-min-width or --modal-label-ratio (set in Modal.scss and Field.react.js)
are missing.
---
Nitpick comments:
In `@src/components/MultiSelect/MultiSelect.react.js`:
- Line 84: The component uses the menuWidth prop (see assignment to const width
in MultiSelect.render where this.props.menuWidth is read) but it is missing from
the component's PropTypes; add menuWidth to the PropTypes object for the
MultiSelect component (the PropTypes block at the end of the file) as a number
with a short description (e.g., "Explicit width of the dropdown menu in pixels.
Defaults to the trigger element width.") so it is validated and documented.
In `@src/dashboard/Data/Config/ConfigDialog.react.js`:
- Around line 343-349: The updateOptionsMenuPos method is duplicated by inline
position calculation in the options onClick handler—replace the inline
Position.inWindow(...) logic with a call to this.updateOptionsMenuPos() (the
method is already an arrow and uses this.optionsRef and setState) so the
position calculation is centralized; ensure the onClick handler no longer
mutates pos directly and simply invokes updateOptionsMenuPos, or if you prefer
removal, delete updateOptionsMenuPos and the unused optionsMenuPos state so no
dead code remains.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/components/JsonEditor/JsonEditor.scsssrc/components/MultiSelect/MultiSelect.react.jssrc/dashboard/Data/Config/ConfigConflictDiff.scsssrc/dashboard/Data/Config/ConfigDialog.react.js
# [9.1.0-alpha.2](9.1.0-alpha.1...9.1.0-alpha.2) (2026-02-27) ### Bug Fixes * Layout issues when resizing Cloud Config parameter dialog ([#3241](#3241)) ([c6e95d9](c6e95d9))
|
🎉 This change has been released in version 9.1.0-alpha.2 |
Pull Request
Issue
Layout issues when resizing Cloud Config parameter dialog
Summary by CodeRabbit
New Features
Style