Skip to content

Commit 9d3144b

Browse files
sandy081Copilot
andauthored
actionWidget: fix submenu group label rendered as item description (#306327) (#306337)
The submenu header (e.g. 'Thinking effort') was incorrectly shown as the description of the first action item instead of as a proper section header. Regression from f6218ec which replaced ActionListItemKind.Header items with inline description on the first child action. Restore proper Header rendering for SubmenuAction groups that have a label. For the sessions workspace picker, move the provider label to the first child action's tooltip so it renders as a description instead of a header. Fixes #306250 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent ee6bfc5 commit 9d3144b

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

src/vs/platform/actionWidget/browser/actionList.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1243,13 +1243,20 @@ export class ActionListWidget<T> extends Disposable {
12431243
const groupsWithActions = submenuGroups.filter(g => g.actions.length > 0);
12441244
for (let gi = 0; gi < groupsWithActions.length; gi++) {
12451245
const group = groupsWithActions[gi];
1246+
if (group.label) {
1247+
submenuItems.push({
1248+
kind: ActionListItemKind.Header,
1249+
group: { title: group.label },
1250+
label: group.label,
1251+
});
1252+
}
12461253
for (let ci = 0; ci < group.actions.length; ci++) {
12471254
const child = group.actions[ci];
12481255
submenuItems.push({
12491256
item: child,
12501257
kind: ActionListItemKind.Action,
12511258
label: child.label,
1252-
description: ci === 0 && group.label ? group.label : (child.tooltip || undefined),
1259+
description: child.tooltip || undefined,
12531260
group: { title: '', icon: ThemeIcon.fromId(child.checked ? Codicon.check.id : Codicon.blank.id) },
12541261
hideIcon: false,
12551262
hover: {},

src/vs/sessions/contrib/chat/browser/sessionWorkspacePicker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,11 @@ export class WorkspacePicker extends Disposable {
343343
const submenuActions = [...providerMap.values()].map(({ provider, actions }) =>
344344
new SubmenuAction(
345345
`workspacePicker.browse.${provider.id}`,
346-
provider.label,
347-
actions.map(({ action, index }) => toAction({
346+
'',
347+
actions.map(({ action, index }, ci) => toAction({
348348
id: `workspacePicker.browse.${index}`,
349349
label: localize(`workspacePicker.browse`, "{0}...", action.label),
350-
tooltip: '',
350+
tooltip: ci === 0 ? provider.label : '',
351351
run: () => this._executeBrowseAction(index),
352352
})),
353353
)

0 commit comments

Comments
 (0)