Display model name in subagent session#323158
Open
sukumarp2022 wants to merge 8 commits into
Open
Conversation
Renders the subagent model name (e.g. GPT-4o) inline in the collapsible title, both while active and after completion, updating dynamically when the model is reported. Includes the model name in the collapse button aria-label by making updateAriaLabel protected and overriding it in the subagent part. Adds a dedicated CSS class and tests.
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request improves the chat subagent content part UI by rendering the subagent’s model name inline in the collapsed title and incorporating it into the collapse button’s accessible label. It also updates the collapsible base part to allow subclasses to customize aria-label generation.
Changes:
- Add an inline model-name label element to
ChatSubagentContentPart’s collapsed title and refresh it when model metadata arrives. - Override aria-label generation in
ChatSubagentContentPartto include the model name for screen readers; makeChatCollapsibleContentPart.updateAriaLabelprotectedto enable this. - Add targeted unit tests and styling for the new inline model label.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/test/browser/widget/chatContentParts/chatSubagentContentPart.test.ts | Adds tests validating model label rendering and aria-label inclusion across states/updates. |
| src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatSubagentContent.css | Adds styling for the inline model label in the subagent collapsed title. |
| src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.ts | Implements inline model label + aria-label override and triggers title refresh on model updates. |
| src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.ts | Makes updateAriaLabel protected so subclasses can override accessible labeling behavior. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Low
Addresses review feedback: the base class re-applies its captured initial title to the aria-label on expand/collapse. Derive the base label from the rendered title text (excluding the inline model label) so the accessible name always matches the visible title. Adds a regression test.
…bust aria test - updateModelLabel only re-appends the span when it is not already the last child, avoiding unnecessary DOM moves during frequent title updates.\n- The no-model aria-label test now asserts the aria-label equals the rendered title text instead of matching the English word 'model'.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #321923
This pull request improves the Chat subagent UI by displaying the model name used by a subagent inline in the title and ensuring it is included in accessibility labels. It also adds tests to verify this behavior and introduces a dedicated CSS class for consistent styling of the model label.
UI improvements
Accessibility improvements
aria-labelfor the collapse button so screen readers announce the model being used. Aria-label generation is centralized and updated whenever the title changes.Code structure
ChatCollapsibleContentPart.updateAriaLabelis nowprotectedto allow overriding, and is overridden inChatSubagentContentPartto centralize aria-label generation.Testing