mirror of
https://github.com/penpot/penpot.git
synced 2026-07-04 21:35:22 +00:00
The flex and grid layout proxies validated `rowGap`, `columnGap` and the four padding setters with `sm/valid-safe-int?`, so a fractional value (e.g. `flex.rowGap = 10.5`) was rejected as invalid. The data model types `:row-gap`/`:column-gap` and `:p1`-`:p4` as `::sm/safe-number` (layout.cljc), and the sidebar accepts decimals, so the plugin API was stricter than the model — the same class of defect as the merged #9780. Switch those 16 gap/padding guards (8 in flex.cljs, 8 in grid.cljs) to `sm/valid-safe-number?`, matching the model and the predicate already used by the flex-element setters in the same file. Integer-only setters (`zIndex`, grid track indices/counts and cell positions/spans) keep `valid-safe-int?`. Also fixes a `:righPadding` typo in two grid rightPadding error branches. Adds a regression test asserting fractional gap/padding values are accepted (with throwValidationErrors enabled) for both flex and grid. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Filip Sajdak <filip.sajdak@siili.com>