chrome-devtools-frontend 1.0.1608453 → 1.0.1609381
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/front_end/core/host/AidaGcaTranslation.ts +13 -0
- package/front_end/core/sdk/PreloadingModel.ts +1 -1
- package/front_end/entrypoints/heap_snapshot_worker/AllocationProfile.ts +1 -1
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +1 -1
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.ts +1 -1
- package/front_end/generated/InspectorBackendCommands.ts +1 -2
- package/front_end/generated/protocol-mapping.d.ts +0 -9
- package/front_end/generated/protocol-proxy-api.d.ts +0 -7
- package/front_end/generated/protocol.ts +0 -20
- package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +6 -4
- package/front_end/models/ai_assistance/agents/BreakpointDebuggerAgent.ts +1 -1
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +11 -10
- package/front_end/models/ai_assistance/agents/ConversationSummaryAgent.ts +26 -2
- package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +49 -30
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +5 -3
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +69 -69
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +1 -1
- package/front_end/models/live-metrics/LiveMetrics.ts +43 -41
- package/front_end/models/trace/EntityMapper.ts +12 -0
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +44 -15
- package/front_end/panels/ai_assistance/components/chatMessage.css +13 -0
- package/front_end/panels/application/ApplicationPanelSidebar.ts +8 -0
- package/front_end/panels/application/IndexedDBViews.ts +1 -1
- package/front_end/panels/application/ReportingApiTreeElement.ts +40 -1
- package/front_end/panels/application/ResourcesPanel.ts +8 -0
- package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -1
- package/front_end/panels/application/WebMCPView.ts +122 -4
- package/front_end/panels/application/application-meta.ts +11 -0
- package/front_end/panels/application/application.ts +3 -0
- package/front_end/panels/application/components/StorageMetadataView.ts +31 -7
- package/front_end/panels/application/components/backForwardCacheView.css +4 -0
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +29 -0
- package/front_end/panels/application/webMCPView.css +12 -0
- package/front_end/panels/elements/ElementsTreeElement.ts +4 -0
- package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +1 -1
- package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +1 -1
- package/front_end/panels/profiler/HeapSnapshotView.ts +1 -1
- package/front_end/panels/timeline/TimelinePanel.ts +2 -6
- package/front_end/panels/timeline/utils/Helpers.ts +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/legacy/InspectorDrawerView.ts +188 -15
- package/front_end/ui/legacy/InspectorView.ts +162 -11
- package/front_end/ui/legacy/TabbedPane.ts +2 -2
- package/front_end/ui/legacy/components/utils/Linkifier.ts +2 -1
- package/front_end/ui/legacy/components/utils/imagePreview.css +1 -1
- package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +54 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/front_end/ui/visual_logging/LoggingDriver.ts +3 -3
- package/mcp/mcp.ts +1 -1
- package/package.json +1 -1
- /package/front_end/models/{heap_snapshot_model → heap_snapshot}/ChildrenProvider.ts +0 -0
- /package/front_end/models/{heap_snapshot_model → heap_snapshot}/HeapSnapshotModel.ts +0 -0
- /package/front_end/models/{heap_snapshot_model → heap_snapshot}/HeapSnapshotProxy.ts +0 -0
- /package/front_end/models/{heap_snapshot_model/heap_snapshot_model.ts → heap_snapshot/heap_snapshot.ts} +0 -0
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
7
7
|
import type * as SDK from '../../core/sdk/sdk.js';
|
|
8
|
-
import * as HeapSnapshotModel from '../../models/
|
|
8
|
+
import * as HeapSnapshotModel from '../../models/heap_snapshot/heap_snapshot.js';
|
|
9
9
|
import * as DataGrid from '../../ui/legacy/components/data_grid/data_grid.js';
|
|
10
10
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
11
11
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
@@ -10,7 +10,7 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
|
10
10
|
import * as Platform from '../../core/platform/platform.js';
|
|
11
11
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
12
12
|
import type * as Protocol from '../../generated/protocol.js';
|
|
13
|
-
import * as HeapSnapshotModel from '../../models/
|
|
13
|
+
import * as HeapSnapshotModel from '../../models/heap_snapshot/heap_snapshot.js';
|
|
14
14
|
import {createIcon} from '../../ui/kit/kit.js';
|
|
15
15
|
import * as DataGrid from '../../ui/legacy/components/data_grid/data_grid.js';
|
|
16
16
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
@@ -11,7 +11,7 @@ import * as Platform from '../../core/platform/platform.js';
|
|
|
11
11
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
12
12
|
import type * as Protocol from '../../generated/protocol.js';
|
|
13
13
|
import * as Bindings from '../../models/bindings/bindings.js';
|
|
14
|
-
import * as HeapSnapshotModel from '../../models/
|
|
14
|
+
import * as HeapSnapshotModel from '../../models/heap_snapshot/heap_snapshot.js';
|
|
15
15
|
import * as DataGrid from '../../ui/legacy/components/data_grid/data_grid.js';
|
|
16
16
|
import * as ObjectUI from '../../ui/legacy/components/object_ui/object_ui.js';
|
|
17
17
|
import * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';
|
|
@@ -2179,7 +2179,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
|
|
|
2179
2179
|
PerfUI.LineLevelProfile.Performance.instance().initialize(cpuProfiles, primaryPageTarget);
|
|
2180
2180
|
|
|
2181
2181
|
// Initialize EntityMapper
|
|
2182
|
-
this.#entityMapper =
|
|
2182
|
+
this.#entityMapper = Trace.EntityMapper.EntityMapper.getOrCreate(parsedTrace);
|
|
2183
2183
|
|
|
2184
2184
|
// Set up SourceMapsResolver to ensure we resolve any function names in
|
|
2185
2185
|
// profile calls.
|
|
@@ -2189,9 +2189,6 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
|
|
|
2189
2189
|
SourceMapsResolver.SourceMappingsUpdated.eventName, this.#onSourceMapsNodeNamesResolvedBound);
|
|
2190
2190
|
void this.#sourceMapsResolver.install();
|
|
2191
2191
|
|
|
2192
|
-
// Initialize EntityMapper
|
|
2193
|
-
this.#entityMapper = new Trace.EntityMapper.EntityMapper(parsedTrace);
|
|
2194
|
-
|
|
2195
2192
|
this.statusDialog?.updateProgressBar(i18nString(UIStrings.processed), 80);
|
|
2196
2193
|
this.updateMiniMap();
|
|
2197
2194
|
this.statusDialog?.updateProgressBar(i18nString(UIStrings.processed), 90);
|
|
@@ -3060,7 +3057,6 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
|
|
|
3060
3057
|
|
|
3061
3058
|
return trace;
|
|
3062
3059
|
}
|
|
3063
|
-
|
|
3064
3060
|
}
|
|
3065
3061
|
|
|
3066
3062
|
export const enum State {
|
|
@@ -3143,7 +3139,7 @@ export class BottomUpProfileRevealer implements Common.Revealer.Revealer<Utils.H
|
|
|
3143
3139
|
TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(
|
|
3144
3140
|
revealable.bounds, {ignoreMiniMapBounds: true, shouldAnimate: true});
|
|
3145
3141
|
panel.select(null);
|
|
3146
|
-
panel.getFlameChart().selectDetailsViewTab(Tab.BottomUp, null);
|
|
3142
|
+
panel.getFlameChart().selectDetailsViewTab(Tab.BottomUp, revealable.node ?? null);
|
|
3147
3143
|
}
|
|
3148
3144
|
}
|
|
3149
3145
|
|
|
@@ -138,6 +138,6 @@ export class RevealableTimeRange {
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
export class RevealableBottomUpProfile {
|
|
141
|
-
constructor(public bounds: Trace.Types.Timing.TraceWindowMicro) {
|
|
141
|
+
constructor(public bounds: Trace.Types.Timing.TraceWindowMicro, public node?: Trace.Extras.TraceTree.Node) {
|
|
142
142
|
}
|
|
143
143
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Name: Dependencies sourced from the upstream `chromium` repository
|
|
2
2
|
URL: Internal
|
|
3
3
|
Version: N/A
|
|
4
|
-
Revision:
|
|
4
|
+
Revision: 5b539f63dc636f6b69d9c294a65bc5aff0bea3de
|
|
5
5
|
Update Mechanism: Manual (https://crbug.com/428069060)
|
|
6
6
|
License: BSD-3-Clause
|
|
7
7
|
License File: LICENSE
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
7
7
|
import * as VisualLogging from '../visual_logging/visual_logging.js';
|
|
8
8
|
|
|
@@ -14,11 +14,29 @@ import {ToolbarButton, type ToolbarMenuButton} from './Toolbar.js';
|
|
|
14
14
|
import type {TabbedViewLocation} from './View.js';
|
|
15
15
|
import {ViewManager} from './ViewManager.js';
|
|
16
16
|
|
|
17
|
+
const VERTICAL_MINIMIZED_DRAWER_SIZE = 27;
|
|
18
|
+
|
|
17
19
|
class DrawerTabbedPane extends TabbedPane {
|
|
18
20
|
constructor() {
|
|
19
21
|
super();
|
|
20
22
|
this.registerRequiredCSS(drawerTabbedPaneStyles);
|
|
21
23
|
}
|
|
24
|
+
|
|
25
|
+
setVerticalMinimized(isMinimized: boolean): void {
|
|
26
|
+
this.element.classList.toggle('drawer-minimized-vertical', isMinimized);
|
|
27
|
+
this.contentElement.classList.toggle('collapsed-vertical-drawer-container', isMinimized);
|
|
28
|
+
this.tabbedPaneContentElement().classList.toggle('hide-element', isMinimized);
|
|
29
|
+
this.headerElement().classList.toggle('collapsed-vertical-drawer-header', isMinimized);
|
|
30
|
+
this.headerContentsElement.classList.toggle('hide-element', isMinimized);
|
|
31
|
+
this.leftToolbar().classList.toggle('hide-element', isMinimized);
|
|
32
|
+
this.rightToolbar().classList.toggle('collapsed-vertical-drawer-right-toolbar', isMinimized);
|
|
33
|
+
this.rightToolbar().classList.toggle('collapsed-vertical-drawer-toolbar-content', isMinimized);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
restoreAfterVerticalMinimized(): void {
|
|
37
|
+
this.clearMeasuredWidths();
|
|
38
|
+
this.headerResized();
|
|
39
|
+
}
|
|
22
40
|
}
|
|
23
41
|
|
|
24
42
|
const UIStrings = {
|
|
@@ -26,6 +44,14 @@ const UIStrings = {
|
|
|
26
44
|
* @description Title of more tabs button in the drawer view.
|
|
27
45
|
*/
|
|
28
46
|
moreTools: 'More Tools',
|
|
47
|
+
/**
|
|
48
|
+
* @description Text that appears when hover over the minimize button on the drawer view.
|
|
49
|
+
*/
|
|
50
|
+
minimizeDrawer: 'Minimize drawer',
|
|
51
|
+
/**
|
|
52
|
+
* @description Text that appears when hover over the expand button on the drawer view.
|
|
53
|
+
*/
|
|
54
|
+
expandDrawer: 'Expand drawer',
|
|
29
55
|
/**
|
|
30
56
|
* @description Text that appears when hover over the close button on the drawer view.
|
|
31
57
|
*/
|
|
@@ -44,9 +70,13 @@ interface InspectorDrawerViewOptions {
|
|
|
44
70
|
revealDrawer: () => void;
|
|
45
71
|
isVisible: () => boolean;
|
|
46
72
|
drawerLabel: string;
|
|
73
|
+
onToggleMinimized: () => void;
|
|
47
74
|
onHide: () => void;
|
|
48
75
|
onToggleOrientation: () => void;
|
|
76
|
+
onExpandFromMinimized: () => void;
|
|
77
|
+
onMinimizeFromTabInteraction: () => void;
|
|
49
78
|
onTabSelected: (tabId: string) => void;
|
|
79
|
+
isConsoleOpenInMainAndDrawer: (tabId: string) => boolean;
|
|
50
80
|
tabDelegate: TabbedPaneTabDelegate;
|
|
51
81
|
enableOrientationToggle: boolean;
|
|
52
82
|
isVertical: boolean;
|
|
@@ -59,10 +89,17 @@ interface InspectorDrawerViewOptions {
|
|
|
59
89
|
setInspectorMinimumSize: (width: number, height: number) => void;
|
|
60
90
|
}
|
|
61
91
|
|
|
92
|
+
interface InspectorDrawerPresentation {
|
|
93
|
+
isVertical: boolean;
|
|
94
|
+
isMinimized: boolean;
|
|
95
|
+
verticalExpandedMinimumWidth: number;
|
|
96
|
+
}
|
|
97
|
+
|
|
62
98
|
export class InspectorDrawerView {
|
|
63
99
|
readonly tabbedLocation: TabbedViewLocation;
|
|
64
100
|
readonly tabbedPane: DrawerTabbedPane;
|
|
65
101
|
readonly #splitWidget: SplitWidget;
|
|
102
|
+
readonly #drawerMinimizedSetting: Common.Settings.Setting<boolean>;
|
|
66
103
|
readonly #verticalExpandedMinimumWidth: number;
|
|
67
104
|
readonly #minimumSizes: {
|
|
68
105
|
inspectorWidthWhenVertical: number,
|
|
@@ -70,17 +107,28 @@ export class InspectorDrawerView {
|
|
|
70
107
|
inspectorHeight: number,
|
|
71
108
|
};
|
|
72
109
|
readonly #setInspectorMinimumSize: (width: number, height: number) => void;
|
|
110
|
+
#drawerSizeBeforeMinimize = 0;
|
|
111
|
+
#wasVerticalAndMinimized = false;
|
|
73
112
|
readonly #toggleOrientationButton: ToolbarButton;
|
|
113
|
+
readonly #minimizeExpandButton: ToolbarButton;
|
|
74
114
|
readonly #closeDrawerButton: ToolbarButton;
|
|
75
115
|
readonly #moreTabsButton: ToolbarMenuButton|null;
|
|
116
|
+
readonly #onExpandFromMinimized: () => void;
|
|
117
|
+
readonly #onMinimizeFromTabInteraction: () => void;
|
|
76
118
|
readonly #onTabSelected: (tabId: string) => void;
|
|
119
|
+
readonly #isConsoleOpenInMainAndDrawer: (tabId: string) => boolean;
|
|
77
120
|
|
|
78
121
|
constructor(options: InspectorDrawerViewOptions) {
|
|
79
122
|
this.#splitWidget = options.splitWidget;
|
|
80
123
|
this.#verticalExpandedMinimumWidth = options.verticalExpandedMinimumWidth;
|
|
81
124
|
this.#minimumSizes = options.minimumSizes;
|
|
82
125
|
this.#setInspectorMinimumSize = options.setInspectorMinimumSize;
|
|
126
|
+
this.#onExpandFromMinimized = options.onExpandFromMinimized;
|
|
127
|
+
this.#onMinimizeFromTabInteraction = options.onMinimizeFromTabInteraction;
|
|
83
128
|
this.#onTabSelected = options.onTabSelected;
|
|
129
|
+
this.#isConsoleOpenInMainAndDrawer = options.isConsoleOpenInMainAndDrawer;
|
|
130
|
+
this.#drawerMinimizedSetting =
|
|
131
|
+
Common.Settings.Settings.instance().createLocalSetting('inspector.drawer-minimized', false);
|
|
84
132
|
this.tabbedLocation = ViewManager.instance().createTabbedLocation(
|
|
85
133
|
options.revealDrawer, 'drawer-view', true, true, undefined, options.isVisible, () => new DrawerTabbedPane());
|
|
86
134
|
this.#moreTabsButton = this.tabbedLocation.enableMoreTabsButton();
|
|
@@ -89,8 +137,15 @@ export class InspectorDrawerView {
|
|
|
89
137
|
this.tabbedPane.element.classList.add('drawer-tabbed-pane');
|
|
90
138
|
this.tabbedPane.element.setAttribute('jslog', `${VisualLogging.drawer()}`);
|
|
91
139
|
|
|
140
|
+
this.#minimizeExpandButton = new ToolbarButton(
|
|
141
|
+
i18nString(UIStrings.minimizeDrawer), options.isVertical ? 'right-panel-close' : 'bottom-panel-close');
|
|
142
|
+
this.#minimizeExpandButton.element.setAttribute(
|
|
143
|
+
'jslog', `${VisualLogging.toggle('minimize-drawer').track({click: true})}`);
|
|
144
|
+
this.#minimizeExpandButton.addEventListener(ToolbarButton.Events.CLICK, options.onToggleMinimized);
|
|
145
|
+
|
|
92
146
|
this.#closeDrawerButton = new ToolbarButton(i18nString(UIStrings.closeDrawer), 'cross');
|
|
93
|
-
this.#closeDrawerButton.element.setAttribute(
|
|
147
|
+
this.#closeDrawerButton.element.setAttribute(
|
|
148
|
+
'jslog', `${VisualLogging.close('close-drawer').track({click: true})}`);
|
|
94
149
|
this.#closeDrawerButton.addEventListener(ToolbarButton.Events.CLICK, options.onHide);
|
|
95
150
|
|
|
96
151
|
this.#toggleOrientationButton = new ToolbarButton(
|
|
@@ -102,7 +157,9 @@ export class InspectorDrawerView {
|
|
|
102
157
|
if (options.enableOrientationToggle) {
|
|
103
158
|
this.tabbedPane.rightToolbar().appendToolbarItem(this.#toggleOrientationButton);
|
|
104
159
|
}
|
|
160
|
+
this.tabbedPane.rightToolbar().appendToolbarItem(this.#minimizeExpandButton);
|
|
105
161
|
this.tabbedPane.rightToolbar().appendToolbarItem(this.#closeDrawerButton);
|
|
162
|
+
this.tabbedPane.addEventListener(TabbedPaneEvents.TabInvoked, this.#drawerTabInvoked, this);
|
|
106
163
|
this.tabbedPane.addEventListener(TabbedPaneEvents.TabSelected, this.#drawerTabSelected, this);
|
|
107
164
|
this.tabbedPane.setTabDelegate(options.tabDelegate);
|
|
108
165
|
const selectedDrawerTab = this.tabbedPane.selectedTabId;
|
|
@@ -120,7 +177,17 @@ export class InspectorDrawerView {
|
|
|
120
177
|
drag: true,
|
|
121
178
|
keydown: 'ArrowUp|ArrowLeft|ArrowDown|ArrowRight|Enter|Space',
|
|
122
179
|
})}`);
|
|
123
|
-
this.#updatePresentation();
|
|
180
|
+
this.#updatePresentation(false);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
restoreMinimizedStateFromSettings(): void {
|
|
184
|
+
if (!this.#drawerMinimizedSetting.get()) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// The drawer starts hidden; show it first, then minimize.
|
|
189
|
+
this.#splitWidget.showBoth();
|
|
190
|
+
this.setMinimized(true);
|
|
124
191
|
}
|
|
125
192
|
|
|
126
193
|
setVertical(shouldBeVertical: boolean): void {
|
|
@@ -129,12 +196,14 @@ export class InspectorDrawerView {
|
|
|
129
196
|
}
|
|
130
197
|
|
|
131
198
|
const previousShowMode = this.#splitWidget.showMode();
|
|
199
|
+
const wasDrawerMinimized = this.isMinimized();
|
|
200
|
+
|
|
132
201
|
this.#splitWidget.setVertical(shouldBeVertical);
|
|
133
|
-
this.#updatePresentation();
|
|
134
|
-
this.applyState(previousShowMode);
|
|
202
|
+
this.#updatePresentation(wasDrawerMinimized);
|
|
203
|
+
this.applyState(previousShowMode, wasDrawerMinimized);
|
|
135
204
|
}
|
|
136
205
|
|
|
137
|
-
applyState(showMode: ShowMode): void {
|
|
206
|
+
applyState(showMode: ShowMode, minimized: boolean): void {
|
|
138
207
|
if (this.#splitWidget.showMode() !== showMode) {
|
|
139
208
|
switch (showMode) {
|
|
140
209
|
case ShowMode.BOTH:
|
|
@@ -148,22 +217,63 @@ export class InspectorDrawerView {
|
|
|
148
217
|
break;
|
|
149
218
|
}
|
|
150
219
|
}
|
|
151
|
-
|
|
220
|
+
|
|
221
|
+
const shouldBeMinimized = showMode === ShowMode.BOTH && minimized;
|
|
222
|
+
if (showMode === ShowMode.BOTH) {
|
|
223
|
+
this.setMinimized(shouldBeMinimized);
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
this.#splitWidget.setSidebarMinimized(false);
|
|
228
|
+
this.#splitWidget.setResizable(false);
|
|
229
|
+
this.#updatePresentation(false);
|
|
230
|
+
this.#drawerMinimizedSetting.set(false);
|
|
152
231
|
}
|
|
153
232
|
|
|
154
233
|
show(hasTargetDrawer: boolean): void {
|
|
234
|
+
const wasDrawerVisible = this.isVisibleForEvents();
|
|
155
235
|
this.tabbedPane.setAutoSelectFirstItemOnShow(!hasTargetDrawer);
|
|
156
236
|
this.#splitWidget.showBoth();
|
|
237
|
+
this.#dispatchPaneVisibilityChangedIfNeeded(wasDrawerVisible);
|
|
157
238
|
}
|
|
158
239
|
|
|
159
240
|
hide(): void {
|
|
160
|
-
this
|
|
241
|
+
const wasDrawerVisible = this.isVisibleForEvents();
|
|
242
|
+
const wasMinimized = this.isMinimized();
|
|
243
|
+
this.#splitWidget.hideSidebar(!wasMinimized);
|
|
244
|
+
if (wasMinimized) {
|
|
245
|
+
this.#updatePresentation(false);
|
|
246
|
+
this.#splitWidget.setSidebarMinimized(false);
|
|
247
|
+
this.#splitWidget.setResizable(true);
|
|
248
|
+
}
|
|
249
|
+
this.#drawerMinimizedSetting.set(false);
|
|
250
|
+
this.#dispatchPaneVisibilityChangedIfNeeded(wasDrawerVisible);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
setMinimized(minimized: boolean): void {
|
|
254
|
+
const wasDrawerVisible = this.isVisibleForEvents();
|
|
255
|
+
if (minimized && !this.isMinimized()) {
|
|
256
|
+
this.#drawerSizeBeforeMinimize = this.#splitWidget.sidebarSize();
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
this.#updatePresentation(minimized);
|
|
260
|
+
this.#splitWidget.setSidebarMinimized(minimized);
|
|
261
|
+
this.#dispatchPaneVisibilityChangedIfNeeded(wasDrawerVisible);
|
|
262
|
+
this.#splitWidget.setResizable(!minimized);
|
|
263
|
+
this.#drawerMinimizedSetting.set(minimized);
|
|
264
|
+
if (!minimized && this.#drawerSizeBeforeMinimize > 0) {
|
|
265
|
+
this.#splitWidget.setSidebarSize(this.#drawerSizeBeforeMinimize);
|
|
266
|
+
}
|
|
161
267
|
}
|
|
162
268
|
|
|
163
269
|
drawerVisible(): boolean {
|
|
164
270
|
return this.tabbedPane.isShowing();
|
|
165
271
|
}
|
|
166
272
|
|
|
273
|
+
isVisibleForEvents(): boolean {
|
|
274
|
+
return this.#splitWidget.sidebarIsShowing() && !this.isMinimized();
|
|
275
|
+
}
|
|
276
|
+
|
|
167
277
|
drawerSize(): number {
|
|
168
278
|
return this.#splitWidget.sidebarSize();
|
|
169
279
|
}
|
|
@@ -176,31 +286,94 @@ export class InspectorDrawerView {
|
|
|
176
286
|
return this.#splitWidget.totalSize();
|
|
177
287
|
}
|
|
178
288
|
|
|
289
|
+
isMinimized(): boolean {
|
|
290
|
+
return this.#splitWidget.isSidebarMinimized();
|
|
291
|
+
}
|
|
292
|
+
|
|
179
293
|
isVertical(): boolean {
|
|
180
294
|
return this.#splitWidget.isVertical();
|
|
181
295
|
}
|
|
182
296
|
|
|
183
|
-
updatePresentation(isVertical:
|
|
297
|
+
updatePresentation({isVertical, isMinimized, verticalExpandedMinimumWidth}: InspectorDrawerPresentation): void {
|
|
184
298
|
this.#toggleOrientationButton.setGlyph(isVertical ? 'dock-bottom' : 'dock-right');
|
|
299
|
+
this.#updateMinimizeExpandButton(isVertical, isMinimized);
|
|
185
300
|
|
|
186
|
-
|
|
187
|
-
|
|
301
|
+
const isVerticalAndMinimized = isVertical && isMinimized;
|
|
302
|
+
if (isVerticalAndMinimized) {
|
|
303
|
+
this.tabbedPane.setMinimumSize(VERTICAL_MINIMIZED_DRAWER_SIZE, VERTICAL_MINIMIZED_DRAWER_SIZE);
|
|
304
|
+
} else if (isVertical) {
|
|
305
|
+
this.tabbedPane.setMinimumSize(verticalExpandedMinimumWidth, VERTICAL_MINIMIZED_DRAWER_SIZE);
|
|
188
306
|
} else {
|
|
189
|
-
this.tabbedPane.setMinimumSize(0,
|
|
307
|
+
this.tabbedPane.setMinimumSize(0, VERTICAL_MINIMIZED_DRAWER_SIZE);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
this.tabbedPane.setVerticalMinimized(isVerticalAndMinimized);
|
|
311
|
+
|
|
312
|
+
if (this.#moreTabsButton) {
|
|
313
|
+
this.#moreTabsButton.setVisible(!isVerticalAndMinimized);
|
|
190
314
|
}
|
|
315
|
+
|
|
316
|
+
if (!isVerticalAndMinimized && this.#wasVerticalAndMinimized) {
|
|
317
|
+
this.tabbedPane.restoreAfterVerticalMinimized();
|
|
318
|
+
}
|
|
319
|
+
this.#wasVerticalAndMinimized = isVerticalAndMinimized;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
#updateMinimizeExpandButton(isVertical: boolean, isMinimized: boolean): void {
|
|
323
|
+
if (isMinimized) {
|
|
324
|
+
this.#minimizeExpandButton.setGlyph(isVertical ? 'right-panel-open' : 'bottom-panel-open');
|
|
325
|
+
this.#minimizeExpandButton.setTitle(i18nString(UIStrings.expandDrawer));
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
this.#minimizeExpandButton.setGlyph(isVertical ? 'right-panel-close' : 'bottom-panel-close');
|
|
330
|
+
this.#minimizeExpandButton.setTitle(i18nString(UIStrings.minimizeDrawer));
|
|
191
331
|
}
|
|
192
332
|
|
|
193
|
-
#updatePresentation(): void {
|
|
333
|
+
#updatePresentation(minimized: boolean): void {
|
|
194
334
|
const drawerIsVertical = this.#splitWidget.isVertical();
|
|
195
335
|
this.#setInspectorMinimumSize(
|
|
196
336
|
drawerIsVertical ? this.#minimumSizes.inspectorWidthWhenVertical :
|
|
197
337
|
this.#minimumSizes.inspectorWidthWhenHorizontal,
|
|
198
338
|
this.#minimumSizes.inspectorHeight);
|
|
199
|
-
this.updatePresentation(
|
|
339
|
+
this.updatePresentation({
|
|
340
|
+
isVertical: drawerIsVertical,
|
|
341
|
+
isMinimized: minimized,
|
|
342
|
+
verticalExpandedMinimumWidth: this.#verticalExpandedMinimumWidth,
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
#dispatchPaneVisibilityChangedIfNeeded(wasDrawerVisible: boolean): void {
|
|
347
|
+
const isDrawerVisible = this.isVisibleForEvents();
|
|
348
|
+
if (wasDrawerVisible === isDrawerVisible) {
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
this.tabbedPane.dispatchEventToListeners(TabbedPaneEvents.PaneVisibilityChanged, {isVisible: isDrawerVisible});
|
|
200
352
|
}
|
|
201
353
|
|
|
202
354
|
#drawerTabSelected(event: Common.EventTarget.EventTargetEvent<EventData>): void {
|
|
203
|
-
const {tabId} = event.data;
|
|
355
|
+
const {tabId, prevTabId, isUserGesture} = event.data;
|
|
204
356
|
this.#onTabSelected(tabId);
|
|
357
|
+
|
|
358
|
+
if (this.#isConsoleOpenInMainAndDrawer(tabId)) {
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
if (isUserGesture && prevTabId && prevTabId !== tabId && this.isMinimized()) {
|
|
363
|
+
this.#onExpandFromMinimized();
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
#drawerTabInvoked(event: Common.EventTarget.EventTargetEvent<EventData>): void {
|
|
368
|
+
const {tabId, isUserGesture} = event.data;
|
|
369
|
+
if (isUserGesture && this.#isConsoleOpenInMainAndDrawer(tabId)) {
|
|
370
|
+
if (!this.isMinimized()) {
|
|
371
|
+
this.#onMinimizeFromTabInteraction();
|
|
372
|
+
}
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
if (isUserGesture && this.isMinimized()) {
|
|
376
|
+
this.#onExpandFromMinimized();
|
|
377
|
+
}
|
|
205
378
|
}
|
|
206
379
|
}
|