Skip to content

Respect minimum hidden line count in diff editor - #336765

Open
victor-paltz wants to merge 1 commit into
microsoft:mainfrom
victor-paltz:fix/336762-minimum-hidden-lines
Open

victor-paltz wants to merge 1 commit into
microsoft:mainfrom
victor-paltz:fix/336762-minimum-hidden-lines

Conversation

@victor-paltz

@victor-paltz victor-paltz commented Sep 18, 2026

Copy link
Copy Markdown

This makes diffEditor.hideUnchangedRegions.minimumLineCount continue to apply while an unchanged region is partially revealed. When the remaining hidden lines would fall below the configured minimum, the rest of the region is revealed instead of rendering a tiny placeholder.

The change also routes drag updates through the same invariant and clarifies the setting description.

Fixes #336762

Testing:

  • scripts/test.sh --runGlob '**/diffEditorWidget.test.js'
  • npm run typecheck-client
  • ESLint on the changed files

Copilot AI balanced review requested due to automatic review settings September 18, 2026 12:51
@victor-paltz

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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.

🟢 Approval recommended

The focused implementation consistently preserves the invariant and includes appropriate regression coverage.

Pull request overview

Ensures partially revealed diff regions never leave placeholders smaller than the configured minimum.

Changes:

  • Centralizes hidden-line threshold enforcement.
  • Applies the invariant to drag interactions.
  • Clarifies configuration text and adds regression tests.
File summaries
File Description
diffEditorViewModel.ts Enforces minimum hidden-line counts.
hideUnchangedRegionsFeature.ts Routes drag updates through validated setters.
editorConfigurationSchema.ts Clarifies the setting description.
diffEditorWidget.test.ts Tests threshold behavior from both directions.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Balanced

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

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.

Add configurable minimum hidden-line threshold for fold placeholders

3 participants