fix: adjust form item margin styles in global and properties tabs#4588
fix: adjust form item margin styles in global and properties tabs#4588James-Baloyi merged 1 commit intoshesha-io:mainfrom
Conversation
WalkthroughThe changes relocate a form-item margin reset from the main layout global styles to the properties tabs component styles. The margin reset (set to Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@shesha-reactjs/src/designer-components/propertiesTabs/style.ts`:
- Around line 36-38: The global reset targeting `.ant-form-item` is too broad;
narrow it to only the JS-style preview wrapper by changing the selector to scope
under the preview root (e.g., target `.sha-js-label .ant-form-item` or the
`ConfigurableFormItem` root like `.ConfigurableFormItem .ant-form-item`) so only
preview rows lose the margin without affecting `SettingsFormItem` or other
Form.Item instances in the properties panel.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: ba767d58-f1a4-4238-83c5-178412ae25d0
📒 Files selected for processing (2)
shesha-reactjs/src/components/mainLayout/styles/indexStyles.tsshesha-reactjs/src/designer-components/propertiesTabs/style.ts
💤 Files with no reviewable changes (1)
- shesha-reactjs/src/components/mainLayout/styles/indexStyles.ts
| .ant-form-item { | ||
| margin: 0px !important; | ||
| } |
There was a problem hiding this comment.
Scope this margin reset to the js-style preview wrapper only.
Line 36 now matches every Ant Form.Item in the properties tabs. SettingsFormItem renders regular settings controls as plain Form.Items, so this removes the default vertical spacing for the whole panel, not just the preview rows this fix is targeting. Please narrow the selector to the preview-specific wrapper (.sha-js-label / the ConfigurableFormItem root) instead of all .ant-form-items.
Example of a safer scope
- .ant-form-item {
- margin: 0px !important;
- }
+ .sha-js-label,
+ .sha-js-label .ant-form-item {
+ margin: 0 !important;
+ }Based on learnings: "dimension and margin handling follows a wrapper-based pattern: the FormItem wrapper (ConfigurableFormItem) is responsible for applying dimensions, margins, and layout styles..."
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| .ant-form-item { | |
| margin: 0px !important; | |
| } | |
| .sha-js-label, | |
| .sha-js-label .ant-form-item { | |
| margin: 0 !important; | |
| } |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@shesha-reactjs/src/designer-components/propertiesTabs/style.ts` around lines
36 - 38, The global reset targeting `.ant-form-item` is too broad; narrow it to
only the JS-style preview wrapper by changing the selector to scope under the
preview root (e.g., target `.sha-js-label .ant-form-item` or the
`ConfigurableFormItem` root like `.ConfigurableFormItem .ant-form-item`) so only
preview rows lose the margin without affecting `SettingsFormItem` or other
Form.Item instances in the properties panel.
#3557
Fixed issue with margins applied through jsStyles were overidden in preview mode.
Summary by CodeRabbit