Skip to content

nes: remove TopToBottom clipping strategy from RecentFileClippingStrategy#314689

Merged
ulugbekna merged 1 commit intomainfrom
ulugbekna/nes/remove-top-to-bottom-clipping-strategy
May 6, 2026
Merged

nes: remove TopToBottom clipping strategy from RecentFileClippingStrategy#314689
ulugbekna merged 1 commit intomainfrom
ulugbekna/nes/remove-top-to-bottom-clipping-strategy

Conversation

@ulugbekna
Copy link
Copy Markdown
Contributor

The default has been AroundEditRange for a while; TopToBottom was kept only for backwards-compat experimentation. This PR drops:

  • the TopToBottom enum value from RecentFileClippingStrategy (and from both validators)
  • the code paths in recentFilesForPrompt.ts that disabled focal ranges based on this strategy (historyEntryToCodeSnippet and buildCodeSnippetsGreedy are simplified — the latter no longer takes a clippingStrategy parameter and just falls back to top-of-file clipping when a file has no focal ranges)
  • the corresponding suite + comparison test in recentFilesForPrompt.snapshots.spec.ts
  • the strategy's section + comparison row in recentFilesForPrompt.md

Verification

  • tsc --noEmit passes for tsconfig.json, tsconfig.worker.json, and the simulation workbench tsconfig.json
  • vitest --run for recentFilesForPrompt.{spec,snapshots.spec}.ts — 52 / 52 tests pass
  • No remaining TopToBottom / topToBottom references in the copilot extension

…tegy

The default has been AroundEditRange for a while; TopToBottom was kept
only for backwards-compat experimentation. Drop the enum value, the code
path that disabled focal ranges based on it, and the corresponding tests
and docs section.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 6, 2026 10:20
@ulugbekna ulugbekna enabled auto-merge (squash) May 6, 2026 10:20
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Screenshot Changes

Base: 1d430127 Current: f3bed8a0

Changed (15)

chat/input/chatInput/Default/Dark
Before After
before after
chat/input/chatInput/Default/Light
Before After
before after
chat/input/chatInput/WithArtifacts/Light
Before After
before after
chat/input/chatInput/WithFileChanges/Dark
Before After
before after
chat/input/chatInput/WithFileChanges/Light
Before After
before after
chat/input/chatInput/WithTodos/Dark
Before After
before after
chat/input/chatInput/WithTodosAndFileChanges/Dark
Before After
before after
chat/input/chatInput/WithArtifactsAndFileChanges/Dark
Before After
before after
chat/input/chatInput/WithArtifactsAndFileChanges/Light
Before After
before after
chat/input/chatInput/Full/Light
Before After
before after
chat/widget/chatWidget/SimpleQA/Dark
Before After
before after
chat/widget/chatWidget/PendingToolApproval/Dark
Before After
before after
chat/widget/chatWidget/PendingToolApproval/Light
Before After
before after
chat/widget/chatWidget/MultiTurn/Light
Before After
before after
agentSessionsViewer/ApprovalRowLongLabel/Dark
Before After
before after

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 simplifies the NES/xtab “recently viewed files” clipping strategy surface by removing the legacy TopToBottom strategy and consolidating behavior around the remaining AroundEditRange and Proportional strategies.

Changes:

  • Removed TopToBottom from RecentFileClippingStrategy and updated validators accordingly.
  • Simplified recent-snippet construction by always deriving focal ranges for edit entries and by removing the clippingStrategy parameter from the greedy builder path.
  • Removed the TopToBottom snapshot coverage and updated the clipping-strategies specification doc to reflect only two strategies.
Show a summary per file
File Description
extensions/copilot/src/platform/inlineEdits/common/dataTypes/xtabPromptOptions.ts Removes TopToBottom enum value and updates validators to accept only remaining strategies.
extensions/copilot/src/extension/xtab/common/recentFilesForPrompt.ts Simplifies snippet creation/building by dropping TopToBottom branching and using focal ranges for edits unconditionally.
extensions/copilot/src/extension/xtab/test/common/recentFilesForPrompt.snapshots.spec.ts Removes snapshot suites that validated TopToBottom behavior.
extensions/copilot/src/extension/xtab/common/recentFilesForPrompt.md Updates spec to document only AroundEditRange and Proportional, and adjusts comparison table.

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 0

@ulugbekna ulugbekna merged commit 07f93b5 into main May 6, 2026
30 checks passed
@ulugbekna ulugbekna deleted the ulugbekna/nes/remove-top-to-bottom-clipping-strategy branch May 6, 2026 13:08
@vs-code-engineering vs-code-engineering Bot added this to the 1.120.0 milestone May 6, 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