Skip to content

Move characters up when auto-hidden dock appears#5

Open
devpras22 wants to merge 4 commits intoryanstephen:mainfrom
devpras22:fix/autohide-dock-tracking
Open

Move characters up when auto-hidden dock appears#5
devpras22 wants to merge 4 commits intoryanstephen:mainfrom
devpras22:fix/autohide-dock-tracking

Conversation

@devpras22
Copy link
Copy Markdown

Summary

  • Tracks mouse position via NSEvent.mouseLocation to detect when the auto-hidden dock trigger zone is active
  • Smoothly animates characters up/down with exponential interpolation (factor 0.12)
  • Dock height estimated from user's tilesize preference (tileSize + 22), works across all screen sizes
  • Falls back to normal behavior when dock is always visible or on screens without dock

Test plan

  • Enable dock auto-hide, verify characters sit at screen bottom
  • Hover dock area, verify characters glide up and sit on top of dock
  • Move cursor away, verify characters glide back down
  • Disable auto-hide, verify characters sit on dock as before
  • Test on external monitor

🤖 Generated with Claude Code

- Accumulate streaming text in ClaudeSession.currentResponseText and
  commit to history on turn complete, so messages persist when switching
  between agents
- Queue messages sent before CLI process is ready via pendingMessages,
  flushed once the process launches
- Add safe pipe writes with do/catch to prevent crashes if Claude
  process dies mid-communication
- Remove duplicate currentStreamingText accumulation from WalkerCharacter
Save selected theme name to UserDefaults on switch and restore it
on launch instead of always defaulting to Peach.
Track mouse position via NSEvent.mouseLocation. When cursor enters
the dock trigger zone (within 5px of screen bottom), smoothly
animate characters up by the estimated dock height (tileSize + 22).
When cursor moves away, characters glide back down.
@devpras22 devpras22 force-pushed the fix/autohide-dock-tracking branch from dc7827e to 591ba50 Compare March 25, 2026 17:16
@ryanstephen
Copy link
Copy Markdown
Owner

Hi, mouse tracking at 60fps is a dealbreaker. NSEvent.mouseLocation is polled every frame in tick() when dock auto-hide is active. Even though the position isn't stored or transmitted, continuously reading cursor coordinates feels wrong. Is there another approach for this?

Use NSEvent global + local mouse-moved monitors instead of polling
NSEvent.mouseLocation every frame. The monitors only fire when the
cursor actually moves, eliminating continuous reads while maintaining
the same smooth character animation when the dock appears.
@devpras22
Copy link
Copy Markdown
Author

Good point. I've redone it using NSEvent.addGlobalMonitorForEvents(matching: .mouseMoved) instead of polling. The monitors only fire when the cursor actually moves, so there's zero CPU cost when the mouse is still. PR here

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