Sessions - clean-up some of the actions rendering code#306466
Sessions - clean-up some of the actions rendering code#306466
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors the Sessions “Changes” view toolbar button rendering logic (MenuWorkbenchButtonBar buttonConfigProvider) to simplify per-action configuration for Copilot CLI / PR-related actions.
Changes:
- Reorganizes and consolidates
buttonConfigProviderconditionals for several session toolbar actions. - Adds special handling for the “update PR” action label to include outgoing change count.
- Removes several previously hard-coded action-id cases from the rendering config.
| if ( | ||
| action.id === 'chatEditing.viewChanges' || | ||
| action.id === 'github.copilot.chat.openPullRequestCopilotCLIAgentSession.openPR' | ||
| ) { | ||
| return { showIcon: true, showLabel: false, isSecondary: true }; | ||
| } |
There was a problem hiding this comment.
MenuWorkbenchButtonBar only renders an icon when showIcon: true is returned by the buttonConfigProvider. By removing chatEditing.viewAllSessionChanges from the icon-only branch, the “View All Changes” action (contributed to MenuId.ChatEditingSessionChangesToolbar) will now render as label-only (and without its icon), which is a behavior change from the previous code and inconsistent with the similar config in chatInputPart.ts. Consider adding chatEditing.viewAllSessionChanges back to the icon-only set (or otherwise ensuring it returns showIcon: true/showLabel: false here).
No description provided.