Skip to content

Commit 298735c

Browse files
Kateryna ProkopenkoDevtools-frontend LUCI CQ
authored andcommitted
Add option to mark features experimental in soft menus
Bug: 414331596 Change-Id: I2f7b455b4ed26d6edf8650eac456d074a54d28da Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6822161 Reviewed-by: Kim-Anh Tran <[email protected]> Commit-Queue: Kateryna Prokopenko <[email protected]> Auto-Submit: Kateryna Prokopenko <[email protected]>
1 parent ff68321 commit 298735c

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

front_end/entrypoints/main/MainImpl.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ import * as ProjectSettings from '../../models/project_settings/project_settings
5555
import * as Workspace from '../../models/workspace/workspace.js';
5656
import * as Snippets from '../../panels/snippets/snippets.js';
5757
import * as Buttons from '../../ui/components/buttons/buttons.js';
58-
import * as IconButton from '../../ui/components/icon_button/icon_button.js';
5958
import * as Snackbar from '../../ui/components/snackbars/snackbars.js';
6059
import * as Components from '../../ui/legacy/components/utils/utils.js';
6160
import * as UI from '../../ui/legacy/legacy.js';
@@ -965,17 +964,9 @@ export class MainMenuItem implements UI.Toolbar.Provider {
965964
continue;
966965
}
967966

968-
if (viewExtension.isPreviewFeature()) {
969-
const additionalElement = IconButton.Icon.create('experiment');
970-
moreTools.defaultSection().appendItem(title, () => {
971-
void UI.ViewManager.ViewManager.instance().showView(id, true, false);
972-
}, {disabled: false, additionalElement, jslogContext: id});
973-
continue;
974-
}
975-
976967
moreTools.defaultSection().appendItem(title, () => {
977968
void UI.ViewManager.ViewManager.instance().showView(id, true, false);
978-
}, {jslogContext: id});
969+
}, {isPreviewFeature: viewExtension.isPreviewFeature(), jslogContext: id});
979970
}
980971

981972
const helpSubMenu = contextMenu.footerSection().appendSubMenuItem(i18nString(UIStrings.help), false, 'help');

front_end/ui/legacy/SoftContextMenu.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,11 @@ export class SoftContextMenu {
308308
}
309309
ARIAUtils.setLabel(menuItemElement, accessibleName);
310310

311+
if (item.isExperimentalFeature) {
312+
const experimentIcon = IconButton.Icon.create('experiment');
313+
menuItemElement.appendChild(experimentIcon);
314+
}
315+
311316
this.detailsForElementMap.set(menuItemElement, detailsForElement);
312317

313318
return menuItemElement;

0 commit comments

Comments
 (0)