-
Notifications
You must be signed in to change notification settings - Fork 71
Fix record config helper overflow from the model #1352
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
Fix record config helper overflow from the model #1352
Conversation
WalkthroughThis change introduces a configuration-driven mechanism to conditionally disable the helper toggle button in the ChipExpressionEditor. A new configuration class for record forms overrides the default behavior by returning false from getIsToggleHelperAvailable(), preventing the toggle from rendering when this config is used. The helper pane positioning calculation is enhanced with additional parameters for improved boundary-based overflow detection. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 🧪 Unit Test Generation v2 is now available!We have significantly improved our unit test generation capabilities. To enable: Add this to your reviews:
finishing_touches:
unit_tests:
enabled: trueTry it out by using the Have feedback? Share your thoughts on our Discord thread! 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Fixes helper pane positioning so it doesn’t overflow past the expression editor’s right edge (especially in constrained containers) and removes the redundant helper toggle UI for the RecordConfig modal.
Changes:
- Adjust helper pane positioning logic to correct against the editor container’s right boundary (not the viewport).
- Add a configuration flag to disable helper toggle UI, and use it to remove the toggle from the RecordConfig editor.
- Introduce a RecordConfig-specific expression editor configuration.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| workspaces/ballerina/ballerina-visualizer/src/views/BI/HelperPaneNew/Views/RecordConfigModal.tsx | Switches RecordConfig modal editor config to disable the helper toggle button. |
| workspaces/ballerina/ballerina-side-panel/src/components/editors/MultiModeExpressionEditor/Configurations.tsx | Adds RecordConfigExpressionEditorConfig to disable helper toggle availability. |
| workspaces/ballerina/ballerina-side-panel/src/components/editors/MultiModeExpressionEditor/ChipExpressionEditor/utils.ts | Updates helper pane positioning correction to use editor boundary overflow instead of viewport. |
| workspaces/ballerina/ballerina-side-panel/src/components/editors/MultiModeExpressionEditor/ChipExpressionEditor/components/ChipExpressionEditor.tsx | Gates rendering of helper toggle UI based on configuration. |
| workspaces/ballerina/ballerina-side-panel/src/components/editors/MultiModeExpressionEditor/ChipExpressionEditor/ChipExpressionDefaultConfig.ts | Adds getIsToggleHelperAvailable() defaulting to true. |
Comments suppressed due to low confidence (1)
workspaces/ballerina/ballerina-visualizer/src/views/BI/HelperPaneNew/Views/RecordConfigModal.tsx:30
- The RecordConfigModal now uses RecordConfigExpressionEditorConfig, but the file still has a leftover deep import of ChipExpressionEditorDefaultConfiguration from "@wso2/ballerina-side-panel/lib/..." which is no longer used. Please remove the unused import and avoid deep-importing from the built "lib" path (prefer the package’s public exports) to prevent duplicate-module/bundler issues.
import { ChipExpressionEditorComponent, Context as FormContext, HelperpaneOnChangeOptions, FieldProvider, FormField, FormExpressionEditorProps, getPropertyFromFormField, RecordConfigExpressionEditorConfig } from "@wso2/ballerina-side-panel";
import { useForm } from "react-hook-form";
import { debounce } from "lodash";
import ReactMarkdown from "react-markdown";
import { updateFieldsSelection } from "../Components/RecordConstructView/utils";
import { ChipExpressionEditorDefaultConfiguration } from "@wso2/ballerina-side-panel/lib/components/editors/MultiModeExpressionEditor/ChipExpressionEditor/ChipExpressionDefaultConfig";
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const editorRight = editorRect.left + editorRect.width; | ||
| const paneRight = targetCoords.left + helperPaneWidth; | ||
| const overflow = paneRight - editorRight; | ||
|
|
||
| if (overflow > 0) { |
Copilot
AI
Jan 29, 2026
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.
calculateHelperPanePosition can produce a negative left when helperPaneWidth > editorRect.width (narrow editor containers). That shifts the helper pane outside the editor on the left and still leaves it partially hidden. Consider clamping left to the editor bounds (e.g., left = Math.max(0, Math.min(left, editorRect.width - helperPaneWidth))) and/or allowing the pane container to shrink via max-width: 100%.
… of Status code to 200" This reverts commit b6da481.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Purpose
The helper pane in the expression editor could overflow beyond the right boundary of the editor container, causing layout issues and partially hidden UI elements. This negatively affected usability, especially in constrained editor widths.
Additionally, the helper toggle button in the RecordConfig model expression editor was redundant, as the helper pane is already shown by default and can be accessed via keyboard shortcuts.
Resolves: wso2/product-ballerina-integrator#2352
Goals
Approach
Summary by CodeRabbit
New Features
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.