Skip to content

Commit bafe6ca

Browse files
wolfibDevtools-frontend LUCI CQ
authored andcommitted
Move "Ask AI" context menu item to the bottom of the context menu
For DevTools development (=when using --custom-devtools-frontend), the Chromium backend appends "Inspect" even after "Ask AI". Otherwise "Ask AI" is now the last menu item. Fixed: 380244719 Change-Id: I37ae738351b3bbfdbf66c4611bfe5361ebe0f402 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6219149 Reviewed-by: Alex Rudenko <[email protected]> Commit-Queue: Alex Rudenko <[email protected]>
1 parent 5c8da33 commit bafe6ca

File tree

6 files changed

+13
-7
lines changed

6 files changed

+13
-7
lines changed

front_end/panels/elements/ElementsTreeElement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
806806
let menuItem;
807807

808808
if (UI.ActionRegistry.ActionRegistry.instance().hasAction('freestyler.element-panel-context')) {
809-
contextMenu.headerSection().appendAction(
809+
contextMenu.footerSection().appendAction(
810810
'freestyler.element-panel-context',
811811
);
812812
}

front_end/panels/network/NetworkLogView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1727,7 +1727,7 @@ export class NetworkLogView extends Common.ObjectWrapper.eventMixin<EventTypes,
17271727
if (request) {
17281728
if (UI.ActionRegistry.ActionRegistry.instance().hasAction('drjones.network-panel-context')) {
17291729
UI.Context.Context.instance().setFlavor(SDK.NetworkRequest.NetworkRequest, request);
1730-
contextMenu.headerSection().appendAction(
1730+
contextMenu.footerSection().appendAction(
17311731
'drjones.network-panel-context',
17321732
);
17331733
}

front_end/panels/sources/SourcesPanel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ export class SourcesPanel extends UI.Panel.Panel implements
961961
const editorElement = this.element.querySelector('devtools-text-editor');
962962
if (!eventTarget.isSelfOrDescendant(editorElement) && uiSourceCode.contentType().isTextType()) {
963963
UI.Context.Context.instance().setFlavor(Workspace.UISourceCode.UISourceCode, uiSourceCode);
964-
contextMenu.headerSection().appendAction(
964+
contextMenu.footerSection().appendAction(
965965
'drjones.sources-panel-context',
966966
);
967967
}

front_end/panels/timeline/TimelineFlameChartDataProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ export class TimelineFlameChartDataProvider extends Common.ObjectWrapper.ObjectW
231231
const aiCallTree = Utils.AICallTree.AICallTree.from(entry, this.parsedTrace);
232232
if (aiCallTree) {
233233
const action = UI.ActionRegistry.ActionRegistry.instance().getAction(PERF_AI_ACTION_ID);
234-
contextMenu.headerSection().appendItem(action.title(), () => {
234+
contextMenu.footerSection().appendItem(action.title(), () => {
235235
const event = this.eventByIndex(entryIndex);
236236
if (!event || !this.parsedTrace) {
237237
return;

front_end/ui/legacy/ContextMenu.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,10 @@ export class SubMenu extends Item {
334334
return this.section('save');
335335
}
336336

337+
annotationSection(): Section {
338+
return this.section('annotation');
339+
}
340+
337341
footerSection(): Section {
338342
return this.section('footer');
339343
}
@@ -687,8 +691,10 @@ export class ContextMenu extends SubMenu {
687691

688692
private static pendingMenu: ContextMenu|null = null;
689693
private static useSoftMenu = false;
690-
static readonly groupWeights =
691-
['header', 'new', 'reveal', 'edit', 'clipboard', 'debug', 'view', 'default', 'override', 'save', 'footer'];
694+
static readonly groupWeights = [
695+
'header', 'new', 'reveal', 'edit', 'clipboard', 'debug', 'view', 'default', 'override', 'save', 'annotation',
696+
'footer'
697+
];
692698
}
693699

694700
export interface Provider<T> {

front_end/ui/legacy/components/perf_ui/FlameChart.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,7 @@ export class FlameChart extends Common.ObjectWrapper.eventMixin<EventTypes, type
14431443
new UI.ContextMenu.ContextMenu(event);
14441444

14451445
// Generate context menu entries for annotations.
1446-
const annotationSection = this.contextMenu.section('annotations');
1446+
const annotationSection = this.contextMenu.annotationSection();
14471447
annotationSection.appendItem(i18nString(UIStrings.labelEntry), () => {
14481448
this.dispatchEventToListeners(
14491449
Events.ENTRY_LABEL_ANNOTATION_ADDED, {entryIndex: this.selectedEntryIndex, withLinkCreationButton: false});

0 commit comments

Comments
 (0)