Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 28, 2026

When inlineChat.affordance: gutter is enabled, clicking the affordance displayed in sticky scroll shows the widget out of frame since the actual cursor line may be outside the viewport.

Changes:

  • Call revealLineInCenterIfOutsideViewport in InlineChatAffordance before showing the InlineChatInputWidget
  • Uses ScrollType.Immediate to avoid animation delay before menu appears
  • Placed in central location to handle all cases: gutter affordance, editor affordance, and direct showMenuAtSelection() calls

This follows the existing pattern used in sticky scroll controller, rename widget, and comments controller.

Original prompt

This section details on the original issue you should resolve

<issue_title>Inline gutter affordance behaves weird with sticky scroll</issue_title>
<issue_description>Testing #290465

when inlineChat.affordance : gutter the inline chat affordance shows in sticky scroll at the top. If I click it, the widget shows out of frame and then once exited it is removed from the gutter.

https://github.com/user-attachments/assets/80427026-6ab4-4fcb-871d-ce0be167a603</issue_description>

<agent_instructions>Code pointer: _doShowHover inside src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.ts. Make sure to reveal the selection when it is outside the viewport (before showing the menu)</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@jrieken > once exited it is removed from the gutter.

That part is tracked here: #291036


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…m sticky scroll

Co-authored-by: jrieken <1794099+jrieken@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix inline chat affordance behavior with sticky scroll Fix inline chat gutter affordance with sticky scroll Jan 28, 2026
Copilot AI requested a review from jrieken January 28, 2026 18:09
@jrieken
Copy link
Member

jrieken commented Jan 29, 2026

@copilot This is good but actually misses the case when the InlineChatInputWidget is show directly. So maybe the rvealing of the range/line should be somewhere else

Co-authored-by: jrieken <1794099+jrieken@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 29, 2026

@copilot This is good but actually misses the case when the InlineChatInputWidget is show directly. So maybe the rvealing of the range/line should be somewhere else

Moved the reveal call to InlineChatAffordance where _menuData is consumed. This handles all cases (gutter affordance, editor affordance, and direct showMenuAtSelection calls) from a single location. Fixed in 31a1602.

@jrieken jrieken marked this pull request as ready for review January 29, 2026 09:14
Copilot AI review requested due to automatic review settings January 29, 2026 09:14
@jrieken jrieken enabled auto-merge (squash) January 29, 2026 09:14
@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 29, 2026
Copy link
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 fixes an issue where clicking the inline chat gutter affordance in sticky scroll would show the widget out of frame, as the actual cursor line could be outside the viewport.

Changes:

  • Added a call to revealLineInCenterIfOutsideViewport with ScrollType.Immediate before showing the inline chat input widget to ensure the target line is visible when the affordance is triggered from sticky scroll or other contexts where the line may be outside the viewport

@jrieken jrieken merged commit f7e2101 into main Jan 29, 2026
27 of 28 checks passed
@jrieken jrieken deleted the copilot/fix-inline-chat-affordance branch January 29, 2026 09:48
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.

Inline gutter affordance behaves weird with sticky scroll

3 participants