Skip to content

Do not poll when window is not focused#8778

Merged
alexr00 merged 3 commits into
mainfrom
alexr00/xenial-silkworm
Jun 10, 2026
Merged

Do not poll when window is not focused#8778
alexr00 merged 3 commits into
mainfrom
alexr00/xenial-silkworm

Conversation

@alexr00

@alexr00 alexr00 commented Jun 9, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings June 9, 2026 09:52
@alexr00 alexr00 self-assigned this Jun 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates ReviewManager’s background polling behavior so that state polling is skipped while the VS Code window is not focused, and resumes when focus returns—reducing unnecessary background activity when the user isn’t actively using the window.

Changes:

  • Registers a vscode.window.onDidChangeWindowState listener to trigger an immediate poll when focus returns and polling had been paused.
  • Refactors the polling implementation by splitting the timer scheduling (pollForStateChange) from the actual poll work (doPoll).
  • Adds a focused-window check to prevent polling work from running while unfocused.
Show a summary per file
File Description
src/view/reviewManager.ts Pauses polling while unfocused and resumes polling on focus regain; refactors polling into a dedicated doPoll() path.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Comment thread src/view/reviewManager.ts
Copilot AI review requested due to automatic review settings June 9, 2026 10:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 2

Comment thread src/view/reviewManager.ts
Comment thread src/view/reviewManager.ts
@alexr00 alexr00 merged commit b6c5567 into main Jun 10, 2026
7 checks passed
@alexr00 alexr00 deleted the alexr00/xenial-silkworm branch June 10, 2026 09:18
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.

3 participants