Skip to content

Conversation

@tomkp
Copy link
Owner

@tomkp tomkp commented Dec 24, 2025

Summary

  • Fixed bug where splitter would lag behind cursor during drag operations
  • The RAF throttling was using stale event coordinates from the closure when RAF was first scheduled
  • Now stores the latest cursor position in a ref on every mouse/touch event
  • Added tests that verify the latest position is used when multiple move events fire before RAF

Test plan

  • Added failing tests that reproduce the bug (verify latest position used, not first)
  • All existing tests pass
  • npm run checks passes (typecheck, lint, format, test)

🤖 Generated with Claude Code

The RAF throttling was using stale event coordinates from the closure
when RAF was first scheduled, causing the splitter to always render
to where the cursor was ~16ms ago.

Now stores the latest cursor position in a ref on every mouse/touch
event, and uses that latest position when RAF fires.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@tomkp tomkp merged commit c71006a into master Dec 24, 2025
1 check passed
@tomkp tomkp deleted the fix/splitter-drag-lag branch December 24, 2025 09:14
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