Skip to content

Fix issue with hover reappearing on Esc, Alt-tab, link click etc.#313117

Merged
pwang347 merged 3 commits intomainfrom
pawang/fixHover
Apr 29, 2026
Merged

Fix issue with hover reappearing on Esc, Alt-tab, link click etc.#313117
pwang347 merged 3 commits intomainfrom
pawang/fixHover

Conversation

@pwang347
Copy link
Copy Markdown
Member

@pwang347 pwang347 commented Apr 28, 2026

To reproduce:

  1. Click on the Copilot status bar item
  2. Press Esc
  3. Notice that the hover reappears momentarily
  4. If you now click the hover, it instantly disappears

Copilot AI review requested due to automatic review settings April 28, 2026 21:43
@pwang347 pwang347 requested a review from connor4312 April 28, 2026 21:44
@pwang347 pwang347 marked this pull request as ready for review April 28, 2026 21:45
@connor4312 connor4312 requested review from benibenj and removed request for connor4312 April 28, 2026 21:47
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 aims to prevent managed hovers from immediately reappearing after they were dismissed (e.g. via Esc, window deactivation/Alt-tab, clicking within the hover), by adding additional guards in the managed-hover focus handler and covering the behavior with new unit tests.

Changes:

  • Add focus-event guards in HoverService.setupManagedHover to avoid re-triggering a hover when focus returns from a dismissed hover or from window reactivation.
  • Add new HoverService tests asserting that dismissed hovers don’t re-show on subsequent focus events under specific relatedTarget conditions.
Show a summary per file
File Description
src/vs/platform/hover/browser/hoverService.ts Adds early-return conditions in the managed-hover onFocus handler to avoid re-showing hovers after dismissal/focus transitions.
src/vs/platform/hover/test/browser/hoverService.test.ts Adds regression tests for focus-driven hover reappearance after dismissal.

Copilot's findings

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

Comment thread src/vs/platform/hover/test/browser/hoverService.test.ts Outdated
Comment thread src/vs/platform/hover/browser/hoverService.ts Outdated
@pwang347 pwang347 removed the request for review from benibenj April 29, 2026 15:40
@pwang347 pwang347 enabled auto-merge (squash) April 29, 2026 15:40
@pwang347 pwang347 merged commit 83bc012 into main Apr 29, 2026
26 checks passed
@pwang347 pwang347 deleted the pawang/fixHover branch April 29, 2026 16:39
@vs-code-engineering vs-code-engineering Bot added this to the 1.119.0 milestone Apr 29, 2026
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