You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(splitter): follow --ig-size with small, medium and large bars - #2635
igc-splitter follows --ig-size. The bar, the drag handle and the expanders have a small, a medium and a large step, and the default is small, which is the size from before.
The splitter ignored --ig-size: splitter.common.scss read one fixed size token (4px) for the handle and the expanders and padded it by 1px on each side for the bar, and the host set no --component-size.
Changes
The host sets --component-size: var(--ig-size, <default-size>). The schema default is small.
The bar is 6px, 12px, 18px thick. The 1px bar padding is gone, and the bar centers the handle and the expanders itself.
The drag handle is 4px, 6px, 8px thick. Its radius is the border-radius token, whose default is now 2px, 8px, 8px, scaled by --ig-radius-factor. A --ig-splitter-border-radius that you set is one value and applies at every size, as before.
The expanders are 4px, 5px, 6px high and twice that wide.
The three steps add to the size token, so --ig-splitter-size still sets the small size: 10px gives a 12px, 18px, 24px bar and a 10px, 12px, 14px handle. Before, it gave a 12px bar and a 10px handle.
In Indigo the idle bar is 1px, 4px, 8px thick by size, as design asked in the review of feat(splitter): follow --ig-size with small, medium and large bars igniteui-angular#18017. The idle scale is tan(atan2(<idle thickness>, <bar thickness>)), the ratio of the two lengths, so it follows the size and a --ig-splitter-size override. Before, it was 1 / 6 at compile time, so an overridden size left an idle bar thicker than 1px.
Small
Medium
Large
Bar
6px
12px
18px
Drag handle
4px
6px
8px
Drag handle radius
2px
8px
8px
Expander height
4px
5px
6px
Why the steps are not theme tokens
The bar, handle and expander steps are internal variables that add to the size token (bar +2/8/14px, handle +0/2/4px, expanders +0/1/2px). Separate tokens would let a theme set a handle thicker than its bar. size stays the one token for the thickness: it sets the small size and every step moves with it.
Short bars
The 48px margins around the drag handle shrink when the bar is too short: clamp(0px, 37.5cqb - <expander box>, 48px), with the bar as a size container. The handle keeps 25% of the bar length and the expanders stay inside the bar. A 128px bar has a 32px handle with 30px margins at small and 24px at large.
Before, the margins were a fixed 48px, so the handle shrank: 16px on a 128px bar on master.
A bar with room for everything, about 176px or more at small, keeps the 48px margins in every state: both expanders shown, a pane collapsed, the drag handle hidden. A shorter one has a longer handle and narrower margins, also at the default size. It is in the CHANGELOG under Fixed.
container-type: size on the bar adds layout and size containment to it. The bar has a set thickness and takes its length from the splitter, so its size does not come from its content.
Icon box
Design asked in the review of IgniteUI/igniteui-angular#18017 that the 48px start from the icon container of the expander, not from the arrow.
Each expander takes the icon box of the design along the bar: 18px, 20px, 24px, and 14px, 16px, 24px in Indigo. The triangle is 8px, 10px, 12px long, so it gets a margin of 5px, 5px, 6px on each side (3px, 3px, 6px in Indigo).
The drag handle is 48px from the box: 53px, 53px, 54px from the triangle (51px, 51px, 54px in Indigo). Before, it was 48px from the triangle.
The hitbox of an expander, a ::before, is that icon box as a square, centered on the triangle: 18px, 20px, 24px, and 14px, 16px, 24px in Indigo. Before, the expander had no hitbox and took the pointer on the triangle alone, 4px by 8px at small. It is the same box as the expander ::before of igx-splitter after feat(splitter): follow --ig-size with small, medium and large bars igniteui-angular#18017, which design asked for in the review.
This changes the default size too: at small each expander is 5px further from the handle than on master, 3px in Indigo. It is in the CHANGELOG.
The space is a private step, like the bar, handle and expander steps. The expander stays one element and the parts are the same.
Review fixes
A change of --ig-size recomputes the pane constraints. The resize observer also observes the bar, whose thickness changes without a host resize. In a 500px splitter with two 245px minimums, a switch from small to large drops both minimums, as a container too small for them does. Before, they stayed applied and the panes overflowed by 8px.
The space for the panes counts the full thickness of the bar: its computed layout size, which no transform changes, at the scale of the measured container. The value keeps its fraction and follows a scaled ancestor, and a rotated ancestor does not inflate it. Before, it was the bounding box, which in Indigo is the thickness the idle bar is scaled to, so two minimums that filled the splitter overflowed it. master has the same error with its 6px bar; a larger size made it up to 17px. It is in the CHANGELOG under Fixed.
Without a drag handle (hide-drag-handle or disable-resize) the gap between the two expander boxes is clamp(0px, 100cqb - 2 * <expander box>, 48px): 48px when the bar has room, less on a shorter bar. Before, it was a fixed 48px, so on a 68px bar at large the expanders overflowed by 4px. The rule moved from splitter.base.scss to the orientation loop in splitter.common.scss, next to the handle margins.
The sizing tests for medium and large, the short bar and the Indigo idle bar run in both orientations.
The comment about the igniteui-theming version is fixed by the range bump to ^30.3.0, see Depends on.
What stays the same
A splitter without --ig-size keeps its sizes: 6px bar, 4px handle with a 2px radius, 4px expanders. The one difference is the position of the expanders, 5px further from the handle (3px in Indigo), see Icon box.
Parts, properties and events. No CEM or public-api.json change.
Every way of setting the handle radius: splitter-theme($border-radius: ...) and --ig-splitter-border-radius.
The drag handle is 25% of the bar length at every size.
Depends on
IgniteUI/igniteui-theming#683 (for IgniteUI/igniteui-theming#682) adds default-size and the sized border-radius default to the schema. It is released in igniteui-theming@30.3.0. var-get() errors on a key the schema lacks, so the styles do not compile with 30.2.0, and this PR bumps the igniteui-theming range to ^30.3.0. The lockfile loses the nested sass-embedded copies under igniteui-theming: 30.3.0 widens its sass-embedded range, so they dedupe to the root one. With 30.3.0 installed from the registry, npm run lint, npm run check and npm test pass: 7034 passed, 0 failed, 2 skipped.
Known limit
The handoff draws the expanders as arrow icons (18/20/24px, Indigo 14/16/24px). They stay CSS triangles here, 4/5/6px in every theme, so small does not change.
The handoff measures the gap as 48/48/46px from the icon box. Here it is 48px from the box at every size when the bar has room.
In Indigo, a change of --ig-size at run time animates the idle scale with the 0.5s delay of the bar transition, so the idle bar does not have its new thickness until it ends.
Type of Change
Bug fix (non-breaking change that fixes an issue)
New feature (non-breaking change that adds functionality)
sizes the bar, the drag handle and the expanders at medium and large, in both orientations.
adds each step to an overridden --ig-splitter-size.
keeps 48px between the drag handle and the icon box of each expander, at every size.
uses the smaller icon box of indigo for the gaps.
sizes the hitbox of each expander to the icon box and centers it on the triangle, in both orientations. It fails without the hitbox.
keeps the 48px margins around the drag handle with a collapsed pane.
keeps the drag handle at 25% of a short bar and narrows the gaps, at every size and in both orientations.
keeps the expander boxes 48px apart without a drag handle and inside a bar too short for it.
drops the minimum sizes that no longer fit when the size makes the bar thicker.
keeps a 1px, 4px and 8px idle bar by size, also with an overridden size, in indigo.
takes the full bar thickness from the panes while the bar is idle in indigo.
counts a fractional bar thickness against the minimum sizes.
measures the bar in the coordinates of a scaled ancestor.
keeps the minimum sizes that fit beside the idle bar under a rotated ancestor in indigo.
shows the full bar thickness on hover at every size in indigo.
Against the styles of master, 5 of the 7 tests of the first commit fail (medium and large, the size override, the short bar, the Indigo idle bar and hover). The small default and the collapsed pane pass there too: they pin what stays the same. The three tests of the review fixes (the expanders without a drag handle, the dropped minimums, the pane space in Indigo) fail without their fix, checked against the first commit of this PR. The fractional thickness and the scaled ancestor tests fail against the second commit, which read offsetWidth. The rotated ancestor test fails against the third commit, which divided the bounding box of the bar by its scale.
npm run lint, npm run build:styles, npm run check and npm test pass in Chromium: 7034 passed, 0 failed, 2 skipped.
The splitter spec in the other browsers: WebKit 164 of 164. Firefox 129 of 164; all 16 Sizing tests pass there, and the 35 failures are NotFoundError: Element.setPointerCapture: Invalid pointer id in the drag tests, which this change does not touch.
Checklist
My code follows the project's coding standards
I have tested my changes locally
I have updated documentation if needed
I have added a CHANGELOG.md entry under [Unreleased]
I have read the contributing guidelines, including the accessibility, dependency and security rules
- The bar is 6px, 12px or 18px thick, the drag handle 4px, 6px or 8px
and the expanders 4px, 5px or 6px high. The default size is small, so
a splitter without `--ig-size` renders as before.
- The steps are internal: the styles add them to the `size` token, so
the handle can't be set thicker than the bar, and
`--ig-splitter-size` still sets the small size.
- The drag handle radius is the `border-radius` token, whose default is
2px, 8px, 8px by size. A value that you set applies at every size.
- The Indigo idle bar stays 1px thick at every size.
- The 48px margins around the drag handle shrink when the bar is too
short, so the handle keeps 25% of the bar length and the expanders
stay inside the bar.
Needs the igniteui-theming release with IgniteUI/igniteui-theming#683.
Closes#2634.
…th the bar size
- A change of --ig-size recomputes the pane constraints: the bar is observed for resize, so a thicker bar drops the minimum sizes that no longer fit.
- The space for the panes counts the layout thickness of the bar. In Indigo the idle bar is scaled to 1px, and its minimum sizes no longer overflow the splitter.
- Without a drag handle the gap between the expanders is 48px at most and shrinks to what a short bar leaves, so the expanders stay inside it.
- The sizing tests run in both orientations.
Refs #2634.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The locked theming dependency lacks the required schema key, breaking clean builds and tests; drag resizing and bar measurements also have unresolved sizing defects.
…tes of the container
- The bar thickness is its bounding box divided by the scale a theme sets on the bar, so it keeps its fraction and follows a scaled ancestor like the container does.
- A fractional thickness counts in full against the minimum sizes.
Refs #2634.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The splitter bar can collapse in auto-height containers, discard valid minimum constraints under transforms, and lose its usable handle when controls do not fit.
At large size, a 20px bar needs 24px for its two expanders before any handle or gap, so zero margins still let the buttons overflow and shrink the handle to zero. Define a fallback when the controls themselves cannot fit, such as reducing or hiding them while preserving a usable handle. The hidden-handle gap at line 95 needs the same fallback.
Size containment can collapse the bar in auto-height containers
Size containment removes the bar's intrinsic contribution in both axes. If the splitter is in an auto-height container and its panes are empty or very short, the percentage heights are indefinite, so the bar can now collapse to zero height; previously its controls and margins gave it a usable intrinsic height. Please preserve an intrinsic length fallback, or otherwise avoid size containment when the splitter's length is content-sized.
- The bar thickness is its computed layout size at the scale of the container, so a rotated ancestor does not inflate it and the scale of a theme does not shrink it.
Refs #2634.
- Each expander takes the 18px, 20px and 24px icon box of the design along the bar, 14px, 16px and 24px in the Indigo theme. The drag handle is 48px from the box, so the triangle is 5px further away at small.
- Without a drag handle the two boxes are 48px apart.
Refs #2634.
…chema
- The splitter styles read `default-size` and the sized `border-radius` from the schema, which `igniteui-theming` ships from 30.3.0.
- The nested `sass-embedded` copies under `igniteui-theming` dedupe to the root one.
- The area of an expander that takes the pointer is the icon box of the design, centered on the arrow: 18px, 20px or 24px square, 14px, 16px or 24px in the Indigo theme.
- Before, it was the arrow alone, 4px by 8px at small.
- The hitbox matches the one of igx-splitter in igniteui-angular.
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this lines up with IgniteUI/igniteui-angular#18017 and the igniteui-theming@30.3.0 schema: the size steps, the Indigo idle bar, the icon box, the hitboxes and the short-bar clamp() all match. The extras that only this PR has fit the web components splitter: the expander gap without a drag handle, recomputing the pane minimums on a size change, and measuring the bar from its layout thickness. Three small things:
1. CHANGELOG: list the behaviour changes under ### Changed
The entry is only under Added, but it includes changes that apps get without opting in:
an app that already sets --ig-size to medium or large gets a thicker bar;
at the default size, the expanders are 5px further from the handle (3px in Indigo) and have a larger pointer area.
A short line under ### Changed would make these easier to spot (CONTRIBUTING.md asks for the Keep a Changelog categories).
2. Indigo: changing --ig-size at run time
The idle bar reaches its new thickness only after the bar transition's 0.5s delay. The PR already lists this as a known limit. A run-time size change is rare, so I'm fine leaving it, but please add it to the Limitations section of spec.md so it doesn't get lost.
3. Nit: splitter.ts:1000 Number.parseFloat(value) || 0 repeats asNumber() from #internals/utils/math.js, which this file already uses.
- CHANGELOG: the thicker bar for an app that already sets `--ig-size` and the new expander gap and pointer area are under Changed; Added keeps the new sizes.
- spec.md: Assumptions and limitations lists the 0.5s delay before the Indigo idle bar takes a run-time `--ig-size` change.
- The bar thickness sums its box values with `asNumber()`.
Thanks, all three done in ab0ab74. The branch also merges master (8778348), which fixes the CHANGELOG conflict with the QR code entries.
CHANGELOG: ### Changed has a splitter entry for the thicker bar for an app that already sets --ig-size to medium or large, and for the expander gap and larger pointer area. Added keeps the new sizes.
spec.md had no Limitations section, so it now has "Assumptions and limitations", as in the other specs. It lists the 0.5s delay before the Indigo idle bar takes a run-time --ig-size change.
The bar thickness sums its box values with asNumber().
lint, check, build:styles and test pass: 7277 passed, 0 failed, 2 skipped.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
igc-splitterfollows--ig-size. The bar, the drag handle and the expanders have a small, a medium and a large step, and the default is small, which is the size from before.The splitter ignored
--ig-size:splitter.common.scssread one fixedsizetoken (4px) for the handle and the expanders and padded it by 1px on each side for the bar, and the host set no--component-size.Changes
--component-size: var(--ig-size, <default-size>). The schema default is small.border-radiustoken, whose default is now 2px, 8px, 8px, scaled by--ig-radius-factor. A--ig-splitter-border-radiusthat you set is one value and applies at every size, as before.sizetoken, so--ig-splitter-sizestill sets the small size:10pxgives a 12px, 18px, 24px bar and a 10px, 12px, 14px handle. Before, it gave a 12px bar and a 10px handle.tan(atan2(<idle thickness>, <bar thickness>)), the ratio of the two lengths, so it follows the size and a--ig-splitter-sizeoverride. Before, it was1 / 6at compile time, so an overridden size left an idle bar thicker than 1px.Why the steps are not theme tokens
The bar, handle and expander steps are internal variables that add to the
sizetoken (bar +2/8/14px, handle +0/2/4px, expanders +0/1/2px). Separate tokens would let a theme set a handle thicker than its bar.sizestays the one token for the thickness: it sets the small size and every step moves with it.Short bars
clamp(0px, 37.5cqb - <expander box>, 48px), with the bar as a size container. The handle keeps 25% of the bar length and the expanders stay inside the bar. A 128px bar has a 32px handle with 30px margins at small and 24px at large.master.container-type: sizeon the bar adds layout and size containment to it. The bar has a set thickness and takes its length from the splitter, so its size does not come from its content.Icon box
Design asked in the review of IgniteUI/igniteui-angular#18017 that the 48px start from the icon container of the expander, not from the arrow.
::before, is that icon box as a square, centered on the triangle: 18px, 20px, 24px, and 14px, 16px, 24px in Indigo. Before, the expander had no hitbox and took the pointer on the triangle alone, 4px by 8px at small. It is the same box as the expander::beforeofigx-splitterafter feat(splitter): follow --ig-size with small, medium and large bars igniteui-angular#18017, which design asked for in the review.master, 3px in Indigo. It is in the CHANGELOG.Review fixes
--ig-sizerecomputes the pane constraints. The resize observer also observes the bar, whose thickness changes without a host resize. In a 500px splitter with two 245px minimums, a switch from small to large drops both minimums, as a container too small for them does. Before, they stayed applied and the panes overflowed by 8px.masterhas the same error with its 6px bar; a larger size made it up to 17px. It is in the CHANGELOG under Fixed.hide-drag-handleordisable-resize) the gap between the two expander boxes isclamp(0px, 100cqb - 2 * <expander box>, 48px): 48px when the bar has room, less on a shorter bar. Before, it was a fixed 48px, so on a 68px bar at large the expanders overflowed by 4px. The rule moved fromsplitter.base.scssto the orientation loop insplitter.common.scss, next to the handle margins.The comment about the
igniteui-themingversion is fixed by the range bump to^30.3.0, see Depends on.What stays the same
--ig-sizekeeps its sizes: 6px bar, 4px handle with a 2px radius, 4px expanders. The one difference is the position of the expanders, 5px further from the handle (3px in Indigo), see Icon box.public-api.jsonchange.splitter-theme($border-radius: ...)and--ig-splitter-border-radius.Depends on
IgniteUI/igniteui-theming#683 (for IgniteUI/igniteui-theming#682) adds
default-sizeand the sizedborder-radiusdefault to the schema. It is released inigniteui-theming@30.3.0.var-get()errors on a key the schema lacks, so the styles do not compile with30.2.0, and this PR bumps theigniteui-themingrange to^30.3.0. The lockfile loses the nestedsass-embeddedcopies underigniteui-theming: 30.3.0 widens itssass-embeddedrange, so they dedupe to the root one. With30.3.0installed from the registry,npm run lint,npm run checkandnpm testpass: 7034 passed, 0 failed, 2 skipped.Known limit
--ig-sizeat run time animates the idle scale with the 0.5s delay of the bar transition, so the idle bar does not have its new thickness until it ends.Type of Change
Related Issues
Closes #2634
Related: IgniteUI/igniteui-angular#18013
Testing
src/components/splitter/splitter.spec.ts,Sizing, 16 tests:--ig-size.--ig-splitter-size.Against the styles of
master, 5 of the 7 tests of the first commit fail (medium and large, the size override, the short bar, the Indigo idle bar and hover). The small default and the collapsed pane pass there too: they pin what stays the same. The three tests of the review fixes (the expanders without a drag handle, the dropped minimums, the pane space in Indigo) fail without their fix, checked against the first commit of this PR. The fractional thickness and the scaled ancestor tests fail against the second commit, which readoffsetWidth. The rotated ancestor test fails against the third commit, which divided the bounding box of the bar by its scale.npm run lint,npm run build:styles,npm run checkandnpm testpass in Chromium: 7034 passed, 0 failed, 2 skipped.The splitter spec in the other browsers: WebKit 164 of 164. Firefox 129 of 164; all 16
Sizingtests pass there, and the 35 failures areNotFoundError: Element.setPointerCapture: Invalid pointer idin the drag tests, which this change does not touch.Checklist
CHANGELOG.mdentry under[Unreleased]