Skip to content

Conversation

@tomkp
Copy link
Owner

@tomkp tomkp commented Jan 15, 2026

Summary

  • Adds dividerSize prop (default: 1px) to enable accurate pane size calculations
  • Subtracts total divider width from available space before computing percentage-based sizes
  • Prevents overflow when pane percentages total 100%

Root Cause

Previously, percentage-based pane sizes were calculated against the full container size, ignoring divider space. For example, with 3 panes at 33%/34%/33% and two 8px dividers, the panes would total 100% of 1024px = 1024px, plus 16px of dividers = 1040px total (overflow).

Test Plan

  • Added test verifying custom divider width (10px) is accounted for
  • Added test verifying default 1px divider is accounted for
  • Updated existing tests to expect correct available-space calculations
  • All 105 tests pass
  • Linting, formatting, and type checking pass

Fixes #871

Previously, percentage-based pane sizes were calculated against the full
container size, ignoring the space taken by dividers. This caused panes
totaling 100% to overflow their container by the combined width of all
dividers.

Changes:
- Add `dividerSize` prop (default: 1px) to SplitPane for accurate sizing
- Subtract total divider width from available space before calculating
  percentage-based pane sizes
- Apply same adjustment when redistributing pane sizes on container resize
- Update tests to verify correct behavior with divider width accounting

Fixes #871
@tomkp tomkp merged commit e4db341 into master Jan 15, 2026
1 check passed
@tomkp tomkp deleted the fix/divider-size-calculation branch January 15, 2026 21:34
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.

Divider's size seems not considered when calculating sizes

2 participants