Skip to content

En: Shesha width handling#4534

Open
czwe-01 wants to merge 181 commits intomainfrom
form-component-width/3557
Open

En: Shesha width handling#4534
czwe-01 wants to merge 181 commits intomainfrom
form-component-width/3557

Conversation

@czwe-01
Copy link
Collaborator

@czwe-01 czwe-01 commented Feb 20, 2026

Shesha Width Properties Affecting the wrong width #3557

Summary by CodeRabbit

This PR resolves three critical rendering issues in the designer:

  1. Component Width Double-Application
    When a component's width was set to 50% in the designer, it would incorrectly render at 25% due to cascading style application. The wrapper element received a 50% width allocation, and the component itself also inherited 50% width from allStyles, resulting in a compounded calculation (50% × 50% = 25%).
  2. Form Item Width Calculation
    Form items displayed incorrect total widths because label dimensions were not accounted for in the width calculations.
  3. Viewport Unit Conversion in Designer Mode
    Viewport width (vw) units were not being converted to canvas-relative values within the designer environment. Consequently, components styled with 100vw would overflow beyond the canvas boundaries, as the calculation did not account for the screen space occupied by side panels.
  • New Features

    • Per-form-item margin control and richer styling options across form components
    • Consolidated thumbnail/appearance settings for file/attachment components
    • Conic gradient option for background styling
    • Device/designer-aware sizing and layout for form designer components
    • Custom actions added to form toolbar
  • Style

    • More consistent full-width/full-height rendering across inputs, panels and components
    • Responsive panel, sidebar and collapsible sizing improvements
    • Standardized spacing, padding and form-item classes
  • Bug Fixes

    • Improved dimension/zoom handling and layout/position accuracy in designer and runtime views

czwe-01 and others added 30 commits March 4, 2026 11:35
- Eliminated the inputWidth setting from the settings form to streamline configuration.
- Adjusted TextFieldComponent to rely on fullStyle for width, enhancing layout consistency.
- Changed comment syntax from `//` to `/* */` for consistency in styles.ts.
- Removed inline styles from TextAreaWrapper for cleaner component structure.
- Updated style handling in RateComponent and SwitchComponent to safely access `allStyles` with optional chaining, enhancing robustness.
…height logic

- Updated ConfigurableFormItemLive to simplify width and height calculations, ensuring better layout consistency.
- Removed the useValidationHeight hook and related logic to enhance performance and reduce complexity.
- Adjusted stylingUtils to eliminate unnecessary parameters, focusing on essential dimension calculations.
- Added preserveDimensionsInDesigner property to various components for improved layout handling in design mode.
- Updated styles.ts to improve overflow handling by checking for object types.
- Enhanced ConfigurableItemAutocompleteComponent to safely parse JSON expressions with error handling.
- Adjusted ProgressWrapper to use nullish coalescing for percent value assignment.
- Ensured safe access to dimensionsStyles in RichTextEditorComponent to prevent potential runtime errors.
…idth

Thulasizwe/en/form components width
… layout

- Added useStyles import to ConfigurableFormItemLive for better styling management.
- Updated className assignment to include styles from useStyles, enhancing component appearance.
- Simplified styles.ts by removing unused properties and logic, streamlining the styling process.
…idth

refactor: integrate styles into ConfigurableFormItemLive
- Removed unused comments in styles.ts to improve code clarity.
- Updated dimensionUtils to use a constant for the number of dimensions, enhancing maintainability.
- Adjusted setCanvasWidth function to accept both number and string types for better flexibility.
- Updated setCanvasWidth function to ensure width is always a string with 'px' suffix when a number is provided, enhancing type handling and consistency.
…idth

Thulasizwe/en/form components width
…styles

- Integrated designerConstants for default margin values in ConfigurableFormItemLive.
- Updated margin handling to differentiate between designer and live modes, ensuring proper layout.
- Removed unused styles and the useStyles import from ConfigurableFormItemLive, streamlining the component.
- Adjusted ImageField component to utilize dynamic width and height from styles, improving responsiveness.
…idth

refactor: enhance ConfigurableFormItemLive margins
…idth

fix: add missing newline at end of image.tsx file
…les and classNames

- Eliminated the useStyles import and classNames from ConfigurableFormItemSetting, streamlining the component.
- Adjusted tooltip handling to ensure proper display of model descriptions.
- Cleaned up the Form.Item component by removing unnecessary className and style properties.
…idth

refactor: simplify ConfigurableFormItemSetting by removing unused styles
- Removed explicit width and height styles from DropdownComponent and NumberFieldComponent, allowing for more flexible styling.
- Ensured that styles are applied consistently across components, enhancing maintainability and responsiveness.
- Introduced useStyles in ConfigurableFormItemSetting and FormItem for improved styling management.
- Updated className assignments to utilize dynamic styles, ensuring consistent margins and layout.
- Adjusted tooltip handling in ConfigurableFormItemSetting to allow for undefined values.
- Cleaned up styles in various components to enhance maintainability and responsiveness.
- Removed unnecessary imports and whitespace in styles and component files for better readability.
- Enhanced the use of dynamic styles in LabelConfigurator and FormItem components to ensure consistent layout.
- Streamlined the LabelConfiguratorComponent by adjusting prop formatting for improved clarity.
…idth

Thulasizwe/en/form components width
…idth

Thulasizwe/en/form components width
- Added width property to border input settings for better alignment.
- Cleaned up styles in settings input components to ensure consistent layout and responsiveness.
- Adjusted conditional rendering logic in settings input for improved clarity.
…idth

Thulasizwe/en/form components width
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants