refactor(props): allow negative values for position attributes#566
refactor(props): allow negative values for position attributes#566azamat7g wants to merge 2 commits into
Conversation
Removed constraints enforcing non-negative values for `Top`, `Left`, `Right`, and `Bottom` attributes across components. Adjusted tests to account for preserving negative values.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (9)
💤 Files with no reviewable changes (3)
📝 WalkthroughSummary by CodeRabbit
WalkthroughDocumentation and validation logic for three components (Barcode, Checkbox, Text) were updated to allow negative values for positional properties. Minimum value clamping was removed from their 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)
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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
Removed constraints enforcing non-negative values for
Top,Left,Right, andBottomattributes across components. Adjusted tests to account for preserving negative values.Description
Allows negative values for
Top/Bottom/Left/Rightonprops.Text,props.Barcode, andprops.Checkbox. PreviouslyMakeValidclamped any negative offset back to0, silently killing inputs like{ "padding": { "top": -3, "left": -2 } }that downstream JSON specs forward to the renderer.Purely additive:
>= 0values keep their existing behavior; only the previously-impossible< 0cases start working. Fields with a real geometric reason to refuse negatives (Size,Percent,Proportion,VerticalPadding, fontfallbacks) keep their clamps.
Provider-side upper-bound checks (
if textProp.Top > cell.Heightetc.) are unaffected — they clamp too-positive values, not too-negative ones.Related Issue
N/A
Checklist
func (<first letter of struct> *struct) method() {}name style.when,shouldnaming pattern.m := mocks.NewConstructor(t).m.EXPECT().MethodName()method to mock methods.example_test.go.make dodwith none issues pointed out bygolangci-lint