Skip to content

chat: Anchor Add Context picker to its button - #338924

Merged
Megan Rogge (meganrogge) merged 6 commits into
mainfrom
merogge/anchor-attach-context-quick-pick
Sep 30, 2026
Merged

Megan Rogge (meganrogge) merged 6 commits into
mainfrom
merogge/anchor-attach-context-quick-pick

Conversation

@meganrogge

@meganrogge Megan Rogge (meganrogge) commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator
Screenshot 2026-09-30 at 12 49 34 PM Screenshot 2026-09-30 at 12 48 24 PM

Fixes #338928

Anchors Add Context to its invoking button across chat inputs:

  • The new-session composer prefers placement below the button.
  • Existing chat inputs prefer placement above the button.
  • Anchored quick inputs use standard spacing from their invoking control and fall back to the opposite side when the preferred side does not fit.
  • Activating the same Add Context button again closes its picker, including in the new-session composer.

Validation:

  • Targeted ESLint — passed
  • ./scripts/test.sh --run src/vs/platform/quickinput/test/browser/quickinput.test.ts --grep "positions an anchored picker below" — passed
  • ./scripts/test.sh --run src/vs/sessions/contrib/chat/test/browser/newChatInput.test.ts --grep "context picker" — passed
  • npm run typecheck-client — passed

Keep the existing centered quick pick for the classic composer layout while anchoring it to the attach button in the experimental layout.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 30, 2026 16:20

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 behavior is correctly scoped, preserves the classic layout, and has focused regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Anchors the Attach Context picker to its trigger in the experimental composer while preserving classic centered placement.

Changes:

  • Adds optional quick-pick anchoring.
  • Tracks the attach button as the anchor.
  • Tests both composer layouts.
File Description
newChatContextAttachments.ts Supports an optional picker anchor.
newChatInput.ts Anchors only in the experimental layout.
newChatInput.test.ts Covers anchored and centered modes.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Gate anchored Add Context pickers behind a shared experimental setting. New-session composers prefer below the button, while existing chat inputs prefer above it.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 0d30d69c Current: d805195a

Changed (1)

chat/aiCustomizations/aiCustomizationManagementEditor/DiscoverPluginsLoadingMore/Light
Before After
before after

2 insignificant change(s) omitted (≤20 px, Δ≤2). See CI logs for details.

@meganrogge Megan Rogge (meganrogge) changed the title sessions: Anchor attach context picker in new composer chat: Add experimental anchored context picker Sep 30, 2026
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

TylerLeonhardt

Matched files:

  • src/vs/platform/quickinput/browser/quickAccess.ts
  • src/vs/platform/quickinput/browser/quickInputController.ts
  • src/vs/platform/quickinput/common/quickAccess.ts
  • src/vs/platform/quickinput/common/quickInput.ts
  • src/vs/platform/quickinput/test/browser/quickinput.test.ts

@meganrogge Megan Rogge (meganrogge) added this to the 1.141.0 milestone Sep 30, 2026
@meganrogge Megan Rogge (meganrogge) changed the title chat: Add experimental anchored context picker anchor attached context picker to action vs default location Sep 30, 2026
Make Add Context placement consistent without an experimental setting and preserve dropdown semantics by closing the anchored picker when its button is activated again.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@meganrogge Megan Rogge (meganrogge) changed the title anchor attached context picker to action vs default location chat: Anchor Add Context picker to its button Sep 30, 2026
Keep the new-session picker alive through repeat button activation so the second click closes it, and add standard spacing between anchored quick inputs and their controls.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@meganrogge
Megan Rogge (meganrogge) merged commit 8e5aa1b into main Sep 30, 2026
75 of 77 checks passed
@meganrogge
Megan Rogge (meganrogge) deleted the merogge/anchor-attach-context-quick-pick branch September 30, 2026 19:02
@lppedd

Copy link
Copy Markdown

This makes using (and suggesting people to use) explicit context attachment 100% better. Thanks.

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.

Anchor Add Context picker to its chat input button

4 participants