Skip to content

fix(layout): the Both sides gap never shrinks to nothing - #62

Merged
thepathless merged 1 commit into
thepathless:experimentalfrom
priard:feat/spread-gap-floor
Oct 12, 2026
Merged

thepathless merged 1 commit into
thepathless:experimentalfrom
priard:feat/spread-gap-floor

Conversation

@priard

@priard priard commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Problem

In Both sides, the gap between the left group and the right group shrinks as magnification grows the icons. When the resting gap is small (a row that nearly fills the width), the growth uses the gap up. Its width then reaches 0, and the right group jumps left by one row spacing before it carries on. This was the one minor left open from the #49 review.

Cause

A Row does not lay out a child with zero width, and it drops the spacing after that child too. So the right group goes from gapX + gap + spacing to gapX in one frame.

Fix

DockLayout.spreadGap bottoms out at one device pixel (one logical pixel without a scale) instead of 0. The Row keeps the gap item and its spacing, so the right group keeps moving the way it was. At rest nothing changes, except in a gap already narrower than one pixel.

Not in this PR

Once the growth is larger than the whole resting gap, the right group still runs past the card's right edge. Panel with Center or Right does the same near full width, where rowOffset stops at 0. Keeping it on the card would mean moving the row left during magnification. That would shift pointerX against the resting centres, and the wave would start chasing itself. I left it as is; it needs a row that nearly fills the screen.

Testing

  • tests/unit/layout.test.mjs: the floor in logical and device pixels, plus a sweep that pushes the left group through the moment the gap runs out. On the old code the sweep catches the 6 px jump; with the fix it passes.
  • CI-equivalent checks pass locally, including structure-check.py.
  • tests/live/layout.sh passes and the smoke test is clean.
  • Not checked by eye: getting a small resting gap needs a row that nearly fills 5120 px.

A Row skips a zero-width child together with the spacing after it. With a
small resting gap, magnification growth used the gap up, its width hit 0
and the right group jumped left by one row spacing before carrying on.
The gap now bottoms out at one device pixel (one logical pixel without a
scale), so the right group keeps moving the way it was.
priard added a commit to priard/omadock that referenced this pull request Oct 11, 2026
@thepathless
thepathless merged commit f9c0a19 into thepathless:experimental Oct 12, 2026
5 checks passed
@thepathless

Copy link
Copy Markdown
Owner

🎉 Thank you so much for this contribution, @priard! Really appreciate the care you put into it. ✨ Verified on experimental — static gates, unit suites (239 node + 116 python) and the full live dock battery all green, including the marks-centering suite — and merged. Your work is credited in the changelog. 🙏🚀

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