Skip to content

fix: show Preview as icon in turn changes summary - #328582

Open
Akshat Anand (cipheraxat) wants to merge 7 commits into
microsoft:mainfrom
cipheraxat:fix/328520-turn-changes-preview-icon
Open

fix: show Preview as icon in turn changes summary#328582
Akshat Anand (cipheraxat) wants to merge 7 commits into
microsoft:mainfrom
cipheraxat:fix/328520-turn-changes-preview-icon

Conversation

@cipheraxat

@cipheraxat Akshat Anand (cipheraxat) commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The expanded turn-changes file list showed a blue Preview text link; #324929 intended a labelless/icon action but pushed { icon: false, label: true } with text-link CSS.
  • Render Codicon.openPreview as an icon-only row action (label kept for tooltip/aria) and style it like other toolbar icons.
  • Extracted createTurnChangesPreviewActions for unit coverage. Previewable files (markdown and HTML) get the icon; other rows stay actionless.

Fixes #328520

Test plan

  • Unit tests: chatTurnPills.test.ts — icon class, empty for non-previewable files, run opens via associations, HTML preview classification from main
  • Expand a turn’s changes list with a .md file → open-preview icon (not blue “Preview” text)
  • Hover shows tooltip “Preview”; click opens the file
  • Non-previewable rows (e.g. .ts) have no row action
  • Checkpoint / summary lists without row actions unchanged

Before / after screenshots are in #328582 (comment)

The per-row Preview control was shipped as a blue text link despite the
original labelless/icon intent. Render Codicon.openPreview via ActionBar
and style it as a toolbar icon.

Fixes microsoft#328520
Copilot AI review requested due to automatic review settings August 1, 2026 20:32

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.

Pull request overview

Fixes turn-change previews to display as icon-only actions while retaining accessible labels.

Changes:

  • Adds the openPreview icon and icon-only rendering.
  • Applies standard toolbar icon styling.
  • Adds unit and component-fixture coverage.

Reviewed changes

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

Show a summary per file
File Description
chatTurnPills.fixture.ts Updates fixture documentation.
chatTurnPills.test.ts Tests preview action creation and execution.
chat.css Styles preview actions as toolbar icons.
chatTurnPills.ts Extracts and creates icon-based preview actions.
chatTurnPillsPart.ts Uses the extracted action factory.
chatChangesSummaryPart.ts Renders row actions as icons without labels.

@julka45-pixel

julka45-pixel commented Aug 1, 2026 via email

Copy link
Copy Markdown

@benibenj

Copy link
Copy Markdown
Contributor

there are merge conflicts, can you resolve them. Also please provide a before and after screenshot

Resolve conflicts in chatTurnPillsPart imports, chat.css comment, and
chatTurnPills fixture naming after main's external-preview refactor.
Keep icon-only Preview row actions from this branch.
Requested on the PR review. Can drop these assets after merge.
@cipheraxat

Copy link
Copy Markdown
Contributor Author

Benjamin Christopher Simmonds (@benibenj) merge conflicts with main are resolved and pushed.

Before / after for the Preview control in the expanded turn-changes list:

Before

Blue Preview text link (from #328520):

before

After

Same row, Codicon.openPreview icon-only action (label kept for tooltip/aria):

after

Side-by-side: https://raw.githubusercontent.com/cipheraxat/vscode/9c7e88b02ac7ba83a9a7005bf97fc05f907ea85c/.github/pr-assets/328582/compare.png

Happy to drop the .github/pr-assets/328582/ screenshots after review if you'd rather not keep them in the tree.

…es-preview-icon

# Conflicts:
#	src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTurnPillsPart.ts
#	src/vs/workbench/contrib/chat/test/browser/widget/chatTurnPills.test.ts
Screenshots stay in the PR comment; they should not land in vscode.
@cipheraxat

Akshat Anand (cipheraxat) commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

Benjamin Christopher Simmonds (@benibenj) latest main conflicts are resolved again. Before/after screenshots are in the comment above: #328582 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Preview" link looks odd in turn changes summary

6 participants