fix desktop icon grid gap at right edge: stretch column pitch so right-anchored stacks sit flush

This commit is contained in:
Martin Dvořák 2026-09-24 07:34:48 +00:00
commit eecf8cf339
2 changed files with 56 additions and 20 deletions

View file

@ -121,9 +121,13 @@ with icons, it's almost certainly here.
`.win-icons-tr` / `.win-icons-br`). They are rendered **hidden** with class
`win-measure` purely so the grid can be measured from them.
- On mount (a `useLayoutEffect`), `measure()` reads the real rendered boxes of
those stacks: cell size = icon width/height **+ the CSS flex gap** (`GRID_GAP`,
currently 4px), and origin = the left stack's offset. From that it computes
`cols` / `rows` for the whole desktop.
those stacks: cell size = icon width/height, and origin = the left stack's
offset. The row pitch is cell height **+ the CSS flex gap** (`GRID_GAP`,
currently 4px). The column pitch starts at cell width + gap but is **stretched
a hair** so the grid spans from the left margin to the right margin — a fixed
pitch left up to a full cell of slack on the right, which pulled the
right-anchored services/friends stacks away from the border. From that it
computes `cols` / `rows` for the whole desktop.
- `defaultCells()` assigns each icon the cell its stack already occupies. So
**the grid you see on load is the grid dragging uses** — no re-layout jump.
- Icons are then rendered absolutely positioned in `.win-icon-layer`, driven by
@ -183,6 +187,11 @@ list reordering, not free placement. Don't confuse the two.
6. **Friend icons couldn't be dragged.** Native image drag on the
`next/image` glyph fired `pointercancel`. Fixed with `draggable={false}` +
`-webkit-user-drag: none`.
7. **Right-edge gap.** Columns tiled from the left with a fixed pitch, so the
right-anchored stacks (services/friends) stopped up to a full cell short of
the right border (e.g. ~90px on a 1920px screen), and any remount/resize
re-snapped them. Fixed by stretching the column pitch so the grid spans both
margins; the row pitch is unchanged.
---