feat(input): add pointer-focus delay configuration

Merged
QE
4d ago
+66-1

Summary

  • Add focus_follows_mouse_delay_ms configuration option (0–1000ms, default 50ms)
  • Delay applies only when focus_follows_mouse is enabled; 0ms focuses immediately
  • Implement delay via Task.sleep in DaemonFocus before hit test, allowing previous motion to cancel the sleep
  • Settings UI includes range slider (0–1000ms, step 10ms) with control disabled when focus-follows-pointer is off
  • Add validation to reject out-of-range values

Testing

  • Config decoding and validation for valid and out-of-range values tested
  • Settings UI slider appears and responds to focus_follows_mouse toggle
  • Delay behavior can be verified with pointer motion across managed windows
  • Verify no focus flicker or missed input while pointer is moving

[!NOTE]

Add configurable pointer-focus delay (input.focus_follows_mouse_delay_ms)

  • Adds a pointer-focus delay setting, defaulting to 50 ms with an accepted range of 0 to 1000, stored on InputConfig and validated in Config.validate in Config.swift
  • Daemon.handlePointerMotion now awaits the new pointerFocusRestDelayElapsed helper before hit testing. Each new motion cancels the prior pending wait; a zero delay skips waiting entirely. See DaemonFocus.swift
  • The macOS settings UI gains a numeric control for the delay, disabled when focus-following is off, plus a matching settings-search entry in SettingsSearch.swift
  • Documents the setting in CONFIGURATION.md and covers decoding, validation, wait duration, and cancellation in tests
  • Behavioral Change: pointer-motion focus now waits for the configured rest delay before applying focus; users who want immediate focus must set the delay to 0

Macroscope summarized 314c5cf.