Skip to content

Watch git status updates#753

Merged
rabanspiegel merged 7 commits intomainfrom
perf/gitstatus-watch
Feb 5, 2026
Merged

Watch git status updates#753
rabanspiegel merged 7 commits intomainfrom
perf/gitstatus-watch

Conversation

@rabanspiegel
Copy link
Contributor

@rabanspiegel rabanspiegel commented Feb 4, 2026

Summary

  • add git status watchers (with polling fallback) and debounce broadcast
  • cache git status results in the renderer to avoid duplicate requests
  • skip background refresh while the document is hidden

Context

Clean extraction of the git status watcher/caching change from #740. Thanks @cschubiner.

Testing

  • not run

Note

Medium Risk
Introduces new filesystem watching + broadcast logic and changes how git status is refreshed/cached in the renderer, which could cause missed/extra refreshes or watcher leaks on some platforms.

Overview
Adds a main-process git status watcher (git:watch-status/git:unwatch-status) that uses recursive fs.watch (macOS/Windows only), debounces events, and broadcasts git:status-changed to all windows with basic error recovery.

Updates the renderer to consume these status-change events in useFileChanges and useTaskChanges, forcing refreshes when changes are detected while skipping background refresh when the document is hidden/unfocused. Introduces a 30s renderer-side getCachedGitStatus cache with in-flight de-duping to reduce repeated git:get-status IPC calls, and extends preload/global Electron API typings for the new watch/unwatch/event APIs.

Written by Cursor Bugbot for commit 67baefe. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Feb 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Feb 5, 2026 7:18am

Request Review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@rabanspiegel rabanspiegel merged commit bb0048a into main Feb 5, 2026
4 checks passed
aqeelat pushed a commit to aqeelat/emdash that referenced this pull request Feb 12, 2026
* Watch git status updates (generalaction#740)

* Fix git status watcher cleanup

* Harden git status watcher cleanup

* Fallback to polling without git status events

* Fix git status hook type errors

* Harden git status broadcast

* Fix forced git status refresh
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