Skip to content

feat(input): add pointer-focus delay configuration - #130

Merged
qeude merged 2 commits into
mainfrom
t3/feat/focus-follow-delay
Oct 12, 2026
Merged

qeude merged 2 commits into
mainfrom
t3/feat/focus-follow-delay

Conversation

@qeude

@qeude qeude commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

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

View guided diff Turn on auto-fix

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.

- New config option focus_follows_mouse_delay_ms (0–1000 ms, default 50)
- Pointer must rest for configured delay before focus follows
- Applies only when focus_follows_mouse is enabled
- Add UI slider control and search target in settings
- Add validation and decoding tests
@greptile-apps

greptile-apps Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issue was found.

Summary

Adds a configurable pointer-focus delay, with a 50ms default and a 0–1000ms range.

  • Pointer focus waits for the configured pause in movement.

Reviews (2) · Last reviewed commit: "fix: address PR review feedback (#130)" · Reviewed by Greptile

Comment thread Sources/DefiDaemon/DaemonFocus.swift Outdated
@macroscopeapp

macroscopeapp Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds a user-facing pointer-focus delay and changes the existing focus-following path to wait 50 ms by default, with configuration persistence and settings UI spanning multiple runtime layers. Existing users who enabled pointer focus do not retain the previous immediate behavior automatically, so the change warrants human review.

You can add or adjust custom eligibility rules. Learn more.

Extract the pointer-focus rest delay into a testable helper and cover
zero delay, elapsed delay, and cancellation by newer motion.
@qeude
qeude merged commit a7cea29 into main Oct 12, 2026
5 checks passed
@qeude
qeude deleted the t3/feat/focus-follow-delay branch October 12, 2026 16:30
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