Skip to content

improve question carousel submit button flow#298360

Merged
meganrogge merged 1 commit intomainfrom
merogge/question-submit
Feb 27, 2026
Merged

improve question carousel submit button flow#298360
meganrogge merged 1 commit intomainfrom
merogge/question-submit

Conversation

@meganrogge
Copy link
Copy Markdown
Collaborator

Fixes #292404

Kept > as navigation only and stopped it from becoming Submit on the last page.

  • Added a separate Submit button shown only on the last question.
  • Disabled > on the last question.
  • Updated CSS and tests to enforce this behavior.

Result: users can no longer accidentally submit by repeatedly clicking >; submission is explicit.

submit.mov

Copilot AI review requested due to automatic review settings February 27, 2026 21:51
@meganrogge meganrogge self-assigned this Feb 27, 2026
@meganrogge meganrogge added this to the March 2026 milestone Feb 27, 2026
@meganrogge meganrogge enabled auto-merge (squash) February 27, 2026 21:51
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

Adjusts the Chat Question Carousel navigation so the > button remains purely navigational and can’t become an implicit “Submit” action on the last question (addressing #292404).

Changes:

  • Added a dedicated Submit button that is only displayed/enabled on the last question.
  • Disabled the > (“Next”) navigation button on the last question while keeping its icon/label stable.
  • Updated carousel CSS and added/updated tests to validate the new behavior.

Reviewed changes

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

File Description
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.ts Adds a dedicated submit button and updates navigation/hover behavior for last-question handling.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css Styles the new submit button using primary button theming.
src/vs/workbench/contrib/chat/test/browser/widget/chatContentParts/chatQuestionCarouselPart.test.ts Updates navigation tests and adds coverage for presence/visibility of the submit button.

const nextButton = widget.domNode.querySelector('.chat-question-nav-next') as HTMLButtonElement;
assert.ok(nextButton, 'Next button should exist');
assert.strictEqual(nextButton.getAttribute('aria-label'), 'Submit', 'Next button should have Submit aria-label on last question');
assert.strictEqual(nextButton.getAttribute('aria-label'), 'Next', 'Next button should preserve Next aria-label on last question');
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

This assertion hard-codes the exact aria-label value as Next, but the implementation intentionally appends a keybinding when available via getLabelWithKeybinding(...). To avoid a brittle test (e.g., if a keybinding for the action ID is added later), assert that the label starts with/contains Next rather than strict equality.

Suggested change
assert.strictEqual(nextButton.getAttribute('aria-label'), 'Next', 'Next button should preserve Next aria-label on last question');
const nextAriaLabel = nextButton.getAttribute('aria-label');
assert.ok(nextAriaLabel && nextAriaLabel.startsWith('Next'), 'Next button aria-label should start with "Next" on last question');

Copilot uses AI. Check for mistakes.
background: var(--vscode-button-background) !important;
color: var(--vscode-button-foreground) !important;
width: auto;
height: 22px;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this react to chat font size?

@meganrogge meganrogge merged commit d59ed46 into main Feb 27, 2026
24 checks passed
@meganrogge meganrogge deleted the merogge/question-submit branch February 27, 2026 22:54
@meganrogge
Copy link
Copy Markdown
Collaborator Author

@copilot open a new pull request to apply changes based on the comments in this thread

@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Apr 13, 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.

Placement of confirm button for ask_questions tool overlaps with next page

3 participants