Skip to content

chat: remove fragile timeout in revealSessionIfAlreadyOpen#289232

Merged
connor4312 merged 1 commit intomainfrom
connor4312/279738
Jan 20, 2026
Merged

chat: remove fragile timeout in revealSessionIfAlreadyOpen#289232
connor4312 merged 1 commit intomainfrom
connor4312/279738

Conversation

@connor4312
Copy link
Copy Markdown
Member

Removes the 500ms timeout fallback that was a hack to wait for focus
transfer to auxiliary windows. Instead, only waits for focus transfer when
preserveFocus is false, since preserveFocus: true means the window won't
get focus and the layout service won't fire onDidChangeActiveContainer.

  • Remove unused raceCancellablePromises import
  • Add preserveFocus check to avoid waiting when focus won't transfer
  • Remove timeout(500) that could cause UI to appear in wrong location

Fixes #279738

(Commit message generated by Copilot)

Removes the 500ms timeout fallback that was a hack to wait for focus
transfer to auxiliary windows. Instead, only waits for focus transfer when
preserveFocus is false, since preserveFocus: true means the window won't
get focus and the layout service won't fire onDidChangeActiveContainer.

- Remove unused raceCancellablePromises import
- Add preserveFocus check to avoid waiting when focus won't transfer
- Remove timeout(500) that could cause UI to appear in wrong location

Fixes #279738

(Commit message generated by Copilot)
Copilot AI review requested due to automatic review settings January 20, 2026 22:38
@connor4312 connor4312 enabled auto-merge (squash) January 20, 2026 22:38
@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 20, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 removes a fragile 500ms timeout fallback in the chat widget service that was used to wait for focus transfer to auxiliary windows. The fix adds a preserveFocus check to avoid waiting for focus transfer when it won't occur.

Changes:

  • Removes unused raceCancellablePromises import
  • Adds preserveFocus check to the condition that determines when to wait for focus transfer
  • Removes the timeout(500) race condition that could cause UI to appear in the wrong location

@connor4312 connor4312 merged commit f42b4b1 into main Jan 20, 2026
27 of 28 checks passed
@connor4312 connor4312 deleted the connor4312/279738 branch January 20, 2026 22:58
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Mar 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chat: concerning timeout of 500 when revealSessionIfAlreadyOpen

3 participants