Monaco Editor in NodeDialog prevents dialog from shrinking when resized
Description
The NodeDialog component has been made resizable by dragging the lower-right corner handle. However, when the dialog contains a Monaco editor (via CodeEditorRenderer), the dialog can expand but cannot shrink back to a smaller size. This creates a horizontal scrollbar and poor user experience.
Steps to Reproduce
- Open a node dialog that contains a code editor field (uses
CodeEditorRenderer)
- Drag the resize handle in the lower-right corner to expand the dialog
- Try to drag the resize handle to shrink the dialog to a smaller width
- Observe that the dialog width state changes, but the content does not shrink
Expected Behavior
- The dialog should resize smoothly in both directions (expand and shrink)
- Monaco editor should adjust its layout to fit the new dialog dimensions
- No horizontal scrollbar should appear when shrinking the dialog
- All form controls should respect the dialog width constraints
Actual Behavior
- Dialog expands correctly when dragged larger
- When dragged smaller, the dialog frame resizes but content maintains its expanded width
- Horizontal scrollbar appears in the DialogContent
- Monaco editor does not shrink to fit the new width
- Other JsonForms controls without Monaco editor work correctly
Technical Details
Affected Files:
continuum-frontend/workflow-editor-extension/src/browser/components/node-dialog/NodeDialog.tsx:148-193 - Main dialog component with resize logic
continuum-frontend/workflow-editor-extension/src/browser/components/monaco/MonacoEditorWrapper.tsx:78-114 - Monaco editor resize handling
continuum-frontend/workflow-editor-extension/src/browser/components/node-dialog/CodeEditorRenderer.tsx:63-104 - Custom JsonForms renderer for code editor
What's Been Tried:
- ✅ Added ResizeObserver to MonacoEditorWrapper to call
editor.layout() on resize
- ✅ Set explicit width/maxWidth constraints on DialogContent matching dialog size
- ✅ Added
minWidth: 0 throughout the component hierarchy to allow flex shrinking
- ✅ Disabled
automaticLayout and manually control Monaco layout with explicit dimensions
- ✅ Added aggressive CSS rules with
!important to override default styles
- ✅ Set Monaco options:
scrollBeyondLastColumn: 0, wordWrap: 'on', fixedOverflowWidgets: true
Current State:
- Forms without Monaco editor shrink correctly
- Monaco editor specifically prevents shrinking
- The ResizeObserver fires and calls
layout(), but Monaco doesn't respect the smaller dimensions
Possible Solutions to Investigate
- Check if Monaco has internal minimum width constraints that need to be overridden
- Investigate if Monaco's DOM structure is adding fixed-width elements
- Try wrapping Monaco in an additional container with
contain: layout size
- Consider if Monaco needs to be destroyed and recreated on significant size changes
- Check if there are Monaco-specific viewport or overflow settings affecting layout
- Investigate JsonForms rendering lifecycle - may need to force re-render on dialog resize
Environment
- Monaco Editor integrated with Theia
- JsonForms with Material UI renderers
- Custom code editor renderer for Monaco integration
Priority
Medium - Feature works for expansion, shrinking is a UX improvement
Monaco Editor in NodeDialog prevents dialog from shrinking when resized
Description
The NodeDialog component has been made resizable by dragging the lower-right corner handle. However, when the dialog contains a Monaco editor (via
CodeEditorRenderer), the dialog can expand but cannot shrink back to a smaller size. This creates a horizontal scrollbar and poor user experience.Steps to Reproduce
CodeEditorRenderer)Expected Behavior
Actual Behavior
Technical Details
Affected Files:
continuum-frontend/workflow-editor-extension/src/browser/components/node-dialog/NodeDialog.tsx:148-193- Main dialog component with resize logiccontinuum-frontend/workflow-editor-extension/src/browser/components/monaco/MonacoEditorWrapper.tsx:78-114- Monaco editor resize handlingcontinuum-frontend/workflow-editor-extension/src/browser/components/node-dialog/CodeEditorRenderer.tsx:63-104- Custom JsonForms renderer for code editorWhat's Been Tried:
editor.layout()on resizeminWidth: 0throughout the component hierarchy to allow flex shrinkingautomaticLayoutand manually control Monaco layout with explicit dimensions!importantto override default stylesscrollBeyondLastColumn: 0,wordWrap: 'on',fixedOverflowWidgets: trueCurrent State:
layout(), but Monaco doesn't respect the smaller dimensionsPossible Solutions to Investigate
contain: layout sizeEnvironment
Priority
Medium - Feature works for expansion, shrinking is a UX improvement