Skip to content

Conversation

@justschen
Copy link
Collaborator

fix issue where the questions carousel was not skipping on reload.

also cleans up a lot of legacy css + css nesting for better specificity and readability

cc @karthiknadig

Copy link
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 fixes an issue where question carousels were not being properly skipped on reload, and modernizes the question carousel CSS using nesting for better organization and readability.

Changes:

  • Mark question carousels as used during chat session deserialization to prevent them from showing as interactive after reload
  • Consolidate question carousel CSS from chat.css into chatQuestionCarousel.css
  • Refactor CSS to use nesting, improving specificity control and readability

Reviewed changes

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

File Description
src/vs/workbench/contrib/chat/common/model/chatModel.ts Adds logic to mark question carousel parts as used during deserialization, preventing them from being interactive after reload
src/vs/workbench/contrib/chat/browser/widget/media/chat.css Removes legacy question carousel CSS that has been moved to the dedicated carousel CSS file
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css Consolidates all carousel CSS and reorganizes using CSS nesting for better maintainability and specificity control

background-color: var(--vscode-list-activeSelectionBackground);
color: var(--vscode-list-activeSelectionForeground);

.chat-question-label {
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in CSS class name: should be .chat-question-list-label instead of .chat-question-label. The actual class used in the HTML is chat-question-list-label (defined at line 150), not chat-question-label. This typo will prevent the color override from being applied to selected list items.

Suggested change
.chat-question-label {
.chat-question-list-label {

Copilot uses AI. Check for mistakes.
Comment on lines 2311 to 2319
// Mark any question carousels as used/skipped on reload since they can no longer be interacted with
const responseContent = raw.response ?? [new MarkdownString(raw.response)];
if (Array.isArray(responseContent)) {
for (const part of responseContent) {
if (part && 'kind' in part && part.kind === 'questionCarousel' && !part.isUsed) {
part.isUsed = true;
}
}
}
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new logic to mark question carousels as used during deserialization lacks test coverage. While this follows the same pattern as confirmation handling (line 1150 in chatModel.ts), it would be valuable to add a test that verifies questionCarousel parts are correctly marked as isUsed=true during deserialization to prevent them from showing as interactive after reload. This would ensure the fix remains robust as the code evolves.

Consider adding a test similar to the pattern in chatModel.test.ts that creates a serializable request with a questionCarousel response part, deserializes it, and asserts that the carousel's isUsed property is true.

Copilot uses AI. Check for mistakes.
@justschen justschen enabled auto-merge (squash) February 13, 2026 05:04
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.

1 participant