Skip to content

feat(split): configure sizes per part via size and unit - #2323

Merged
spike-rabbit merged 1 commit into
mainfrom
feat/si-plit-fractional-size
Jul 28, 2026
Merged

feat(split): configure sizes per part via size and unit#2323
spike-rabbit merged 1 commit into
mainfrom
feat/si-plit-fractional-size

Conversation

@spliffone

@spliffone spliffone commented Jul 13, 2026

Copy link
Copy Markdown
Member

BREAKING CHANGE: The relative sizes of split parts are now configured on
each si-split-part via the required size and unit
input ('px' | 'fr'), instead of the sizes array on
si-split.

The sizes input on SiSplitComponent has been removed and
SiSplitPartComponent.size is now required.
The unit input on SiSplitPartComponent is now required.

  • Remove SiSplitComponent.sizes input.
  • Add SiSplitPartComponent.unit input ('px' | 'fr').
  • Make SiSplitPartComponent.size required.

Migration: move the relative sizes from [sizes] on si-split onto the
size/unit inputs of each si-split-part.

Before:

<si-split [sizes]="[20, 60, 20]">
  <si-split-part>Left</si-split-part>
  <si-split-part>Center</si-split-part>
  <si-split-part>Right</si-split-part>
</si-split>

After:

<si-split>
  <si-split-part size="20" unit="fr">Left</si-split-part>
  <si-split-part size="60" unit="fr">Center</si-split-part>
  <si-split-part size="20" unit="fr">Right</si-split-part>
</si-split>

Fixed pixel sizes are now expressed directly on the part:

<si-split>
  <si-split-part size="200" unit="px">Fixed 200px</si-split-part>
  <si-split-part size="1" unit="fr">Remaining space</si-split-part>
</si-split>

Documentation.
Examples.
Dashboards Demo.
Playwright report.

Coverage Reports:

Code Coverage

@spliffone
spliffone requested review from a team as code owners July 13, 2026 16:03
@spliffone
spliffone force-pushed the feat/si-plit-fractional-size branch from a2e6667 to 86c1253 Compare July 13, 2026 16:03
@spliffone spliffone added the breaking-changes Marks issues and PRs that are breaking the API label Jul 13, 2026
@spliffone spliffone added this to the 51.0.0 milestone Jul 13, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the split component by removing the sizes input from SiSplitComponent and introducing a required size input and an optional unit input ('px' or 'fr') directly on SiSplitPartComponent. This simplifies the API and improves layout behavior. The feedback highlights a potential TypeScript compilation error under strict type checking when restoring UI state, where state can be undefined, and suggests using a type guard to ensure type safety.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread projects/element-ng/split/si-split.component.ts
@spliffone
spliffone force-pushed the feat/si-plit-fractional-size branch 2 times, most recently from bdb7b09 to 8cb85f4 Compare July 14, 2026 04:30
@spliffone spliffone added the core-team-discussion Topics that should be discussed in the core team meeting label Jul 17, 2026
@spliffone
spliffone force-pushed the feat/si-plit-fractional-size branch 2 times, most recently from 2c1aa68 to e8d6959 Compare July 17, 2026 12:50
@michael-smt

michael-smt commented Jul 20, 2026

Copy link
Copy Markdown
Member

I think unit="fraction" would be clearer and not use the (IMHO little known) fr abbreviation.

@spliffone

Copy link
Copy Markdown
Member Author

I think unit="fraction" would be clearer and not use the (IMHO little known) fr abbreviation

Actual, px and fr unit are the official abbreviations see https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Grid_layout/Basic_concepts#the_fr_unit

@michael-smt

Copy link
Copy Markdown
Member

I think unit="fraction" would be clearer and not use the (IMHO little known) fr abbreviation

Actual, px and fr unit are the official abbreviations see https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Grid_layout/Basic_concepts#the_fr_unit

Was not aware of this, then it's fine. Thanks for the clarification.

@spike-rabbit spike-rabbit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After thinking again about, I really think we should have the unit as part of the size input.

I guess for compatibility we can keep a plain number size.
But the unit input, I am not seeing it.
Especially since it is rather easy to parse and handle internally.
It is actually also still type safe by using typescripts string template pattern.
There is no conflict with any existing events. Please check out my commit I pushed to your branch.

@spike-rabbit
spike-rabbit force-pushed the feat/si-plit-fractional-size branch 2 times, most recently from cf694a4 to 2a17f4f Compare July 24, 2026 18:31
@spliffone
spliffone force-pushed the feat/si-plit-fractional-size branch 2 times, most recently from 6299f94 to bfec8e0 Compare July 28, 2026 06:41
BREAKING CHANGE: The relative sizes of split parts are now configured on
each `si-split-part` via the required `size` and `unit`
input (`'px' | 'fr'`), instead of the `sizes` array on
`si-split`.

The `sizes` input on `SiSplitComponent` has been removed and
`SiSplitPartComponent.size` is now required.
The `unit` input on `SiSplitPartComponent` is now required.

- Remove `SiSplitComponent.sizes` input.
- Add `SiSplitPartComponent.unit` input (`'px' | 'fr'`).
- Make `SiSplitPartComponent.size` required.

Migration: move the relative sizes from `[sizes]` on `si-split` onto the
`size`/`unit` inputs of each `si-split-part`.

Before:

```html
<si-split [sizes]="[20, 60, 20]">
  <si-split-part>Left</si-split-part>
  <si-split-part>Center</si-split-part>
  <si-split-part>Right</si-split-part>
</si-split>
```
After:
```html
<si-split>
  <si-split-part size="20" unit="fr">Left</si-split-part>
  <si-split-part size="60" unit="fr">Center</si-split-part>
  <si-split-part size="20" unit="fr">Right</si-split-part>
</si-split>
```
Fixed pixel sizes are now expressed directly on the part:

```html
<si-split>
  <si-split-part size="200" unit="px">Fixed 200px</si-split-part>
  <si-split-part size="1" unit="fr">Remaining space</si-split-part>
</si-split>
```
@spliffone
spliffone force-pushed the feat/si-plit-fractional-size branch from f6ea37f to 26b17e0 Compare July 28, 2026 10:06
@spike-rabbit
spike-rabbit added this pull request to the merge queue Jul 28, 2026
Merged via the queue into main with commit 6f74f7c Jul 28, 2026
15 checks passed
@spike-rabbit
spike-rabbit deleted the feat/si-plit-fractional-size branch July 28, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-changes Marks issues and PRs that are breaking the API core-team-discussion Topics that should be discussed in the core team meeting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants