chrome-devtools-frontend 1.0.1733843 → 1.0.1736236
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/.agents/rules/tests/test-view-and-presenter-isolation.md +4 -4
- package/.agents/rules/ui-and-widgets/ui-declarative-tree-and-prompt-patterns.md +61 -0
- package/.agents/rules/ui-and-widgets/ui-lit-declarative-templates-and-directives.md +11 -7
- package/.agents/rules/ui-and-widgets/ui-modern-component-and-encapsulation-standards.md +13 -4
- package/.agents/rules/ui-and-widgets/ui-pure-view-and-presenter-separation.md +31 -2
- package/.agents/rules/ui-and-widgets/ui-reactive-widget-update-lifecycle.md +23 -4
- package/.agents/rules/ui-and-widgets/ui-widget-dom-and-listener-lifecycle.md +34 -3
- package/.agents/skills/code-review/SKILL.md +27 -0
- package/.agents/skills/devtools-uistrings/SKILL.md +147 -0
- package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +27 -1
- package/.agents/skills/ui-eng-vision-orchestrator/SKILL.md +100 -0
- package/.agents/skills/ui-eng-vision-test-scaffolder/SKILL.md +16 -0
- package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +13 -2
- package/.agents/skills/ui-widgets/SKILL.md +25 -25
- package/DIR_METADATA +8 -1
- package/docs/cookbook/localization.md +1 -1
- package/docs/ui_engineering.md +24 -0
- package/eslint.config.mjs +0 -1
- package/front_end/application_tokens.css +1 -1
- package/front_end/core/host/AidaClient.ts +147 -202
- package/front_end/core/host/AidaClientTypes.ts +9 -0
- package/front_end/core/host/AidaErrors.ts +416 -0
- package/front_end/core/host/AidaGcaTranslation.ts +11 -0
- package/front_end/core/host/InspectorFrontendHostAPI.ts +9 -2
- package/front_end/core/host/UserMetrics.ts +25 -0
- package/front_end/core/host/UserMetricsEnums.ts +25 -0
- package/front_end/core/host/host.ts +3 -1
- package/front_end/core/i18n/collect-ui-strings.js +20 -0
- package/front_end/core/root/Runtime.ts +12 -0
- package/front_end/core/sdk/CPUThrottlingManager.ts +3 -0
- package/front_end/core/sdk/EnhancedTracesParser.ts +8 -4
- package/front_end/core/sdk/NetworkManager.ts +0 -6
- package/front_end/core/sdk/OverlayModel.ts +0 -6
- package/front_end/core/sdk/PreloadingModel.ts +30 -13
- package/front_end/core/sdk/PrivateVerificationTokensModel.ts +0 -18
- package/front_end/core/sdk/RehydratingConnection.ts +5 -2
- package/front_end/core/sdk/ResourceTreeModel.ts +0 -42
- package/front_end/core/sdk/ScreenCaptureModel.ts +0 -84
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +0 -15
- package/front_end/core/sdk/StorageBucketsModel.ts +0 -15
- package/front_end/devtools_compatibility.js +57 -2
- package/front_end/entrypoints/formatter_worker/ScopeParser.ts +4 -2
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +203 -127
- package/front_end/entrypoints/inspector_main/renderingOptions.css +5 -0
- package/front_end/entrypoints/node_app/app/NodeMain.ts +0 -9
- package/front_end/entrypoints/node_app/app/nodeConnectionsPanel.css +0 -22
- package/front_end/generated/InspectorBackendCommands.ts +1 -1
- package/front_end/generated/SupportedCSSProperties.ts +0 -136
- package/front_end/generated/protocol-proxy-api.d.ts +231 -231
- package/front_end/generated/protocol.ts +1 -0
- package/front_end/models/ai_assistance/AiAgent2.ts +4 -1
- package/front_end/models/ai_assistance/ChangeManager.ts +3 -1
- package/front_end/models/ai_assistance/DOMHelpers.ts +118 -3
- package/front_end/models/ai_assistance/ExtensionScope.ts +31 -24
- package/front_end/models/ai_assistance/agents/AiAgent.ts +6 -0
- package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +13 -13
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +1 -1
- package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +18 -8
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +2 -2
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +103 -81
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +15 -203
- package/front_end/models/ai_assistance/injected.ts +6 -1
- package/front_end/models/ai_assistance/skills/lighthouse.md +1 -1
- package/front_end/models/ai_assistance/skills/styling.md +8 -10
- package/front_end/models/ai_assistance/tools/GetTraceEventByKey.ts +1 -1
- package/front_end/models/ai_assistance/tools/SetElementStyles.ts +288 -0
- package/front_end/models/ai_assistance/tools/Tool.ts +1 -0
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +3 -0
- package/front_end/models/bindings/ResourceScriptMapping.ts +64 -16
- package/front_end/models/comment_manager/CD4ABridge.ts +12 -2
- package/front_end/models/comment_manager/CommentManager.ts +24 -4
- package/front_end/models/javascript_metadata/NativeFunctions.ts +41 -1
- package/front_end/models/project_settings/ProjectSettingsModel.ts +1 -1
- package/front_end/models/trace/handlers/FlowsHandler.ts +10 -0
- package/front_end/models/trace/handlers/SamplesHandler.ts +3 -2
- package/front_end/models/trace/handlers/ScriptsHandler.ts +25 -26
- package/front_end/models/trace/helpers/TreeHelpers.ts +4 -0
- package/front_end/models/trace/insights/DuplicatedJavaScript.ts +1 -2
- package/front_end/models/trace/types/TraceEvents.ts +21 -22
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +9 -1
- package/front_end/panels/ai_assistance/components/chatInput.css +4 -4
- package/front_end/panels/animation/AnimationTimeline.ts +3 -3
- package/front_end/panels/animation/animationTimeline.css +6 -4
- package/front_end/panels/application/IndexedDBModel.ts +0 -15
- package/front_end/panels/application/appManifestView.css +2 -5
- package/front_end/panels/application/components/backForwardCacheView.css +1 -5
- package/front_end/panels/application/components/serviceWorkerRouterView.css +2 -2
- package/front_end/panels/application/preloading/components/PreloadingString.ts +7 -0
- package/front_end/panels/comments/CommentsPane.ts +12 -7
- package/front_end/panels/comments/commentsPane.css +16 -2
- package/front_end/panels/common/CommentsOverlayWidget.ts +16 -10
- package/front_end/panels/common/CommentsStatusBarPill.ts +12 -5
- package/front_end/panels/common/commentsOverlay.css +7 -1
- package/front_end/panels/common/commentsStatusBarPill.css +30 -0
- package/front_end/panels/console/consolePrompt.css +0 -12
- package/front_end/panels/console/consoleView.css +2 -2
- package/front_end/panels/developer_resources/developerResourcesView.css +4 -3
- package/front_end/panels/elements/DOMTreeWidget.ts +29 -9
- package/front_end/panels/elements/StylePropertyTreeElement.ts +2 -1
- package/front_end/panels/elements/components/CSSHintDetailsView.ts +12 -5
- package/front_end/panels/elements/components/cssVariableValueView.css +1 -1
- package/front_end/panels/elements/components/elementsBreadcrumbs.css +2 -2
- package/front_end/panels/elements/domTreeWidget.css +6 -1
- package/front_end/panels/elements/elementsPanel.css +0 -6
- package/front_end/panels/elements/layoutPane.css +1 -1
- package/front_end/panels/elements/metricsSidebarPane.css +1 -1
- package/front_end/panels/elements/platformFontsWidget.css +1 -1
- package/front_end/panels/elements/stylesSidebarPane.css +0 -10
- package/front_end/panels/emulation/deviceModeView.css +6 -7
- package/front_end/panels/explain/components/consoleInsight.css +4 -4
- package/front_end/panels/issues/issuesTree.css +1 -26
- package/front_end/panels/lighthouse/lighthouseStartView.css +2 -2
- package/front_end/panels/linear_memory_inspector/components/linearMemoryInspector.css +1 -1
- package/front_end/panels/media/TickingFlameChart.ts +20 -3
- package/front_end/panels/media/playerMessagesView.css +2 -2
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +24 -5
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +1 -6
- package/front_end/panels/network/networkLogView.css +2 -2
- package/front_end/panels/network/networkTimingTable.css +1 -1
- package/front_end/panels/performance_monitor/performanceMonitor.css +0 -4
- package/front_end/panels/protocol_monitor/JSONEditor.css +1 -1
- package/front_end/panels/protocol_monitor/JSONEditor.ts +4 -2
- package/front_end/panels/recorder/recorderPanel.css +3 -3
- package/front_end/panels/recorder/recordingListView.css +1 -1
- package/front_end/panels/screencast/screencastView.css +1 -1
- package/front_end/panels/search/searchResultsPane.css +1 -1
- package/front_end/panels/security/SecurityModel.ts +0 -6
- package/front_end/panels/security/SecurityPanel.ts +120 -108
- package/front_end/panels/security/originView.css +1 -1
- package/front_end/panels/sensors/locationsSettingsTab.css +3 -3
- package/front_end/panels/settings/EditFileSystemView.ts +159 -104
- package/front_end/panels/settings/editFileSystemView.css +30 -4
- package/front_end/panels/settings/emulation/devicesSettingsTab.css +0 -52
- package/front_end/panels/settings/settingsScreen.css +0 -7
- package/front_end/panels/sources/CallStackSidebarPane.ts +339 -221
- package/front_end/panels/sources/NavigatorView.ts +95 -8
- package/front_end/panels/sources/ThreadsSidebarPane.ts +8 -4
- package/front_end/panels/sources/breakpointsView.css +1 -3
- package/front_end/panels/sources/callStackSidebarPane.css +4 -0
- package/front_end/panels/sources/components/HeadersView.ts +15 -2
- package/front_end/panels/sources/watchExpressionsSidebarPane.css +0 -1
- package/front_end/panels/timeline/CountersGraph.ts +0 -4
- package/front_end/panels/timeline/TimelineLoader.ts +16 -6
- package/front_end/panels/timeline/TimelinePanel.ts +20 -12
- package/front_end/panels/timeline/TimelineUIUtils.ts +1 -1
- package/front_end/panels/timeline/components/DetailsView.ts +2 -1
- package/front_end/panels/timeline/components/cwvMetrics.css +1 -1
- package/front_end/panels/timeline/components/metricCard.css +1 -1
- package/front_end/panels/timeline/components/sidebarAnnotationsTab.css +4 -4
- package/front_end/panels/timeline/timelineFlameChartView.css +1 -1
- package/front_end/panels/webauthn/WebauthnPane.ts +13 -14
- package/front_end/panels/webauthn/webauthnPane.css +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/comments/CommentOverlayManager.ts +34 -18
- package/front_end/ui/components/icon_button/FileSourceIcon.ts +6 -0
- package/front_end/ui/components/input/textInput.css +1 -1
- package/front_end/ui/components/panel_introduction_steps/panelIntroductionSteps.css +6 -4
- package/front_end/ui/components/suggestion_input/suggestionInput.css +2 -2
- package/front_end/ui/components/text_editor/AiCodeGenerationTeaser.ts +14 -2
- package/front_end/ui/legacy/DockController.ts +17 -4
- package/front_end/ui/legacy/Treeoutline.ts +2 -2
- package/front_end/ui/legacy/UIUtils.ts +148 -10
- package/front_end/ui/legacy/components/inline_editor/bezierEditor.css +3 -2
- package/front_end/ui/legacy/components/perf_ui/chartViewport.css +2 -2
- package/front_end/ui/legacy/components/perf_ui/filmStripView.css +2 -2
- package/front_end/ui/legacy/components/perf_ui/pieChart.css +1 -1
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +5 -4
- package/front_end/ui/legacy/components/source_frame/imageView.css +1 -1
- package/front_end/ui/legacy/components/utils/TargetDetachedDialog.ts +0 -3
- package/front_end/ui/legacy/components/utils/imagePreview.css +1 -1
- package/front_end/ui/legacy/inspectorCommon.css +1 -14
- package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +3 -2
- package/front_end/ui/legacy/listWidget.css +0 -18
- package/front_end/ui/legacy/theme_support/ThemeSupport.ts +44 -9
- package/front_end/ui/lit/strip-whitespace.ts +1 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/package.json +3 -3
- package/front_end/generated/Deprecation.ts +0 -471
- package/front_end/panels/accessibility/axBreadcrumbs.css +0 -155
- package/front_end/panels/network/requestHeadersTree.css +0 -226
- package/front_end/panels/recorder/startView.css +0 -38
- package/front_end/panels/security/ipProtectionView.css +0 -141
- package/front_end/ui/legacy/components/inline_editor/animationNameSwatch.css +0 -27
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
resolveCommentAnchorElement,
|
|
25
25
|
setStickyOccluders,
|
|
26
26
|
STICKY_OCCLUDER_ATTRIBUTE,
|
|
27
|
+
type VisibleRect,
|
|
27
28
|
} from './CommentAnchorResolver.js';
|
|
28
29
|
|
|
29
30
|
export const COMMENT_MODE_CURSOR = 'var(--comment-cursor)';
|
|
@@ -34,11 +35,12 @@ export interface StartOptions {
|
|
|
34
35
|
resizeTarget?: Element;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
export interface
|
|
38
|
+
export interface PinData {
|
|
38
39
|
id: string;
|
|
39
40
|
top: number;
|
|
40
41
|
left: number;
|
|
41
42
|
visible: boolean;
|
|
43
|
+
resolved: boolean;
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
export interface HighlightRectData {
|
|
@@ -71,7 +73,7 @@ export const enum Events {
|
|
|
71
73
|
|
|
72
74
|
export interface EventTypes {
|
|
73
75
|
[Events.POSITIONS_UPDATED]: {
|
|
74
|
-
pins:
|
|
76
|
+
pins: PinData[],
|
|
75
77
|
highlights: HighlightRectData[],
|
|
76
78
|
isRealtimeSync?: boolean,
|
|
77
79
|
};
|
|
@@ -90,7 +92,7 @@ export class CommentOverlayManager extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
90
92
|
#intersectionObserver?: IntersectionObserver;
|
|
91
93
|
|
|
92
94
|
#hoverData: HoverHighlightData|null = null;
|
|
93
|
-
#pinPositions:
|
|
95
|
+
#pinPositions: PinData[] = [];
|
|
94
96
|
#highlightRects: HighlightRectData[] = [];
|
|
95
97
|
|
|
96
98
|
#clickListener?: (event: Event) => void;
|
|
@@ -235,7 +237,7 @@ export class CommentOverlayManager extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
235
237
|
return this.#hoverData;
|
|
236
238
|
}
|
|
237
239
|
|
|
238
|
-
getPinPositions():
|
|
240
|
+
getPinPositions(): PinData[] {
|
|
239
241
|
return this.#pinPositions;
|
|
240
242
|
}
|
|
241
243
|
|
|
@@ -449,11 +451,22 @@ export class CommentOverlayManager extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
449
451
|
const scrollX = window.scrollX;
|
|
450
452
|
const scrollY = window.scrollY;
|
|
451
453
|
|
|
452
|
-
const newPins:
|
|
454
|
+
const newPins: PinData[] = [];
|
|
453
455
|
const newHighlights: HighlightRectData[] = [];
|
|
454
456
|
const elementPinCounts = new Map<Element, number>();
|
|
455
457
|
const rectCache = new Map<Element, DOMRect>();
|
|
456
458
|
const activeScrollRoots = new Set<ShadowRoot>();
|
|
459
|
+
const resolvedPins: Array<{id: string, el: Element, visibleRect: VisibleRect}> = [];
|
|
460
|
+
const createPin = (id: string, visibleRect: VisibleRect, offsetIndex: number, visible: boolean,
|
|
461
|
+
resolved: boolean): PinData => ({
|
|
462
|
+
id,
|
|
463
|
+
// Offset by 26px vertically (24px pin icon height + 2px spacing) so multiple comment pins on the same element stack vertically without overlapping.
|
|
464
|
+
// Offset by -12px (half of the 24px pin diameter) so the pin icon is centered on the top-right corner of the visible clipped area.
|
|
465
|
+
top: scrollY + visibleRect.top - 12 + offsetIndex * 26,
|
|
466
|
+
left: scrollX + visibleRect.right - 12,
|
|
467
|
+
visible,
|
|
468
|
+
resolved,
|
|
469
|
+
});
|
|
457
470
|
|
|
458
471
|
for (const thread of this.#commentManager.getCommentThreads()) {
|
|
459
472
|
// Generated comments do not render overlay pins.
|
|
@@ -492,19 +505,6 @@ export class CommentOverlayManager extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
492
505
|
continue;
|
|
493
506
|
}
|
|
494
507
|
|
|
495
|
-
const offsetIndex = elementPinCounts.get(el) || 0;
|
|
496
|
-
elementPinCounts.set(el, offsetIndex + 1);
|
|
497
|
-
// Offset by 26px vertically (24px pin icon height + 2px spacing) so multiple comment pins on the same element stack vertically without overlapping.
|
|
498
|
-
const offsetY = offsetIndex * 26;
|
|
499
|
-
|
|
500
|
-
// Offset by -12px (half of the 24px pin diameter) so the pin icon is centered on the top-right corner of the visible clipped area.
|
|
501
|
-
newPins.push({
|
|
502
|
-
id: thread.id,
|
|
503
|
-
top: scrollY + visibleRect.top - 12 + offsetY,
|
|
504
|
-
left: scrollX + visibleRect.right - 12,
|
|
505
|
-
visible: true,
|
|
506
|
-
});
|
|
507
|
-
|
|
508
508
|
newHighlights.push({
|
|
509
509
|
id: thread.id,
|
|
510
510
|
top: scrollY + visibleRect.top,
|
|
@@ -513,6 +513,22 @@ export class CommentOverlayManager extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
513
513
|
height: visibleRect.height,
|
|
514
514
|
visible: true,
|
|
515
515
|
});
|
|
516
|
+
|
|
517
|
+
if (thread.status === 'RESOLVED') {
|
|
518
|
+
resolvedPins.push({id: thread.id, el, visibleRect});
|
|
519
|
+
continue;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
const offsetIndex = elementPinCounts.get(el) || 0;
|
|
523
|
+
elementPinCounts.set(el, offsetIndex + 1);
|
|
524
|
+
newPins.push(createPin(thread.id, visibleRect, offsetIndex, true, false));
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
// Pins of RESOLVED threads are hidden; the UI shows the pin of the open
|
|
528
|
+
// thread. They all share the slot below the other pins of their element,
|
|
529
|
+
// so they never shift the other pins, and only one is open at a time.
|
|
530
|
+
for (const {id, el, visibleRect} of resolvedPins) {
|
|
531
|
+
newPins.push(createPin(id, visibleRect, elementPinCounts.get(el) || 0, false, true));
|
|
516
532
|
}
|
|
517
533
|
|
|
518
534
|
if (this.#scrollListener) {
|
|
@@ -43,6 +43,12 @@ export class FileSourceIcon extends HTMLElement {
|
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
override cloneNode(deep?: boolean): Node {
|
|
47
|
+
const node = document.importNode(this, deep);
|
|
48
|
+
node.data = this.data;
|
|
49
|
+
return node;
|
|
50
|
+
}
|
|
51
|
+
|
|
46
52
|
connectedCallback(): void {
|
|
47
53
|
this.#render();
|
|
48
54
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
.devtools-text-input {
|
|
8
8
|
height: var(--sys-size-13);
|
|
9
9
|
width: 100%;
|
|
10
|
-
padding: var(--sys-size-5)
|
|
10
|
+
padding: var(--sys-size-5) var(--sys-size-6);
|
|
11
11
|
line-height: 1.16;
|
|
12
12
|
letter-spacing: 0.015em;
|
|
13
13
|
border: var(--sys-size-1) solid var(--sys-color-neutral-outline);
|
|
@@ -43,13 +43,15 @@ h1 {
|
|
|
43
43
|
color: var(--sys-color-primary);
|
|
44
44
|
content: counter(custom-counter);
|
|
45
45
|
font-size: var(--sys-typescale-body4-size);
|
|
46
|
-
height:
|
|
47
|
-
|
|
46
|
+
height: var(--sys-size-8);
|
|
47
|
+
/* 24px (--sys-size-11) + 6px (--sys-size-4) matches the 30px .intro-steps left margin */
|
|
48
|
+
left: calc(-1 * (var(--sys-size-11) + var(--sys-size-4)));
|
|
48
49
|
line-height: var(--sys-size-9);
|
|
49
50
|
position: absolute;
|
|
50
51
|
text-align: center;
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
/* 2px (--sys-size-2) + 1px (--sys-size-1) aligns the 16px badge with body3 step text */
|
|
53
|
+
top: calc(var(--sys-size-2) + var(--sys-size-1));
|
|
54
|
+
width: var(--sys-size-8);
|
|
53
55
|
display: flex;
|
|
54
56
|
align-items: center;
|
|
55
57
|
justify-content: center;
|
|
@@ -21,8 +21,8 @@ devtools-editable-content {
|
|
|
21
21
|
color: var(--override-color-recorder-input, var(--sys-color-on-surface));
|
|
22
22
|
cursor: text;
|
|
23
23
|
display: inline-block;
|
|
24
|
-
line-height:
|
|
25
|
-
min-height:
|
|
24
|
+
line-height: var(--sys-size-8);
|
|
25
|
+
min-height: var(--sys-size-8);
|
|
26
26
|
min-width: 0.5em;
|
|
27
27
|
outline: none;
|
|
28
28
|
overflow-wrap: anywhere;
|
|
@@ -355,6 +355,15 @@ export class AiCodeGenerationTeaser extends UI.Widget.Widget {
|
|
|
355
355
|
this.#viewOutput, this.contentElement);
|
|
356
356
|
}
|
|
357
357
|
|
|
358
|
+
override wasShown(): void {
|
|
359
|
+
super.wasShown();
|
|
360
|
+
if (this.#displayState === AiCodeGenerationTeaserDisplayState.LOADING) {
|
|
361
|
+
void this.updateComplete.then(() => {
|
|
362
|
+
this.#startLoadingAnimation();
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
358
367
|
override willHide(): void {
|
|
359
368
|
super.willHide();
|
|
360
369
|
this.#stopLoadingAnimation();
|
|
@@ -379,14 +388,17 @@ export class AiCodeGenerationTeaser extends UI.Widget.Widget {
|
|
|
379
388
|
if (this.#displayState === AiCodeGenerationTeaserDisplayState.LOADING) {
|
|
380
389
|
// wait update to complete so that setTimerText has been set properly
|
|
381
390
|
void this.updateComplete.then(() => {
|
|
382
|
-
|
|
391
|
+
this.#startLoadingAnimation();
|
|
383
392
|
});
|
|
384
|
-
} else
|
|
393
|
+
} else {
|
|
385
394
|
this.#stopLoadingAnimation();
|
|
386
395
|
}
|
|
387
396
|
}
|
|
388
397
|
|
|
389
398
|
#startLoadingAnimation(): void {
|
|
399
|
+
if (this.#displayState !== AiCodeGenerationTeaserDisplayState.LOADING || !this.isShowing()) {
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
390
402
|
this.#stopLoadingAnimation();
|
|
391
403
|
this.#loadStartTime = performance.now();
|
|
392
404
|
|
|
@@ -38,6 +38,11 @@ export class DockController extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
38
38
|
private readonly currentDockStateSetting: Common.Settings.Setting<DockState>;
|
|
39
39
|
private readonly lastDockStateSetting: Common.Settings.Setting<DockState>;
|
|
40
40
|
#dockSide: DockState|undefined = undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Incremented for every dock side change, so that responses from the embedder
|
|
43
|
+
* for superseded changes can be told apart from the response to the latest one.
|
|
44
|
+
*/
|
|
45
|
+
#dockSideChangeId = 0;
|
|
41
46
|
|
|
42
47
|
constructor(canDock: boolean) {
|
|
43
48
|
super();
|
|
@@ -62,13 +67,13 @@ export class DockController extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
62
67
|
return;
|
|
63
68
|
}
|
|
64
69
|
|
|
65
|
-
this.currentDockStateSetting.addChangeListener(this.dockSideChanged, this);
|
|
66
70
|
if (states.indexOf(this.currentDockStateSetting.get()) === -1) {
|
|
67
71
|
this.currentDockStateSetting.set(DockState.RIGHT);
|
|
68
72
|
}
|
|
69
73
|
if (states.indexOf(this.lastDockStateSetting.get()) === -1) {
|
|
70
|
-
this.
|
|
74
|
+
this.lastDockStateSetting.set(DockState.BOTTOM);
|
|
71
75
|
}
|
|
76
|
+
this.currentDockStateSetting.addChangeListener(this.dockSideChanged, this);
|
|
72
77
|
}
|
|
73
78
|
|
|
74
79
|
static instance(opts: {
|
|
@@ -137,13 +142,19 @@ export class DockController extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
137
142
|
console.timeStamp('DockController.setIsDocked');
|
|
138
143
|
this.#dockSide = dockSide;
|
|
139
144
|
this.currentDockStateSetting.set(dockSide);
|
|
145
|
+
const dockSideChangeId = ++this.#dockSideChangeId;
|
|
140
146
|
Host.InspectorFrontendHost.InspectorFrontendHostInstance.setIsDocked(
|
|
141
|
-
dockSide !== DockState.UNDOCKED, this.setIsDockedResponse.bind(this, eventData));
|
|
147
|
+
dockSide !== DockState.UNDOCKED, this.setIsDockedResponse.bind(this, eventData, dockSideChangeId));
|
|
142
148
|
this.closeButton.setVisible(this.#dockSide !== DockState.UNDOCKED);
|
|
143
149
|
this.dispatchEventToListeners(Events.DOCK_SIDE_CHANGED, eventData);
|
|
144
150
|
}
|
|
145
151
|
|
|
146
|
-
private setIsDockedResponse(eventData: ChangeEvent): void {
|
|
152
|
+
private setIsDockedResponse(eventData: ChangeEvent, dockSideChangeId: number): void {
|
|
153
|
+
if (dockSideChangeId !== this.#dockSideChangeId) {
|
|
154
|
+
// The dock side was changed again before the embedder acknowledged this change. Only report the
|
|
155
|
+
// latest change, otherwise listeners would finish a transition that is no longer current.
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
147
158
|
this.dispatchEventToListeners(Events.AFTER_DOCK_SIDE_CHANGED, eventData);
|
|
148
159
|
this.announceDockLocation();
|
|
149
160
|
}
|
|
@@ -177,6 +188,8 @@ const states = [DockState.RIGHT, DockState.BOTTOM, DockState.LEFT, DockState.UND
|
|
|
177
188
|
// Use BeforeDockSideChanged to do something before all the UI bits are updated,
|
|
178
189
|
// DockSideChanged to update UI, and AfterDockSideChanged to perform actions
|
|
179
190
|
// after frontend is docked/undocked in the browser.
|
|
191
|
+
// If the dock side changes again before the browser acknowledges a change,
|
|
192
|
+
// AfterDockSideChanged is only dispatched for the latest change.
|
|
180
193
|
|
|
181
194
|
export const enum Events {
|
|
182
195
|
BEFORE_DOCK_SIDE_CHANGED = 'BeforeDockSideChanged',
|
|
@@ -1995,7 +1995,7 @@ export class TreeViewElement extends HTMLElementWithLightDOMTemplate {
|
|
|
1995
1995
|
if (node === treeNode) {
|
|
1996
1996
|
treeElement.updateAttributes();
|
|
1997
1997
|
if (attributeName === 'selected' && hasBooleanAttribute(treeNode, 'selected')) {
|
|
1998
|
-
treeElement.revealAndSelect(
|
|
1998
|
+
treeElement.revealAndSelect(!this.hasFocus());
|
|
1999
1999
|
}
|
|
2000
2000
|
return;
|
|
2001
2001
|
}
|
|
@@ -2053,7 +2053,7 @@ export class TreeViewElement extends HTMLElementWithLightDOMTemplate {
|
|
|
2053
2053
|
parent.treeElement.updateExpansionFromAttribute();
|
|
2054
2054
|
}
|
|
2055
2055
|
if (hasBooleanAttribute(node, 'selected')) {
|
|
2056
|
-
treeElement.revealAndSelect(
|
|
2056
|
+
treeElement.revealAndSelect(!this.hasFocus());
|
|
2057
2057
|
}
|
|
2058
2058
|
if (parent.expanded) {
|
|
2059
2059
|
parent.treeElement.expand();
|
|
@@ -2183,13 +2183,7 @@ export class HTMLElementWithLightDOMTemplate extends HTMLElement {
|
|
|
2183
2183
|
|
|
2184
2184
|
static cloneNode(node: Node): Node {
|
|
2185
2185
|
const clone = node.cloneNode(false);
|
|
2186
|
-
|
|
2187
|
-
let cloneSet = HTMLElementWithLightDOMTemplate.#originalToClones.get(node);
|
|
2188
|
-
if (!cloneSet) {
|
|
2189
|
-
cloneSet = new Set();
|
|
2190
|
-
HTMLElementWithLightDOMTemplate.#originalToClones.set(node, cloneSet);
|
|
2191
|
-
}
|
|
2192
|
-
cloneSet.add(new WeakRef(clone));
|
|
2186
|
+
HTMLElementWithLightDOMTemplate.registerClone(node, clone);
|
|
2193
2187
|
|
|
2194
2188
|
for (const child of node.childNodes) {
|
|
2195
2189
|
clone.appendChild(HTMLElementWithLightDOMTemplate.cloneNode(child));
|
|
@@ -2204,6 +2198,24 @@ export class HTMLElementWithLightDOMTemplate extends HTMLElement {
|
|
|
2204
2198
|
return clone;
|
|
2205
2199
|
}
|
|
2206
2200
|
|
|
2201
|
+
/**
|
|
2202
|
+
* Declares `clone` as a rendered counterpart of `original`. `cloneNode` calls this for each
|
|
2203
|
+
* node it clones. Hosts call it for elements they render by other means, e.g. the tree calls
|
|
2204
|
+
* it for the list item that it creates for a `<li>` config element. Resolves `clonedRef`
|
|
2205
|
+
* directives bound to `original`.
|
|
2206
|
+
*/
|
|
2207
|
+
static registerClone(original: Node, clone: Node): void {
|
|
2208
|
+
let cloneSet = HTMLElementWithLightDOMTemplate.#originalToClones.get(original);
|
|
2209
|
+
if (!cloneSet) {
|
|
2210
|
+
cloneSet = new Set();
|
|
2211
|
+
HTMLElementWithLightDOMTemplate.#originalToClones.set(original, cloneSet);
|
|
2212
|
+
}
|
|
2213
|
+
cloneSet.add(new WeakRef(clone));
|
|
2214
|
+
if (original instanceof Element && clone instanceof Element) {
|
|
2215
|
+
ClonedRefDirective.notifyCloned(original, clone);
|
|
2216
|
+
}
|
|
2217
|
+
}
|
|
2218
|
+
|
|
2207
2219
|
static patchLitTemplate(template: Lit.LitTemplate): void {
|
|
2208
2220
|
const interceptingWrapper = Lit.Directive.directive(Lit.CustomDirectives.InterceptBindingDirective);
|
|
2209
2221
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -2244,9 +2256,11 @@ export class HTMLElementWithLightDOMTemplate extends HTMLElement {
|
|
|
2244
2256
|
return value;
|
|
2245
2257
|
}
|
|
2246
2258
|
if (Lit.isLitDirective(value)) {
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2259
|
+
if (value['_$litDirective$'] === ClonedRefDirective) {
|
|
2260
|
+
return value;
|
|
2261
|
+
}
|
|
2262
|
+
if (value['_$litDirective$'] === WidgetUtils.WidgetDirective) {
|
|
2263
|
+
value['_$litDirective$'] = UIUtilsWidgetDirective;
|
|
2250
2264
|
}
|
|
2251
2265
|
for (let i = 0; i < value.values.length; i++) {
|
|
2252
2266
|
const subvalue = value.values[i];
|
|
@@ -2355,6 +2369,130 @@ export class HTMLElementWithLightDOMTemplate extends HTMLElement {
|
|
|
2355
2369
|
}
|
|
2356
2370
|
}
|
|
2357
2371
|
|
|
2372
|
+
interface MutableRef {
|
|
2373
|
+
value?: Element;
|
|
2374
|
+
}
|
|
2375
|
+
|
|
2376
|
+
class ClonedRefDirective extends Lit.AsyncDirective.AsyncDirective {
|
|
2377
|
+
// The template elements that have a connected directive. `registerClone` notifies only those.
|
|
2378
|
+
static readonly #directivesByElement = new WeakMap<Element, Set<ClonedRefDirective>>();
|
|
2379
|
+
|
|
2380
|
+
#templateElement?: Element;
|
|
2381
|
+
#ref?: Lit.Directives.RefOrCallback;
|
|
2382
|
+
#lastElement?: WeakRef<Element>;
|
|
2383
|
+
|
|
2384
|
+
constructor(partInfo: Lit.AsyncDirective.PartInfo) {
|
|
2385
|
+
super(partInfo);
|
|
2386
|
+
if (partInfo.type !== Lit.AsyncDirective.PartType.ELEMENT) {
|
|
2387
|
+
throw new Error('The `clonedRef` directive must be bound to an element.');
|
|
2388
|
+
}
|
|
2389
|
+
}
|
|
2390
|
+
|
|
2391
|
+
/** Called by `HTMLElementWithLightDOMTemplate.registerClone`. Returns at once if no directive is bound. */
|
|
2392
|
+
static notifyCloned(templateElement: Element, clone: Element): void {
|
|
2393
|
+
const directives = ClonedRefDirective.#directivesByElement.get(templateElement);
|
|
2394
|
+
if (!directives) {
|
|
2395
|
+
return;
|
|
2396
|
+
}
|
|
2397
|
+
for (const directive of directives) {
|
|
2398
|
+
directive.#setElement(clone);
|
|
2399
|
+
}
|
|
2400
|
+
}
|
|
2401
|
+
|
|
2402
|
+
render(_ref?: Lit.Directives.RefOrCallback): typeof Lit.nothing {
|
|
2403
|
+
return Lit.nothing;
|
|
2404
|
+
}
|
|
2405
|
+
|
|
2406
|
+
override update(part: Lit.AsyncDirective.ElementPart, [ref]: Parameters<this['render']>): typeof Lit.nothing {
|
|
2407
|
+
if (this.#templateElement !== part.element) {
|
|
2408
|
+
this.#untrackTemplateElement();
|
|
2409
|
+
this.#templateElement = part.element;
|
|
2410
|
+
this.#trackTemplateElement();
|
|
2411
|
+
}
|
|
2412
|
+
if (ref !== this.#ref) {
|
|
2413
|
+
this.#setElement(undefined);
|
|
2414
|
+
this.#ref = ref;
|
|
2415
|
+
}
|
|
2416
|
+
if (this.#lastElement?.deref() === undefined) {
|
|
2417
|
+
// Bound after the host made the clone: resolve at once.
|
|
2418
|
+
this.#setElement(this.#currentClone());
|
|
2419
|
+
}
|
|
2420
|
+
return Lit.nothing;
|
|
2421
|
+
}
|
|
2422
|
+
|
|
2423
|
+
/** The newest live clone of the template element, for a directive bound after the clone was made. */
|
|
2424
|
+
#currentClone(): Element|undefined {
|
|
2425
|
+
if (!this.#templateElement) {
|
|
2426
|
+
return undefined;
|
|
2427
|
+
}
|
|
2428
|
+
const clones = HTMLElementWithLightDOMTemplate.getClones(this.#templateElement);
|
|
2429
|
+
for (let i = clones.length - 1; i >= 0; --i) {
|
|
2430
|
+
const clone = clones[i];
|
|
2431
|
+
if (clone instanceof Element) {
|
|
2432
|
+
return clone;
|
|
2433
|
+
}
|
|
2434
|
+
}
|
|
2435
|
+
return undefined;
|
|
2436
|
+
}
|
|
2437
|
+
|
|
2438
|
+
#setElement(element: Element|undefined): void {
|
|
2439
|
+
const ref = this.#ref;
|
|
2440
|
+
if (!ref) {
|
|
2441
|
+
return;
|
|
2442
|
+
}
|
|
2443
|
+
const previous = this.#lastElement?.deref();
|
|
2444
|
+
this.#lastElement = element ? new WeakRef(element) : undefined;
|
|
2445
|
+
if (typeof ref === 'function') {
|
|
2446
|
+
if (previous === element) {
|
|
2447
|
+
return;
|
|
2448
|
+
}
|
|
2449
|
+
if (previous !== undefined) {
|
|
2450
|
+
ref(undefined);
|
|
2451
|
+
}
|
|
2452
|
+
if (element !== undefined) {
|
|
2453
|
+
ref(element);
|
|
2454
|
+
}
|
|
2455
|
+
} else if (ref.value !== element) {
|
|
2456
|
+
const mutableRef: MutableRef = ref;
|
|
2457
|
+
mutableRef.value = element;
|
|
2458
|
+
}
|
|
2459
|
+
}
|
|
2460
|
+
|
|
2461
|
+
#trackTemplateElement(): void {
|
|
2462
|
+
if (!this.#templateElement) {
|
|
2463
|
+
return;
|
|
2464
|
+
}
|
|
2465
|
+
const directives = ClonedRefDirective.#directivesByElement;
|
|
2466
|
+
Platform.MapUtilities.getWithDefault(directives, this.#templateElement, () => new Set()).add(this);
|
|
2467
|
+
}
|
|
2468
|
+
|
|
2469
|
+
#untrackTemplateElement(): void {
|
|
2470
|
+
if (this.#templateElement) {
|
|
2471
|
+
ClonedRefDirective.#directivesByElement.get(this.#templateElement)?.delete(this);
|
|
2472
|
+
}
|
|
2473
|
+
}
|
|
2474
|
+
|
|
2475
|
+
protected override disconnected(): void {
|
|
2476
|
+
this.#untrackTemplateElement();
|
|
2477
|
+
this.#setElement(undefined);
|
|
2478
|
+
}
|
|
2479
|
+
|
|
2480
|
+
protected override reconnected(): void {
|
|
2481
|
+
this.#trackTemplateElement();
|
|
2482
|
+
this.#setElement(this.#currentClone());
|
|
2483
|
+
}
|
|
2484
|
+
}
|
|
2485
|
+
|
|
2486
|
+
/**
|
|
2487
|
+
* Sets a `Ref` object or calls a ref callback with the live element that a light DOM template host
|
|
2488
|
+
* rendered for the bound template element (see `HTMLElementWithLightDOMTemplate.registerClone`).
|
|
2489
|
+
* Resolves when the host registers the clone, or at once if the clone already exists. Calls a
|
|
2490
|
+
* callback with `undefined` before a new element and when the directive disconnects. Does not
|
|
2491
|
+
* resolve in standard `render()` calls that do not clone template elements.
|
|
2492
|
+
*/
|
|
2493
|
+
export const clonedRef: (_ref?: Lit.Directives.RefOrCallback) =>
|
|
2494
|
+
Lit.AsyncDirective.DirectiveResult<typeof ClonedRefDirective> = Lit.AsyncDirective.directive(ClonedRefDirective);
|
|
2495
|
+
|
|
2358
2496
|
/**
|
|
2359
2497
|
* @param text Text to copy to clipboard
|
|
2360
2498
|
* @param alert Message to send for a11y only required if there
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
|
|
137
137
|
svg.bezier-preset-modify {
|
|
138
138
|
background-color: var(--sys-color-cdt-base-container);
|
|
139
|
-
border-radius:
|
|
139
|
+
border-radius: var(--sys-shape-corner-full);
|
|
140
140
|
display: inline-block;
|
|
141
141
|
visibility: hidden;
|
|
142
142
|
transition: transform 100ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
@@ -191,7 +191,8 @@ svg.bezier-curve {
|
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
svg.bezier-curve.linear {
|
|
194
|
-
|
|
194
|
+
/* 50px curve overshoot headroom (--sys-size-16 + --sys-size-2) minus 8px svg.bezier-curve upward offset (--sys-size-5) = 42px. */
|
|
195
|
+
margin-top: calc(var(--sys-size-16) + var(--sys-size-2) - var(--sys-size-5));
|
|
195
196
|
overflow: visible;
|
|
196
197
|
}
|
|
197
198
|
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
height: auto;
|
|
50
50
|
width: auto;
|
|
51
51
|
max-width: var(--sys-size-19);
|
|
52
|
-
max-height:
|
|
52
|
+
max-height: var(--sys-size-16);
|
|
53
53
|
pointer-events: none;
|
|
54
|
-
box-shadow: 0 0
|
|
54
|
+
box-shadow: 0 0 var(--sys-size-3) var(--box-shadow-outline-color);
|
|
55
55
|
flex: 0 0 auto;
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -74,8 +74,8 @@ devtools-text-prompt {
|
|
|
74
74
|
.filtered-list-widget-item devtools-icon {
|
|
75
75
|
align-self: center;
|
|
76
76
|
flex: none;
|
|
77
|
-
width:
|
|
78
|
-
height:
|
|
77
|
+
width: var(--sys-size-9);
|
|
78
|
+
height: var(--sys-size-9);
|
|
79
79
|
|
|
80
80
|
&.snippet {
|
|
81
81
|
color: var(--sys-color-orange-bright);
|
|
@@ -120,8 +120,9 @@ devtools-text-prompt {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
.not-found-text {
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
display: flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
height: var(--sys-size-13);
|
|
125
126
|
padding-left: var(--sys-size-5);
|
|
126
127
|
font-style: italic;
|
|
127
128
|
color: var(--sys-color-state-disabled);
|
|
@@ -21,9 +21,6 @@ export class TargetDetachedDialog extends SDK.SDKModel.SDKModel<void> implements
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
workerScriptLoaded(): void {
|
|
25
|
-
}
|
|
26
|
-
|
|
27
24
|
detached({reason}: Protocol.Inspector.DetachedEvent): void {
|
|
28
25
|
UI.RemoteDebuggingTerminatedScreen.RemoteDebuggingTerminatedScreen.show(reason);
|
|
29
26
|
}
|
|
@@ -239,7 +239,7 @@ input::placeholder {
|
|
|
239
239
|
.harmony-input:not([type]),
|
|
240
240
|
.harmony-input[type='number'],
|
|
241
241
|
.harmony-input[type='text'] {
|
|
242
|
-
padding:
|
|
242
|
+
padding: var(--sys-size-2) var(--sys-size-4);
|
|
243
243
|
height: var(--sys-size-11);
|
|
244
244
|
border: var(--sys-size-1) solid var(--sys-color-neutral-outline);
|
|
245
245
|
border-radius: var(--sys-shape-corner-extra-small);
|
|
@@ -883,19 +883,6 @@ devtools-toolbar {
|
|
|
883
883
|
color: var(--icon-toggled);
|
|
884
884
|
}
|
|
885
885
|
|
|
886
|
-
.toolbar-state-on.toolbar-toggle-with-dot .toolbar-text::after {
|
|
887
|
-
content: '';
|
|
888
|
-
position: absolute;
|
|
889
|
-
bottom: var(--sys-size-2);
|
|
890
|
-
background-color: var(--sys-color-primary-bright);
|
|
891
|
-
width: 4.5px;
|
|
892
|
-
height: 4.5px;
|
|
893
|
-
border: var(--sys-size-2) solid
|
|
894
|
-
var(--override-toolbar-background-color, --sys-color-cdt-base-container);
|
|
895
|
-
border-radius: var(--sys-shape-corner-full);
|
|
896
|
-
right: 0;
|
|
897
|
-
}
|
|
898
|
-
|
|
899
886
|
.toolbar-button.toolbar-state-on.toolbar-toggle-with-red-color .toolbar-glyph,
|
|
900
887
|
.toolbar-button.toolbar-state-off.toolbar-default-with-red-color
|
|
901
888
|
.toolbar-glyph {
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
.drawer-tabbed-pane.drawer-minimized-vertical {
|
|
8
|
-
|
|
9
|
-
width:
|
|
8
|
+
/* 28px toolbar width minus 1px SplitWidget splitter border. */
|
|
9
|
+
min-width: calc(var(--sys-size-12) - var(--sys-size-1));
|
|
10
|
+
width: calc(var(--sys-size-12) - var(--sys-size-1));
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
.hide-element {
|
|
@@ -117,24 +117,6 @@
|
|
|
117
117
|
background-color: var(--sys-color-cdt-base-container);
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
.text-prompt-container {
|
|
121
|
-
padding: 3px var(--sys-size-4);
|
|
122
|
-
height: var(--sys-size-11);
|
|
123
|
-
border: none;
|
|
124
|
-
box-shadow: var(--legacy-focus-ring-inactive-shadow);
|
|
125
|
-
border-radius: var(--sys-size-2);
|
|
126
|
-
width: 100%;
|
|
127
|
-
background-color: var(--sys-color-cdt-base-container);
|
|
128
|
-
|
|
129
|
-
&:focus {
|
|
130
|
-
border: var(--sys-size-1) solid var(--sys-color-state-focus-ring);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
& .text-prompt {
|
|
134
|
-
width: 100%;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
120
|
@media (forced-colors: active) {
|
|
139
121
|
.list-item:focus-within .controls-buttons,
|
|
140
122
|
.list-item:hover .controls-buttons {
|