Skip to content

fix: let an off-screen detached glass drag back toward the viewport#97

Merged
ohxyz merged 3 commits into
mainfrom
fix/detached-glass-offscreen-move
Jun 25, 2026
Merged

fix: let an off-screen detached glass drag back toward the viewport#97
ohxyz merged 3 commits into
mainfrom
fix/detached-glass-offscreen-move

Conversation

@ohxyz

@ohxyz ohxyz commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

What

When a detached glass sat outside the viewport (e.g. after a browser resize), the first drag snapped it inside because the move bounds were clamped to the current viewport.

  • Track the last applied position and, via a new clampAxis helper, relax only the breached edge to it — an off-screen glass can move toward the viewport but never further out, and the normal viewport clamp re-engages once it's back inside.
  • A bulleted comment in move.js documents a known minor edge case: bounds are frozen per-grab, so a glass that showed a scrollbar reserves that width as it drags back until the next grab.

Docs

  • conventions.md: note the pattern of splitting long multi-concern comments into - bullets.
  • ARCHITECTURE.md: note the off-screen drag recovery in the move.js row.

ohxyz added 2 commits June 25, 2026 12:21
When a glass sat outside the viewport (e.g. after a browser resize),
the first drag snapped it inside because the bounds were clamped to the
current viewport. Track the last applied position and relax only the
breached edge to it, so an off-screen glass can move toward the viewport
but never further out, and re-engages the normal viewport clamp once back inside.
@ohxyz ohxyz requested a review from bhjsdev as a code owner June 25, 2026 02:24
@ohxyz ohxyz merged commit 21d48d5 into main Jun 25, 2026
@ohxyz ohxyz deleted the fix/detached-glass-offscreen-move branch June 25, 2026 02:43
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.

1 participant