Skip to content

chat: enhance compare block diff actions and accessibility#292005

Merged
connor4312 merged 1 commit intomainfrom
connor4312/287816
Jan 31, 2026
Merged

chat: enhance compare block diff actions and accessibility#292005
connor4312 merged 1 commit intomainfrom
connor4312/287816

Conversation

@connor4312
Copy link
Copy Markdown
Member

Adds improved diff editing workflow and accessibility features to chat
compare blocks:

  • Add toggle inline/side-by-side diff view mode action with icon
  • Add open in diff editor action for full editor view
  • Fix isCodeCompareBlockActionContext to properly check diffEditor property
  • Add readOnly context key checks to prevent editing read-only diffs
  • Adjust menu order for accept/discard actions (10, 11) and diff toggle (1)
  • Add toggleDiffViewMode callback to action context
  • Improve screen reader accessibility for compare block toolbar
  • Add width tracking to layout method for proper initialization
  • Refactor CSS for compare block header with nested selectors for better
    label truncation and styling

Fixes #287816

(Commit message generated by Copilot)

Adds improved diff editing workflow and accessibility features to chat
compare blocks:

- Add toggle inline/side-by-side diff view mode action with icon
- Add open in diff editor action for full editor view
- Fix isCodeCompareBlockActionContext to properly check diffEditor property
- Add readOnly context key checks to prevent editing read-only diffs
- Adjust menu order for accept/discard actions (10, 11) and diff toggle (1)
- Add toggleDiffViewMode callback to action context
- Improve screen reader accessibility for compare block toolbar
- Add width tracking to layout method for proper initialization
- Refactor CSS for compare block header with nested selectors for better
  label truncation and styling

Fixes #287816

(Commit message generated by Copilot)
Copilot AI review requested due to automatic review settings January 31, 2026 00:59
@connor4312 connor4312 enabled auto-merge (squash) January 31, 2026 00:59
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Jan 31, 2026
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 enhances the diff editing workflow and accessibility features for chat compare blocks to address issue #287816, where widening the chat panel made diff content harder to see.

Changes:

  • Adds toggle action to switch between inline and side-by-side diff view modes with proper icon toggling
  • Adds action to open compare blocks in a full diff editor
  • Improves screen reader accessibility by always showing the toolbar with proper aria-labels
  • Refactors CSS using nested selectors for better label truncation handling to prevent overflow issues

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
codeBlockPart.css Refactors CSS to use nesting and adds flexbox layout for proper label truncation with ellipsis
codeBlockPart.ts Adds toggleDiffViewMode callback, width tracking for layout, and screen reader toolbar configuration
chatCodeblockActions.ts Fixes type guard, adds toggle diff view and open in editor actions, adds readOnly preconditions to prevent editing read-only diffs

@connor4312 connor4312 merged commit 9c2578b into main Jan 31, 2026
27 of 28 checks passed
@connor4312 connor4312 deleted the connor4312/287816 branch January 31, 2026 01:18
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Mar 17, 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.

widening the chat to see sensitive file changes makes it harder to see

3 participants