Skip to content

Close the promo hover when Try is clicked - #337839

Merged
Logan Ramos (lramos15) merged 1 commit into
microsoft:mainfrom
rfeltis:rfeltis-promo-try-closes-hover
Sep 25, 2026
Merged

Logan Ramos (lramos15) merged 1 commit into
microsoft:mainfrom
rfeltis:rfeltis-promo-try-closes-hover

Conversation

@rfeltis

@rfeltis Ralph Feltis (rfeltis) commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #331588.

Problem

When a user clicks the Copilot status entry, the closed-chat promo tooltip is pinned. Clicking Try <model> in that tooltip leaves the hover open, and it switches to the Copilot usage dashboard.

Here's why: the Try command opens Chat synchronously. This withdraws the offer, so ChatStatusBarEntry swaps the tooltip back to the dashboard. The status bar item then calls hover.update(...), and the pinned managed hover re-renders in place with the new content, keeping its focus, before the hover action gets a chance to dispose it.

Fix

In ChatStatusPromo, the _chat.tryPromoModel command now calls hoverService.hideHover(true) before it opens Chat.

Testing

  • New regression test in chatStatusPromo.test.ts: "Try closes the pinned offer instead of swapping in the dashboard". It drives a real StatusbarEntryItem and HoverService: it pins the offer, clicks Try, and asserts that no hover remains.
    • It fails without the fix (the hover shows Dashboard) and passes with it. All 37 tests in the file pass.
  • npm run typecheck-client is clean.
  • I checked it manually in Code OSS with a GPT-5.5 sale fixture. After clicking Try, no hover is left and Chat opens.

Proof

Both clips use Code OSS with a GPT-5.5 sale fixture and the copilotIconPopup treatment, with Chat collapsed. The mouse moves to the status bar pip, clicks it to pin the offer, then clicks Try GPT-5.5.

Before (a6e06b5, main): Chat opens, but the pinned hover stays open and switches to the Copilot dashboard.

try-before-hover-shows-dashboard.mp4

After (1c1477e, this PR): the hover closes and Chat opens with the input focused.

try-after-hover-closes.mp4

Clicking Try in the closed-chat promo tooltip opened Chat, which withdrew
the offer and re-rendered the still-pinned hover with the Copilot dashboard.
Hide the hover before opening Chat, and add a regression test.

Co-authored-by: Copilot App <[email protected]>
Copilot AI balanced review requested due to automatic review settings September 24, 2026 22:45

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 review overview

🟢 Approval recommended

The targeted fix correctly addresses the synchronous hover update and is covered by a representative regression test.

Review effort: Balanced
Findings: None

What changed in this PR

Ensures the Copilot promotional hover closes before Chat opens, preventing it from changing into the usage dashboard.

Changes:

  • Dismisses the pinned hover before executing the promo action.
  • Adds an end-to-end browser regression test for the interaction.
File Description
chatStatusPromo.ts Closes the promo hover before opening Chat.
chatStatusPromo.test.ts Verifies the pinned offer disappears after clicking Try.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@lramos15
Logan Ramos (lramos15) merged commit df6e681 into microsoft:main Sep 25, 2026
35 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.140.0 milestone Sep 25, 2026
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Nov 9, 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.

5 participants