-
Notifications
You must be signed in to change notification settings - Fork 37.6k
fix: display and navigation improvements #290684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Updates the Chat “question carousel” UI to improve its visual styling and navigation behavior, and introduces a post-submit “summary” view.
Changes:
- Restyles the question carousel to match chat request visuals (borders, padding, typography) and adds a summary layout.
- Moves navigation controls into the header and adds a close/skip control.
- Switches freeform inputs from
InputBoxto a styled<textarea>and adds answer-summary rendering logic.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css | Updates carousel layout/styling and adds new styles for header navigation, summary view, and freeform textarea. |
| src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.ts | Refactors carousel rendering (header navigation), adds summary rendering after submit/skip, and replaces freeform InputBox with <textarea>. |
Comments suppressed due to low confidence (2)
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.ts:238
ignore()no longer checkscarousel.allowSkip, so callers can bypass a non-skippable carousel. Restore the!this.carousel.allowSkipguard (or introduce a separate capability flag if “dismiss without answers” should be allowed independently).
public ignore(): boolean {
if (this._isSkipped) {
return false;
}
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.ts:479
- The freeform
<textarea>is not associated with the visible label, so screen readers won’t announce its purpose. Addaria-labelledbypointing to the label (give the label anid) or set an explicitaria-label(localized).
const freeformContainer = dom.$('.chat-question-freeform');
const freeformLabel = dom.$('.chat-question-freeform-label');
freeformLabel.textContent = localize('chat.questionCarousel.orEnterOwn', 'Or enter your own:');
freeformContainer.appendChild(freeformLabel);
const freeformTextarea = dom.$<HTMLTextAreaElement>('textarea.chat-question-freeform-textarea');
freeformTextarea.placeholder = localize('chat.questionCarousel.enterCustomAnswer', 'Enter custom answer');
freeformTextarea.rows = 1;
if (previousFreeform !== undefined) {
freeformTextarea.value = previousFreeform;
}
freeformContainer.appendChild(freeformTextarea);
container.appendChild(freeformContainer);
this._freeformTextareas.set(question.id, freeformTextarea);
}
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.ts
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.ts
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.ts
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.ts:497
- The new freeform
<textarea>has only a placeholder and a separate non-<label>element, so it has no programmatic label. Consider using a<label for>+id, or setaria-label/aria-labelledbyon the textarea to match the “Or enter your own:” text.
const freeformContainer = dom.$('.chat-question-freeform');
const freeformLabel = dom.$('.chat-question-freeform-label');
freeformLabel.textContent = localize('chat.questionCarousel.orEnterOwn', 'Or enter your own:');
freeformContainer.appendChild(freeformLabel);
const freeformTextarea = dom.$<HTMLTextAreaElement>('textarea.chat-question-freeform-textarea');
freeformTextarea.placeholder = localize('chat.questionCarousel.enterCustomAnswer', 'Enter custom answer');
freeformTextarea.rows = 1;
if (previousFreeform !== undefined) {
freeformTextarea.value = previousFreeform;
}
freeformContainer.appendChild(freeformTextarea);
container.appendChild(freeformContainer);
this._freeformTextareas.set(question.id, freeformTextarea);
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.ts
Outdated
Show resolved
Hide resolved
...workbench/contrib/chat/test/browser/widget/chatContentParts/chatQuestionCarouselPart.test.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.ts
Show resolved
Hide resolved
cf5b90d to
64ae25f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (2)
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.ts:91
_titlePartis declared asChatQueryTitlePart | undefined, but it’s used here without a null-check. WithstrictTS settings this will fail to compile (Object is possibly 'undefined'). Consider using a local const for the created part, or switch these fields to definite assignment (private _titlePart!: ...) since the constructor returns early in theisUsedcase.
this._register(this._titlePart.onDidChangeHeight(() => this._onDidChangeHeight.fire()));
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.ts:129
_prevButton/_nextButtonare typed asButton | undefinedbut are used directly here. This will fail understrictNullChecks. Use local variables when wiring listeners (then assign to the fields), or make these fields definite-assigned (e.g.private _prevButton!: Button) and rely on the early-return for the summary-only path.
this._register(this._prevButton.onDidClick(() => this.navigate(-1)));
this._register(this._nextButton.onDidClick(() => this.handleNext()));
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.ts
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.ts:259
hideAndShowSummary()andignore()duplicate the same “clear interactive state” logic (clearing_inputBoxes/maps, clearing the DOM, firing height change). Extracting a shared helper (e.g.clearInteractiveUI()+showSummary()/showSkippedMessage()) would reduce the chance of these paths drifting over time.
// Dispose interactive UI disposables before clearing DOM
this._inputBoxes.clear();
this._textInputBoxes.clear();
this._radioInputs.clear();
this._checkboxInputs.clear();
this._freeformTextareas.clear();
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.ts
Outdated
Show resolved
Hide resolved
...workbench/contrib/chat/test/browser/widget/chatContentParts/chatQuestionCarouselPart.test.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css
Outdated
Show resolved
Hide resolved
justschen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.

fixes #290784
fixes #290807
fixes #290808