Skip to content

feat: Add GapControl component with axis split mode - #699

Draft
SmrutiSawant wants to merge 8 commits into
frappe:developfrom
SmrutiSawant:feature
Draft

feat: Add GapControl component with axis split mode#699
SmrutiSawant wants to merge 8 commits into
frappe:developfrom
SmrutiSawant:feature

Conversation

@SmrutiSawant

Copy link
Copy Markdown
Contributor

Description :
Adds a new GapControl.vue component that supports both uniform mode (gap) and split mode (row-gap and column-gap) for Flex and Grid layout panels.

Before :

Before.mp4

After :

After.mp4

Comment thread frontend/src/components/GapControl.vue Outdated
@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 3/5

This PR is not safe to merge until mixed multi-selection edits preserve the untouched gap axis.

The current split-edit path still converts the untouched mixed component to 0px and writes that shorthand across every selected block.

Files Needing Attention: frontend/src/components/GapControl.vue, frontend/src/utils/cssUtils.ts

Reviews (3): Last reviewed commit: "Merge branch 'frappe:develop' into featu..." | Re-trigger Greptile

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.59%. Comparing base (f737b23) to head (e79be12).
⚠️ Report is 14 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #699   +/-   ##
========================================
  Coverage    57.59%   57.59%           
========================================
  Files           35       35           
  Lines         4271     4271           
========================================
  Hits          2460     2460           
  Misses        1811     1811           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread frontend/src/components/GapControl.vue Outdated
Comment thread frontend/src/utils/cssUtils.ts Outdated
Comment thread frontend/src/components/GapControl.vue Outdated
@SmrutiSawant
SmrutiSawant marked this pull request as draft July 28, 2026 15:49
@SmrutiSawant
SmrutiSawant requested a review from stravo1 July 30, 2026 15:32
stravo1 and others added 2 commits July 31, 2026 12:53
…ontrol

SplitModeInput now owns its split mode. It turns split on when the sides
differ, and the toggle only forces it on. Each variant renders its own
instance, so a plain ref replaces the per-variant record that the
useSplitControl composable held. This removes the composable and the
getControlAttrs wiring from every caller.

SplitPropertyControl wraps StylePropertyControl the same way
StylePropertyControl wraps BasePropertyControl. It pins the component and
the slider, and it defaults the shorthand converters, the input attributes
and the unit normalizer. The normalizer now follows the first unit option
instead of a hardcoded px. All current unit lists start with px, so the
behavior does not change.

The four split controls drop 8 to 9 repeated props each. Border radius
falls from 43 lines to 28.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
expandShorthand loses three branches. The token filter now removes the
"Mixed" and "unset" placeholders, so the whole-string guard is no longer
necessary. The 2-value and 3-value cases differ only in the third slot, so
one line covers both.

collapseShorthand is the new counterpart. It walks the slots backwards and
drops each trailing value that the value two slots before it implies. This
works for 2 slots and for 4, so collapseBoxShorthand and collapseGapShorthand
become one-liners over it. The gap version keeps the 0px fallback, because an
unset axis would otherwise make the pair read as a single value.

The JSDoc blocks give way to one comment per rule.

A differential test over 13369 inputs shows no change in behavior. It covers
both slot counts, all four-side and two-axis combinations, the placeholder
values and calc() values.

Also drop a stale second argument in useSpacingHandler. expandBoxShorthand
takes one argument. The runtime ignored the extra one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Comment thread frontend/src/components/GapControl.vue Outdated
@SmrutiSawant
SmrutiSawant requested a review from stravo1 July 31, 2026 09:32
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