chrome-devtools-frontend 1.0.1518653 → 1.0.1520139
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/config/owner/COMMON_OWNERS +1 -2
- package/config/typescript/tsconfig.eslint.json +12 -1
- package/docs/ui_engineering.md +1011 -0
- package/eslint.config.mjs +1 -0
- package/front_end/core/host/GdpClient.ts +12 -3
- package/front_end/core/sdk/EnhancedTracesParser.ts +5 -5
- package/front_end/core/sdk/NetworkManager.ts +1 -0
- package/front_end/core/sdk/NetworkRequest.ts +10 -0
- package/front_end/core/sdk/RehydratingConnection.snapshot.txt +211 -0
- package/front_end/core/sdk/TargetManager.ts +4 -0
- package/front_end/entrypoints/main/MainImpl.ts +6 -1
- package/front_end/entrypoints/main/main-meta.ts +3 -3
- package/front_end/generated/SupportedCSSProperties.js +19 -4
- package/front_end/models/ai_assistance/agents/AiAgent.ts +57 -10
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +64 -87
- package/front_end/models/ai_assistance/agents/PerformanceAnnotationsAgent.ts +4 -4
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +0 -31
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +127 -29
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +106 -55
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +317 -640
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +23 -19
- package/front_end/models/ai_assistance/performance/AICallTree.snapshot.txt +75 -0
- package/front_end/models/ai_assistance/performance/AICallTree.ts +14 -6
- package/front_end/models/ai_assistance/performance/AIContext.ts +63 -8
- package/front_end/models/ai_code_completion/AiCodeCompletion.ts +5 -0
- package/front_end/models/badges/AiExplorerBadge.ts +19 -3
- package/front_end/models/badges/Badge.ts +8 -1
- package/front_end/models/badges/CodeWhispererBadge.ts +1 -0
- package/front_end/models/badges/DOMDetectiveBadge.ts +1 -0
- package/front_end/models/badges/SpeedsterBadge.ts +1 -0
- package/front_end/models/badges/StarterBadge.ts +6 -0
- package/front_end/models/badges/badges.ts +1 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +4 -0
- package/front_end/models/trace/EventsSerializer.ts +4 -3
- package/front_end/models/trace/handlers/UserInteractionsHandler.ts +101 -73
- package/front_end/models/trace/helpers/Timing.ts +1 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +18 -8
- package/front_end/panels/ai_assistance/PatchWidget.ts +17 -55
- package/front_end/panels/ai_assistance/components/ChatView.ts +44 -68
- package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +63 -15
- package/front_end/panels/ai_assistance/components/chatView.css +12 -0
- package/front_end/panels/animation/AnimationTimeline.ts +1 -1
- package/front_end/panels/animation/animationTimeline.css +4 -0
- package/front_end/panels/application/components/BounceTrackingMitigationsView.ts +2 -2
- package/front_end/panels/application/preloading/components/PreloadingString.ts +2 -5
- package/front_end/panels/common/AiCodeCompletionTeaser.ts +5 -0
- package/front_end/panels/common/BadgeNotification.ts +3 -3
- package/front_end/panels/common/GdpSignUpDialog.ts +3 -4
- package/front_end/panels/common/aiCodeCompletionTeaser.css +6 -1
- package/front_end/panels/console/ConsolePrompt.ts +6 -0
- package/front_end/panels/console/ConsoleView.ts +4 -2
- package/front_end/panels/coverage/CoverageListView.ts +133 -158
- package/front_end/panels/coverage/CoverageView.ts +39 -16
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +5 -5
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +2 -0
- package/front_end/panels/network/NetworkDataGridNode.ts +22 -0
- package/front_end/panels/network/NetworkLogViewColumns.ts +9 -0
- package/front_end/panels/recorder/components/CreateRecordingView.ts +2 -0
- package/front_end/panels/recorder/components/RecordingView.ts +2 -2
- package/front_end/panels/search/SearchResultsPane.ts +186 -134
- package/front_end/panels/search/SearchView.ts +42 -36
- package/front_end/panels/search/searchResultsPane.css +9 -0
- package/front_end/panels/search/searchView.css +0 -2
- package/front_end/panels/security/CookieControlsView.ts +2 -1
- package/front_end/panels/settings/AISettingsTab.ts +6 -3
- package/front_end/panels/settings/components/SyncSection.ts +26 -12
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +1 -1
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +4 -4
- package/front_end/panels/sources/DebuggerPlugin.ts +4 -0
- package/front_end/panels/sources/SourcesPanel.ts +1 -1
- package/front_end/panels/sources/sourcesView.css +6 -1
- package/front_end/panels/timeline/ThirdPartyTreeView.ts +1 -1
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +0 -8
- package/front_end/panels/timeline/TimelineFlameChartView.ts +5 -5
- package/front_end/panels/timeline/TimelinePanel.ts +2 -0
- package/front_end/panels/timeline/TimelineTreeView.ts +1 -1
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +1 -1
- package/front_end/panels/timeline/components/NetworkRequestDetails.ts +1 -1
- package/front_end/panels/timeline/components/RelatedInsightChips.ts +1 -1
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Realm.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PipeTransport.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PipeTransport.js +15 -16
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PipeTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Function.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Function.js +16 -25
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Function.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +19 -28
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.js +15 -16
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/Function.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/Function.js +16 -25
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/Function.js.map +1 -1
- package/front_end/third_party/puppeteer/package/package.json +12 -4
- package/front_end/third_party/puppeteer/package/src/generated/injected.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/generated/version.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/node/PipeTransport.ts +15 -17
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/Function.ts +22 -30
- package/front_end/tsconfig.json +12 -1
- package/front_end/ui/components/dialogs/Dialog.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownImage.ts +4 -5
- package/front_end/ui/components/switch/SwitchImpl.ts +12 -1
- package/front_end/ui/components/text_editor/config.ts +16 -2
- package/front_end/ui/legacy/InspectorView.ts +86 -13
- package/front_end/ui/legacy/TabbedPane.ts +2 -1
- package/front_end/ui/legacy/Treeoutline.ts +3 -1
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +12 -11
- package/front_end/ui/lit/i18n-template.ts +5 -2
- package/front_end/ui/visual_logging/KnownContextValues.ts +15 -5
- package/front_end/ui/visual_logging/LoggingEvents.ts +1 -1
- package/package.json +1 -1
@@ -4,6 +4,7 @@
|
|
4
4
|
|
5
5
|
import * as Common from '../../../core/common/common.js';
|
6
6
|
import * as SDK from '../../../core/sdk/sdk.js';
|
7
|
+
import type * as Protocol from '../../../generated/protocol.js';
|
7
8
|
import * as Trace from '../../../models/trace/trace.js';
|
8
9
|
import type * as Marked from '../../../third_party/marked/marked.js';
|
9
10
|
import * as Lit from '../../../ui/lit/lit.js';
|
@@ -11,32 +12,79 @@ import * as Lit from '../../../ui/lit/lit.js';
|
|
11
12
|
import {MarkdownRendererWithCodeBlock} from './MarkdownRendererWithCodeBlock.js';
|
12
13
|
|
13
14
|
const {html} = Lit;
|
15
|
+
const {ref, createRef} = Lit.Directives;
|
14
16
|
|
15
17
|
export class PerformanceAgentMarkdownRenderer extends MarkdownRendererWithCodeBlock {
|
16
|
-
constructor(
|
18
|
+
constructor(
|
19
|
+
private mainFrameId = '',
|
20
|
+
private lookupEvent: (key: Trace.Types.File.SerializableKey) => Trace.Types.Events.Event | null = () => null) {
|
17
21
|
super();
|
18
22
|
}
|
19
23
|
|
20
24
|
override templateForToken(token: Marked.Marked.MarkedToken): Lit.TemplateResult|null {
|
21
25
|
if (token.type === 'link' && token.href.startsWith('#')) {
|
26
|
+
if (token.href.startsWith('#node-')) {
|
27
|
+
const nodeId = Number(token.href.replace('#node-', '')) as Protocol.DOM.BackendNodeId;
|
28
|
+
|
29
|
+
const templateRef = createRef();
|
30
|
+
void this.#linkifyNode(nodeId, token.text).then(node => {
|
31
|
+
if (!templateRef.value || !node) {
|
32
|
+
return;
|
33
|
+
}
|
34
|
+
|
35
|
+
templateRef.value.textContent = '';
|
36
|
+
templateRef.value.append(node);
|
37
|
+
});
|
38
|
+
return html`<span ${ref(templateRef)}>${token.text}</span>`;
|
39
|
+
}
|
40
|
+
|
22
41
|
const event = this.lookupEvent(token.href.slice(1) as Trace.Types.File.SerializableKey);
|
23
|
-
if (event) {
|
24
|
-
|
25
|
-
let title = '';
|
26
|
-
if (Trace.Types.Events.isSyntheticNetworkRequest(event)) {
|
27
|
-
title = event.args.data.url;
|
28
|
-
} else {
|
29
|
-
label += ` (${event.name})`;
|
30
|
-
}
|
31
|
-
|
32
|
-
// eslint-disable-next-line rulesdir/no-a-tags-in-lit
|
33
|
-
return html`<a href="#" draggable=false .title=${title} @click=${(e: Event) => {
|
34
|
-
e.stopPropagation();
|
35
|
-
void Common.Revealer.reveal(new SDK.TraceObject.RevealableEvent(event));
|
36
|
-
}}>${label}</a>`;
|
42
|
+
if (!event) {
|
43
|
+
return html`${token.text}`;
|
37
44
|
}
|
45
|
+
|
46
|
+
let label = token.text;
|
47
|
+
let title = '';
|
48
|
+
if (Trace.Types.Events.isSyntheticNetworkRequest(event)) {
|
49
|
+
title = event.args.data.url;
|
50
|
+
} else {
|
51
|
+
label += ` (${event.name})`;
|
52
|
+
}
|
53
|
+
|
54
|
+
// eslint-disable-next-line rulesdir/no-a-tags-in-lit
|
55
|
+
return html`<a href="#" draggable=false .title=${title} @click=${(e: Event) => {
|
56
|
+
e.stopPropagation();
|
57
|
+
void Common.Revealer.reveal(new SDK.TraceObject.RevealableEvent(event));
|
58
|
+
}}>${label}</a>`;
|
38
59
|
}
|
39
60
|
|
40
61
|
return super.templateForToken(token);
|
41
62
|
}
|
63
|
+
|
64
|
+
// Taken from front_end/panels/timeline/components/insights/NodeLink.ts
|
65
|
+
// Would be nice to move the above component to somewhere that allows the AI
|
66
|
+
// Assistance panel to also use it.
|
67
|
+
async #linkifyNode(backendNodeId: Protocol.DOM.BackendNodeId, label: string): Promise<Node|undefined> {
|
68
|
+
if (backendNodeId === undefined) {
|
69
|
+
return;
|
70
|
+
}
|
71
|
+
|
72
|
+
const target = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
|
73
|
+
const domModel = target?.model(SDK.DOMModel.DOMModel);
|
74
|
+
if (!domModel) {
|
75
|
+
return undefined;
|
76
|
+
}
|
77
|
+
const domNodesMap = await domModel.pushNodesByBackendIdsToFrontend(new Set([backendNodeId]));
|
78
|
+
const node = domNodesMap?.get(backendNodeId);
|
79
|
+
if (!node) {
|
80
|
+
return;
|
81
|
+
}
|
82
|
+
|
83
|
+
if (node.frameId() !== this.mainFrameId) {
|
84
|
+
return;
|
85
|
+
}
|
86
|
+
|
87
|
+
const linkedNode = await Common.Linkifier.Linkifier.linkify(node, {textContent: label});
|
88
|
+
return linkedNode;
|
89
|
+
}
|
42
90
|
}
|
@@ -89,6 +89,18 @@
|
|
89
89
|
color: var(--sys-color-on-surface-subtle);
|
90
90
|
}
|
91
91
|
|
92
|
+
.info-tooltip-container {
|
93
|
+
max-width: var(--sys-size-28);
|
94
|
+
padding: var(--sys-size-4) var(--sys-size-5);
|
95
|
+
}
|
96
|
+
|
97
|
+
.tooltip-link {
|
98
|
+
display: block;
|
99
|
+
margin-top: var(--sys-size-4);
|
100
|
+
color: var(--sys-color-primary);
|
101
|
+
padding-left: 0;
|
102
|
+
}
|
103
|
+
|
92
104
|
.chat-input-container {
|
93
105
|
width: 100%;
|
94
106
|
display: flex;
|
@@ -282,7 +282,7 @@ export class AnimationTimeline extends UI.Widget.VBox implements
|
|
282
282
|
this.#playbackRate = 1;
|
283
283
|
this.#allPaused = false;
|
284
284
|
this.#animationGroupPausedBeforeScrub = false;
|
285
|
-
this.#toolbarViewContainer = this.contentElement.createChild('div');
|
285
|
+
this.#toolbarViewContainer = this.contentElement.createChild('div', 'toolbar-view-container');
|
286
286
|
this.createHeader();
|
287
287
|
this.#animationsContainer = this.contentElement.createChild('div', 'animation-timeline-rows');
|
288
288
|
this.#animationsContainer.setAttribute('jslog', `${VisualLogging.section('animations')}`);
|
@@ -146,9 +146,9 @@ export class BounceTrackingMitigationsView extends LegacyWrapper.LegacyWrapper.W
|
|
146
146
|
// clang-format on
|
147
147
|
}
|
148
148
|
|
149
|
-
#renderDeletedSitesOrNoSitesMessage(): Lit.
|
149
|
+
#renderDeletedSitesOrNoSitesMessage(): Lit.LitTemplate {
|
150
150
|
if (!this.#seenButtonClick) {
|
151
|
-
return
|
151
|
+
return Lit.nothing;
|
152
152
|
}
|
153
153
|
|
154
154
|
if (this.#trackingSites.length === 0) {
|
@@ -723,11 +723,8 @@ export function ruleSetLocationShort(
|
|
723
723
|
|
724
724
|
export function ruleSetTagOrLocationShort(
|
725
725
|
ruleSet: Protocol.Preload.RuleSet, pageURL: Platform.DevToolsPath.UrlString): string {
|
726
|
-
if (!ruleSet.errorMessage) {
|
727
|
-
|
728
|
-
if ('tag' in parsedRuleset) {
|
729
|
-
return '"' + parsedRuleset['tag'] + '"';
|
730
|
-
}
|
726
|
+
if (!ruleSet.errorMessage && ruleSet.tag) {
|
727
|
+
return '"' + ruleSet.tag + '"';
|
731
728
|
}
|
732
729
|
return ruleSetLocationShort(ruleSet, pageURL);
|
733
730
|
}
|
@@ -86,6 +86,7 @@ const UIStringsNotTranslate = {
|
|
86
86
|
|
87
87
|
const lockedString = i18n.i18n.lockedString;
|
88
88
|
const CODE_SNIPPET_WARNING_URL = 'https://support.google.com/legal/answer/13505487';
|
89
|
+
const PROMOTION_ID = 'ai-code-completion';
|
89
90
|
|
90
91
|
export interface ViewInput {
|
91
92
|
aidaAvailability?: Host.AidaClient.AidaAccessPreconditions;
|
@@ -106,10 +107,13 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
106
107
|
lockedString(UIStringsNotTranslate.i) + ' ' + lockedString(UIStringsNotTranslate.toTurnOnCodeSuggestions) + ' ' +
|
107
108
|
lockedString(UIStringsNotTranslate.press) + ' ' + cmdOrCtrl + ' ' + lockedString(UIStringsNotTranslate.x) + ' ' +
|
108
109
|
lockedString(UIStringsNotTranslate.toDisableCodeSuggestions);
|
110
|
+
const newBadge = UI.UIUtils.maybeCreateNewBadge(PROMOTION_ID);
|
111
|
+
const newBadgeTemplate = newBadge ? html` ${newBadge}` : nothing;
|
109
112
|
// clang-format off
|
110
113
|
render(
|
111
114
|
html`
|
112
115
|
<style>${styles}</style>
|
116
|
+
<style>@scope to (devtools-widget > *) { ${UI.inspectorCommonStyles} }</style>
|
113
117
|
<div class="ai-code-completion-teaser-screen-reader-only">${teaserAriaLabel}</div>
|
114
118
|
<div class="ai-code-completion-teaser" aria-hidden="true">
|
115
119
|
<span class="ai-code-completion-teaser-action">
|
@@ -121,6 +125,7 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
121
125
|
jslog=${VisualLogging.action('ai-code-completion-teaser.dismiss').track({click: true})}>
|
122
126
|
${lockedString(UIStringsNotTranslate.dontShowAgain)}
|
123
127
|
</span>
|
128
|
+
${newBadgeTemplate}
|
124
129
|
</div>
|
125
130
|
`, target
|
126
131
|
);
|
@@ -211,7 +211,7 @@ export class BadgeNotification extends UI.Widget.Widget {
|
|
211
211
|
this.#show({
|
212
212
|
message: i18nFormatString(
|
213
213
|
UIStrings.starterBadgeAwardMessageSettingDisabled, {PH1: badge.title, PH2: googleDeveloperProgramLink}),
|
214
|
-
jslogContext: badge.
|
214
|
+
jslogContext: badge.jslogContext,
|
215
215
|
actions: [
|
216
216
|
{
|
217
217
|
label: i18nString(UIStrings.remindMeLater),
|
@@ -240,7 +240,7 @@ export class BadgeNotification extends UI.Widget.Widget {
|
|
240
240
|
this.#show({
|
241
241
|
message: i18nFormatString(
|
242
242
|
UIStrings.starterBadgeAwardMessageNoGdpProfile, {PH1: badge.title, PH2: googleDeveloperProgramLink}),
|
243
|
-
jslogContext: badge.
|
243
|
+
jslogContext: badge.jslogContext,
|
244
244
|
actions: [
|
245
245
|
{
|
246
246
|
label: i18nString(UIStrings.remindMeLater),
|
@@ -270,7 +270,7 @@ export class BadgeNotification extends UI.Widget.Widget {
|
|
270
270
|
#presentActivityBasedBadge(badge: Badges.Badge): void {
|
271
271
|
this.#show({
|
272
272
|
message: i18nString(UIStrings.activityBasedBadgeAwardMessage, {PH1: badge.title}),
|
273
|
-
jslogContext: badge.
|
273
|
+
jslogContext: badge.jslogContext,
|
274
274
|
actions: [
|
275
275
|
{
|
276
276
|
label: i18nString(UIStrings.manageSettings),
|
@@ -14,7 +14,6 @@ import * as Snackbars from '../../ui/components/snackbars/snackbars.js';
|
|
14
14
|
import type * as Switch from '../../ui/components/switch/switch.js';
|
15
15
|
import * as UI from '../../ui/legacy/legacy.js';
|
16
16
|
import {html, render} from '../../ui/lit/lit.js';
|
17
|
-
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
18
17
|
|
19
18
|
import styles from './gdpSignUpDialog.css.js';
|
20
19
|
|
@@ -114,7 +113,7 @@ export const DEFAULT_VIEW: View = (input, _output, target): void => {
|
|
114
113
|
render(
|
115
114
|
html`
|
116
115
|
<style>${styles}</style>
|
117
|
-
<div class="gdp-sign-up-dialog-header" role="img"
|
116
|
+
<div class="gdp-sign-up-dialog-header" role="img" aria-label="Google Developer Program"></div>
|
118
117
|
<div class="main-content">
|
119
118
|
<div class="section">
|
120
119
|
<div class="icon-container">
|
@@ -136,9 +135,9 @@ export const DEFAULT_VIEW: View = (input, _output, target): void => {
|
|
136
135
|
<div class="switch-container">
|
137
136
|
<devtools-switch
|
138
137
|
.checked=${input.keepMeUpdated}
|
138
|
+
.jslogContext=${'keep-me-updated'}
|
139
|
+
.label=${i18nString(UIStrings.keepUpdated)}
|
139
140
|
@switchchange=${(e: Switch.Switch.SwitchChangeEvent) => input.onKeepMeUpdatedChange(e.checked)}
|
140
|
-
jslog=${VisualLogging.toggle('keep-me-updated').track({ click: true })}
|
141
|
-
aria-label=${i18nString(UIStrings.keepUpdated)}
|
142
141
|
>
|
143
142
|
</devtools-switch>
|
144
143
|
</div>
|
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
.ai-code-completion-teaser {
|
20
20
|
padding-left: var(--sys-size-3);
|
21
|
-
line-height:
|
21
|
+
line-height: var(--sys-size-7);
|
22
22
|
pointer-events: all;
|
23
23
|
align-items: center;
|
24
24
|
font-style: italic;
|
@@ -38,5 +38,10 @@
|
|
38
38
|
padding: 0 var(--sys-size-3);
|
39
39
|
}
|
40
40
|
}
|
41
|
+
|
42
|
+
.new-badge {
|
43
|
+
font-style: normal;
|
44
|
+
display: inline-block;
|
45
|
+
}
|
41
46
|
}
|
42
47
|
}
|
@@ -9,6 +9,7 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
9
9
|
import * as Root from '../../core/root/root.js';
|
10
10
|
import * as SDK from '../../core/sdk/sdk.js';
|
11
11
|
import * as AiCodeCompletion from '../../models/ai_code_completion/ai_code_completion.js';
|
12
|
+
import * as Badges from '../../models/badges/badges.js';
|
12
13
|
import * as Formatter from '../../models/formatter/formatter.js';
|
13
14
|
import * as SourceMapScopes from '../../models/source_map_scopes/source_map_scopes.js';
|
14
15
|
import * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';
|
@@ -317,6 +318,10 @@ export class ConsolePrompt extends Common.ObjectWrapper.eventMixin<EventTypes, t
|
|
317
318
|
CodeMirror.closeCompletion(this.editor.editor);
|
318
319
|
}
|
319
320
|
|
321
|
+
clearAiCodeCompletionCache(): void {
|
322
|
+
this.aiCodeCompletion?.clearCachedRequest();
|
323
|
+
}
|
324
|
+
|
320
325
|
moveCaretToEndOfPrompt(): void {
|
321
326
|
this.editor.dispatch({
|
322
327
|
selection: CodeMirror.EditorSelection.cursor(this.editor.state.doc.length),
|
@@ -474,6 +479,7 @@ export class ConsolePrompt extends Common.ObjectWrapper.eventMixin<EventTypes, t
|
|
474
479
|
void this.evaluateCommandInConsole(executionContext, message, expression, useCommandLineAPI);
|
475
480
|
if (ConsolePanel.instance().isShowing()) {
|
476
481
|
Host.userMetrics.actionTaken(Host.UserMetrics.Action.CommandEvaluatedInConsolePanel);
|
482
|
+
Badges.UserBadges.instance().recordAction(Badges.BadgeAction.CONSOLE_PROMPT_EXECUTED);
|
477
483
|
}
|
478
484
|
}
|
479
485
|
}
|
@@ -657,8 +657,9 @@ export class ConsoleView extends UI.Widget.VBox implements
|
|
657
657
|
this.aiCodeCompletionSummaryToolbar?.setLoading(false);
|
658
658
|
}
|
659
659
|
|
660
|
-
|
660
|
+
clearConsole(): void {
|
661
661
|
SDK.ConsoleModel.ConsoleModel.requestClearMessages();
|
662
|
+
this.prompt.clearAiCodeCompletionCache();
|
662
663
|
}
|
663
664
|
|
664
665
|
#onIssuesCountUpdate(): void {
|
@@ -704,6 +705,7 @@ export class ConsoleView extends UI.Widget.VBox implements
|
|
704
705
|
|
705
706
|
clearHistory(): void {
|
706
707
|
this.prompt.history().clear();
|
708
|
+
this.prompt.clearAiCodeCompletionCache();
|
707
709
|
}
|
708
710
|
|
709
711
|
private consoleHistoryAutocompleteChanged(): void {
|
@@ -1922,7 +1924,7 @@ export class ActionDelegate implements UI.ActionRegistration.ActionDelegate {
|
|
1922
1924
|
ConsoleView.instance().focusPrompt();
|
1923
1925
|
return true;
|
1924
1926
|
case 'console.clear':
|
1925
|
-
ConsoleView.clearConsole();
|
1927
|
+
ConsoleView.instance().clearConsole();
|
1926
1928
|
return true;
|
1927
1929
|
case 'console.clear.history':
|
1928
1930
|
ConsoleView.instance().clearHistory();
|