chrome-devtools-frontend 1.0.1529186 → 1.0.1530564
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/eslint.config.mjs +1 -1
- package/front_end/core/common/Gzip.ts +10 -8
- package/front_end/core/common/Worker.ts +10 -2
- package/front_end/core/host/AidaClient.ts +3 -3
- package/front_end/core/host/InspectorFrontendHostAPI.ts +1 -2
- package/front_end/core/sdk/NetworkManager.ts +25 -1
- package/front_end/core/sdk/SourceMap.ts +10 -0
- package/front_end/entrypoints/main/main-meta.ts +2 -0
- package/front_end/entrypoints/trace_app/trace_app.ts +1 -0
- package/front_end/generated/SupportedCSSProperties.js +14 -0
- package/front_end/models/ai_assistance/performance/AICallTree.ts +2 -3
- package/front_end/models/ai_code_completion/AiCodeCompletion.ts +3 -3
- package/front_end/models/bindings/CompilerScriptMapping.ts +54 -4
- package/front_end/models/formatter/FormatterWorkerPool.ts +17 -1
- package/front_end/models/javascript_metadata/NativeFunctions.js +1 -1
- package/front_end/models/trace/ModelImpl.ts +8 -3
- package/front_end/models/trace/handlers/MetaHandler.ts +9 -1
- package/front_end/models/trace/types/Configuration.ts +1 -0
- package/front_end/panels/browser_debugger/browser_debugger-meta.ts +2 -1
- package/front_end/panels/changes/CombinedDiffView.ts +1 -2
- package/front_end/panels/console/ConsoleInsightTeaser.ts +19 -9
- package/front_end/panels/console/ConsolePrompt.ts +11 -3
- package/front_end/panels/console/ConsoleViewMessage.ts +7 -5
- package/front_end/panels/console/consoleInsightTeaser.css +0 -4
- package/front_end/panels/console/consolePrompt.css +3 -2
- package/front_end/panels/console/consoleView.css +10 -5
- package/front_end/panels/elements/ElementsTreeOutline.ts +1 -2
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +137 -37
- package/front_end/panels/mobile_throttling/ThrottlingPresets.ts +1 -1
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +10 -5
- package/front_end/panels/sources/SourcesPanel.ts +5 -0
- package/front_end/panels/sources/sources-meta.ts +13 -12
- package/front_end/panels/sources/sourcesView.css +1 -0
- package/front_end/panels/timeline/TimelinePanel.ts +3 -3
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +1 -2
- package/front_end/panels/timeline/TimelineTreeView.ts +3 -3
- package/front_end/panels/timeline/TimelineUIUtils.ts +16 -16
- package/front_end/services/tracing/FreshRecording.ts +4 -0
- 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/cdp/Accessibility.js +16 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js +9 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/util.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/util.js.map +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.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js +12 -5
- 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/NodeWebSocketTransport.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/NodeWebSocketTransport.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/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +13 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +40 -14
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js +16 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js +9 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/util.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js +12 -5
- 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/NodeWebSocketTransport.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.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/version.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +10 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/package.json +4 -4
- package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +18 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +9 -1
- package/front_end/third_party/puppeteer/package/src/cdp/BrowserConnector.ts +2 -0
- package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +8 -0
- package/front_end/third_party/puppeteer/package/src/common/util.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +16 -5
- package/front_end/third_party/puppeteer/package/src/node/NodeWebSocketTransport.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/version.ts +10 -0
- package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +1 -1
- package/front_end/ui/components/icon_button/Icon.docs.ts +78 -0
- package/front_end/ui/components/markdown_view/CodeBlock.ts +2 -2
- package/front_end/ui/components/text_editor/config.ts +3 -3
- package/front_end/ui/components/tooltips/Tooltip.ts +9 -4
- package/front_end/ui/legacy/UIUtils.ts +12 -0
- package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +1 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
- package/package.json +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts +0 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js +0 -8
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts +0 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js +0 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js.map +0 -1
- package/front_end/third_party/puppeteer/package/src/generated/version.ts +0 -4
- package/front_end/ui/components/copy_to_clipboard/copyToClipboard.ts +0 -19
- package/front_end/ui/components/copy_to_clipboard/copy_to_clipboard.ts +0 -5
- package/front_end/ui/components/docs/icon_component/basic.html +0 -40
- package/front_end/ui/components/docs/icon_component/basic.ts +0 -68
package/eslint.config.mjs
CHANGED
|
@@ -810,7 +810,7 @@ export default defineConfig([
|
|
|
810
810
|
},
|
|
811
811
|
{
|
|
812
812
|
name: 'Front-end component docs',
|
|
813
|
-
files: ['front_end/ui/components/docs/**/*.ts'],
|
|
813
|
+
files: ['front_end/ui/components/docs/**/*.ts', '**/*.docs.ts'],
|
|
814
814
|
rules: {
|
|
815
815
|
// This makes the component doc examples very verbose and doesn't add
|
|
816
816
|
// anything, so we leave return types to the developer within the
|
|
@@ -49,16 +49,18 @@ export async function compress(str: string): Promise<ArrayBuffer> {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
/** Private coder/decoder **/
|
|
52
|
-
function gzipCodec(
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
async function gzipCodec(
|
|
53
|
+
buffer: Uint8Array<ArrayBufferLike>|ArrayBuffer,
|
|
54
|
+
codecStream: CompressionStream|DecompressionStream): Promise<ArrayBuffer> {
|
|
55
|
+
const readable = new ReadableStream({
|
|
56
|
+
start(controller) {
|
|
57
|
+
controller.enqueue(buffer);
|
|
58
|
+
controller.close();
|
|
59
|
+
}
|
|
60
|
+
});
|
|
55
61
|
const codecReadable = readable.pipeThrough(codecStream);
|
|
56
|
-
|
|
57
|
-
const writer = writable.getWriter();
|
|
58
|
-
void writer.write(buffer);
|
|
59
|
-
void writer.close();
|
|
60
62
|
// A response is a convenient way to get an ArrayBuffer from a ReadableStream.
|
|
61
|
-
return new Response(codecReadable).arrayBuffer();
|
|
63
|
+
return await new Response(codecReadable).arrayBuffer();
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
export function decompressStream(stream: ReadableStream): ReadableStream {
|
|
@@ -5,10 +5,15 @@
|
|
|
5
5
|
export class WorkerWrapper {
|
|
6
6
|
readonly #workerPromise: Promise<Worker>;
|
|
7
7
|
#disposed?: boolean;
|
|
8
|
+
#rejectWorkerPromise?: (error: Error) => void;
|
|
8
9
|
|
|
9
10
|
private constructor(workerLocation: URL) {
|
|
10
|
-
this.#workerPromise = new Promise(fulfill => {
|
|
11
|
+
this.#workerPromise = new Promise((fulfill, reject) => {
|
|
12
|
+
this.#rejectWorkerPromise = reject;
|
|
11
13
|
const worker = new Worker(workerLocation, {type: 'module'});
|
|
14
|
+
worker.onerror = event => {
|
|
15
|
+
console.error(`Failed to load worker for ${workerLocation.href}:`, event);
|
|
16
|
+
};
|
|
12
17
|
worker.onmessage = (event: MessageEvent<unknown>) => {
|
|
13
18
|
console.assert(event.data === 'workerReady');
|
|
14
19
|
worker.onmessage = null;
|
|
@@ -34,7 +39,10 @@ export class WorkerWrapper {
|
|
|
34
39
|
void this.#workerPromise.then(worker => worker.terminate());
|
|
35
40
|
}
|
|
36
41
|
|
|
37
|
-
terminate(): void {
|
|
42
|
+
terminate(immediately = false): void {
|
|
43
|
+
if (immediately) {
|
|
44
|
+
this.#rejectWorkerPromise?.(new Error('Worker terminated'));
|
|
45
|
+
}
|
|
38
46
|
this.dispose();
|
|
39
47
|
}
|
|
40
48
|
|
|
@@ -279,7 +279,7 @@ export interface DoConversationClientEvent {
|
|
|
279
279
|
|
|
280
280
|
export interface UserImpression {
|
|
281
281
|
sample: {
|
|
282
|
-
sample_id
|
|
282
|
+
sample_id?: number,
|
|
283
283
|
};
|
|
284
284
|
latency: {
|
|
285
285
|
duration: {
|
|
@@ -291,7 +291,7 @@ export interface UserImpression {
|
|
|
291
291
|
|
|
292
292
|
export interface UserAcceptance {
|
|
293
293
|
sample: {
|
|
294
|
-
sample_id
|
|
294
|
+
sample_id?: number,
|
|
295
295
|
};
|
|
296
296
|
}
|
|
297
297
|
|
|
@@ -366,7 +366,7 @@ export interface CompletionResponse {
|
|
|
366
366
|
export interface GenerationSample {
|
|
367
367
|
generationString: string;
|
|
368
368
|
score: number;
|
|
369
|
-
sampleId
|
|
369
|
+
sampleId?: number;
|
|
370
370
|
attributionMetadata?: AttributionMetadata;
|
|
371
371
|
}
|
|
372
372
|
|
|
@@ -346,8 +346,7 @@ export interface InspectorFrontendHostAPI {
|
|
|
346
346
|
closeWindow(): void;
|
|
347
347
|
|
|
348
348
|
/**
|
|
349
|
-
*
|
|
350
|
-
* @deprecated Marked to restrict usage.
|
|
349
|
+
* If you need to alert to the user after copying use {@link UIUtils.copyTextToClipboard}.
|
|
351
350
|
*/
|
|
352
351
|
copyText(text: string|null|undefined): void;
|
|
353
352
|
|
|
@@ -67,6 +67,10 @@ const UIStrings = {
|
|
|
67
67
|
* @description Text in Network Manager representing the "Fast 4G" throttling preset
|
|
68
68
|
*/
|
|
69
69
|
fast4G: 'Fast 4G',
|
|
70
|
+
/**
|
|
71
|
+
* @description Text in Network Manager representing the "Blocking" throttling preset
|
|
72
|
+
*/
|
|
73
|
+
block: 'Block',
|
|
70
74
|
/**
|
|
71
75
|
* @description Text in Network Manager
|
|
72
76
|
* @example {https://example.com} PH1
|
|
@@ -459,6 +463,12 @@ export interface EventTypes {
|
|
|
459
463
|
* @see https://crbug.com/342406608#comment10 for context around the addition of 4G presets in June 2024.
|
|
460
464
|
*/
|
|
461
465
|
|
|
466
|
+
export const BlockingConditions: ThrottlingConditions = {
|
|
467
|
+
key: PredefinedThrottlingConditionKey.BLOCKING,
|
|
468
|
+
block: true,
|
|
469
|
+
title: i18nLazyString(UIStrings.block),
|
|
470
|
+
};
|
|
471
|
+
|
|
462
472
|
export const NoThrottlingConditions: Conditions = {
|
|
463
473
|
key: PredefinedThrottlingConditionKey.NO_THROTTLING,
|
|
464
474
|
title: i18nLazyString(UIStrings.noThrottling),
|
|
@@ -2466,7 +2476,15 @@ class ExtraInfoBuilder {
|
|
|
2466
2476
|
|
|
2467
2477
|
SDKModel.register(NetworkManager, {capabilities: Capability.NETWORK, autostart: true});
|
|
2468
2478
|
|
|
2469
|
-
export function networkConditionsEqual(first:
|
|
2479
|
+
export function networkConditionsEqual(first: ThrottlingConditions, second: ThrottlingConditions): boolean {
|
|
2480
|
+
if ('block' in first || 'block' in second) {
|
|
2481
|
+
if ('block' in first && 'block' in second) {
|
|
2482
|
+
const firstTitle = (typeof first.title === 'function' ? first.title() : first.title);
|
|
2483
|
+
const secondTitle = (typeof second.title === 'function' ? second.title() : second.title);
|
|
2484
|
+
return firstTitle === secondTitle && first.block === second.block;
|
|
2485
|
+
}
|
|
2486
|
+
return false;
|
|
2487
|
+
}
|
|
2470
2488
|
// Caution: titles might be different function instances, which produce
|
|
2471
2489
|
// the same value.
|
|
2472
2490
|
// We prefer to use the i18nTitleKey to prevent against locale changes or
|
|
@@ -2493,6 +2511,7 @@ export function networkConditionsEqual(first: Conditions, second: Conditions): b
|
|
|
2493
2511
|
* please talk to jacktfranklin@ first.
|
|
2494
2512
|
*/
|
|
2495
2513
|
export const enum PredefinedThrottlingConditionKey {
|
|
2514
|
+
BLOCKING = 'BLOCKING',
|
|
2496
2515
|
NO_THROTTLING = 'NO_THROTTLING',
|
|
2497
2516
|
OFFLINE = 'OFFLINE',
|
|
2498
2517
|
SPEED_3G = 'SPEED_3G',
|
|
@@ -2525,6 +2544,11 @@ export function getPredefinedCondition(key: ThrottlingConditionKey): Conditions|
|
|
|
2525
2544
|
return THROTTLING_CONDITIONS_LOOKUP.get(key) ?? null;
|
|
2526
2545
|
}
|
|
2527
2546
|
|
|
2547
|
+
export type ThrottlingConditions = Conditions|{
|
|
2548
|
+
readonly key: ThrottlingConditionKey,
|
|
2549
|
+
block: true,
|
|
2550
|
+
title: string | (() => string),
|
|
2551
|
+
};
|
|
2528
2552
|
export interface Conditions {
|
|
2529
2553
|
readonly key: ThrottlingConditionKey;
|
|
2530
2554
|
download: number;
|
|
@@ -779,6 +779,16 @@ export class SourceMap {
|
|
|
779
779
|
this.#ensureSourceMapProcessed();
|
|
780
780
|
return this.#scopesInfo?.findOriginalFunctionName(position) ?? null;
|
|
781
781
|
}
|
|
782
|
+
|
|
783
|
+
isOutlinedFrame(generatedLine: number, generatedColumn: number): boolean {
|
|
784
|
+
this.#ensureSourceMapProcessed();
|
|
785
|
+
return this.#scopesInfo?.isOutlinedFrame(generatedLine, generatedColumn) ?? false;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
hasInlinedFrames(generatedLine: number, generatedColumn: number): boolean {
|
|
789
|
+
this.#ensureSourceMapProcessed();
|
|
790
|
+
return this.#scopesInfo?.hasInlinedFrames(generatedLine, generatedColumn) ?? false;
|
|
791
|
+
}
|
|
782
792
|
}
|
|
783
793
|
|
|
784
794
|
const VLQ_BASE_SHIFT = 5;
|
|
@@ -6,6 +6,7 @@ import * as Common from '../../core/common/common.js';
|
|
|
6
6
|
import * as Host from '../../core/host/host.js';
|
|
7
7
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
8
8
|
import type * as Platform from '../../core/platform/platform.js';
|
|
9
|
+
import * as Root from '../../core/root/root.js';
|
|
9
10
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
10
11
|
import * as Workspace from '../../models/workspace/workspace.js';
|
|
11
12
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
@@ -935,6 +936,7 @@ UI.Toolbar.registerToolbarItem({
|
|
|
935
936
|
});
|
|
936
937
|
|
|
937
938
|
UI.Toolbar.registerToolbarItem({
|
|
939
|
+
condition: () => !Root.Runtime.Runtime.isTraceApp(),
|
|
938
940
|
async loadItem() {
|
|
939
941
|
const Main = await loadMainModule();
|
|
940
942
|
return Main.MainImpl.MainMenuItem.instance();
|
|
@@ -18,6 +18,7 @@ import '../../panels/sources/sources-meta.js';
|
|
|
18
18
|
// sdk/emulation depends on panels/sensors: crbug.com/1376652
|
|
19
19
|
import '../../panels/sensors/sensors-meta.js';
|
|
20
20
|
import '../../panels/timeline/timeline-meta.js';
|
|
21
|
+
import '../../panels/ai_assistance/ai_assistance-meta.js';
|
|
21
22
|
import '../../ui/legacy/components/perf_ui/perf_ui-meta.js';
|
|
22
23
|
import '../../ui/legacy/components/quick_open/quick_open-meta.js';
|
|
23
24
|
import '../../ui/legacy/components/source_frame/source_frame-meta.js';
|
|
@@ -3759,6 +3759,13 @@ export const generatedProperties = [
|
|
|
3759
3759
|
],
|
|
3760
3760
|
"name": "rule"
|
|
3761
3761
|
},
|
|
3762
|
+
{
|
|
3763
|
+
"longhands": [
|
|
3764
|
+
"row-rule-break",
|
|
3765
|
+
"column-rule-break"
|
|
3766
|
+
],
|
|
3767
|
+
"name": "rule-break"
|
|
3768
|
+
},
|
|
3762
3769
|
{
|
|
3763
3770
|
"longhands": [
|
|
3764
3771
|
"column-rule-color",
|
|
@@ -3766,6 +3773,13 @@ export const generatedProperties = [
|
|
|
3766
3773
|
],
|
|
3767
3774
|
"name": "rule-color"
|
|
3768
3775
|
},
|
|
3776
|
+
{
|
|
3777
|
+
"longhands": [
|
|
3778
|
+
"row-rule-outset",
|
|
3779
|
+
"column-rule-outset"
|
|
3780
|
+
],
|
|
3781
|
+
"name": "rule-outset"
|
|
3782
|
+
},
|
|
3769
3783
|
{
|
|
3770
3784
|
"longhands": [
|
|
3771
3785
|
"column-rule-style",
|
|
@@ -2,7 +2,6 @@
|
|
|
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 * as Root from '../../../core/root/root.js';
|
|
6
5
|
import * as Trace from '../../../models/trace/trace.js';
|
|
7
6
|
import * as SourceMapsResolver from '../../../models/trace_source_maps_resolver/trace_source_maps_resolver.js';
|
|
8
7
|
|
|
@@ -144,7 +143,7 @@ export class AICallTree {
|
|
|
144
143
|
return null;
|
|
145
144
|
}
|
|
146
145
|
|
|
147
|
-
const
|
|
146
|
+
const showAllEvents = parsedTrace.data.Meta.config.showAllEvents;
|
|
148
147
|
const {startTime, endTime} = Trace.Helpers.Timing.eventTimingsMilliSeconds(selectedEvent);
|
|
149
148
|
const selectedEventBounds = Trace.Helpers.Timing.traceWindowFromMicroSeconds(
|
|
150
149
|
Trace.Helpers.Timing.milliToMicro(startTime), Trace.Helpers.Timing.milliToMicro(endTime));
|
|
@@ -166,7 +165,7 @@ export class AICallTree {
|
|
|
166
165
|
// If the "Show all events" experiment is on, we don't filter out any
|
|
167
166
|
// events here, otherwise the generated call tree will not match what the
|
|
168
167
|
// user is seeing.
|
|
169
|
-
if (!
|
|
168
|
+
if (!showAllEvents) {
|
|
170
169
|
filters.push(new Trace.Extras.TraceFilter.VisibleEventsFilter(Trace.Styles.visibleTypes()));
|
|
171
170
|
}
|
|
172
171
|
|
|
@@ -257,10 +257,10 @@ export class AiCodeCompletion extends Common.ObjectWrapper.ObjectWrapper<EventTy
|
|
|
257
257
|
|
|
258
258
|
async #generateSampleForRequest(request: Host.AidaClient.CompletionRequest, cursor: number): Promise<{
|
|
259
259
|
suggestionText: string,
|
|
260
|
-
sampleId: number,
|
|
261
260
|
fromCache: boolean,
|
|
262
261
|
citations: Host.AidaClient.Citation[],
|
|
263
262
|
rpcGlobalId?: Host.AidaClient.RpcGlobalId,
|
|
263
|
+
sampleId?: number,
|
|
264
264
|
}|null> {
|
|
265
265
|
const {response, fromCache} = await this.#completeCodeCached(request);
|
|
266
266
|
debugLog('At cursor position', cursor, {request, response, fromCache});
|
|
@@ -417,7 +417,7 @@ export class AiCodeCompletion extends Common.ObjectWrapper.ObjectWrapper<EventTy
|
|
|
417
417
|
this.#aidaRequestCache = {request, response};
|
|
418
418
|
}
|
|
419
419
|
|
|
420
|
-
#registerUserImpression(rpcGlobalId: Host.AidaClient.RpcGlobalId,
|
|
420
|
+
#registerUserImpression(rpcGlobalId: Host.AidaClient.RpcGlobalId, latency: number, sampleId?: number): void {
|
|
421
421
|
const seconds = Math.floor(latency / 1_000);
|
|
422
422
|
const remainingMs = latency % 1_000;
|
|
423
423
|
const nanos = Math.floor(remainingMs * 1_000_000);
|
|
@@ -443,7 +443,7 @@ export class AiCodeCompletion extends Common.ObjectWrapper.ObjectWrapper<EventTy
|
|
|
443
443
|
Host.userMetrics.actionTaken(Host.UserMetrics.Action.AiCodeCompletionSuggestionDisplayed);
|
|
444
444
|
}
|
|
445
445
|
|
|
446
|
-
registerUserAcceptance(rpcGlobalId: Host.AidaClient.RpcGlobalId, sampleId
|
|
446
|
+
registerUserAcceptance(rpcGlobalId: Host.AidaClient.RpcGlobalId, sampleId?: number): void {
|
|
447
447
|
void this.#aidaClient.registerClientEvent({
|
|
448
448
|
corresponding_aida_rpc_global_id: rpcGlobalId,
|
|
449
449
|
disable_user_content_logging: true,
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import * as Platform from '../../core/platform/platform.js';
|
|
7
7
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
8
|
-
|
|
8
|
+
// eslint-disable-next-line rulesdir/es-modules-import
|
|
9
|
+
import * as StackTraceImpl from '../stack_trace/stack_trace_impl.js';
|
|
9
10
|
import * as TextUtils from '../text_utils/text_utils.js';
|
|
10
11
|
import * as Workspace from '../workspace/workspace.js';
|
|
11
12
|
|
|
@@ -43,12 +44,14 @@ export class CompilerScriptMapping implements DebuggerSourceMapping {
|
|
|
43
44
|
readonly #sourceMapToProject = new Map<SDK.SourceMap.SourceMap, ContentProviderBasedProject>();
|
|
44
45
|
readonly #uiSourceCodeToSourceMaps =
|
|
45
46
|
new Platform.MapUtilities.Multimap<Workspace.UISourceCode.UISourceCode, SDK.SourceMap.SourceMap>();
|
|
47
|
+
readonly #debuggerModel: SDK.DebuggerModel.DebuggerModel;
|
|
46
48
|
|
|
47
49
|
constructor(
|
|
48
50
|
debuggerModel: SDK.DebuggerModel.DebuggerModel, workspace: Workspace.Workspace.WorkspaceImpl,
|
|
49
51
|
debuggerWorkspaceBinding: DebuggerWorkspaceBinding) {
|
|
50
52
|
this.#sourceMapManager = debuggerModel.sourceMapManager();
|
|
51
53
|
this.#debuggerWorkspaceBinding = debuggerWorkspaceBinding;
|
|
54
|
+
this.#debuggerModel = debuggerModel;
|
|
52
55
|
|
|
53
56
|
this.#stubProject = new ContentProviderBasedProject(
|
|
54
57
|
workspace, 'jsSourceMaps:stub:' + debuggerModel.target().id(), Workspace.Workspace.projectTypes.Service, '',
|
|
@@ -266,9 +269,56 @@ export class CompilerScriptMapping implements DebuggerSourceMapping {
|
|
|
266
269
|
}
|
|
267
270
|
|
|
268
271
|
translateRawFramesStep(
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
+
rawFrames: StackTraceImpl.Trie.RawFrame[],
|
|
273
|
+
translatedFrames: Awaited<ReturnType<StackTraceImpl.StackTraceModel.TranslateRawFrames>>): boolean {
|
|
274
|
+
const frame = rawFrames[0];
|
|
275
|
+
if (StackTraceImpl.Trie.isBuiltinFrame(frame)) {
|
|
276
|
+
return false;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
const sourceMapWithScopeInfoForFrame =
|
|
280
|
+
(rawFrame: StackTraceImpl.Trie.RawFrame): {sourceMap: SDK.SourceMap.SourceMap, script: SDK.Script.Script}|
|
|
281
|
+
null => {
|
|
282
|
+
const script = this.#debuggerModel.scriptForId(rawFrame.scriptId ?? '');
|
|
283
|
+
if (!script || this.#stubUISourceCodes.has(script)) {
|
|
284
|
+
// Use fallback while source map is being loaded.
|
|
285
|
+
return null;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
const sourceMap = script.sourceMap();
|
|
289
|
+
return sourceMap?.hasScopeInfo() ? {sourceMap, script} : null;
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
const sourceMapAndScript = sourceMapWithScopeInfoForFrame(frame);
|
|
293
|
+
if (!sourceMapAndScript) {
|
|
294
|
+
return false;
|
|
295
|
+
}
|
|
296
|
+
const {sourceMap, script} = sourceMapAndScript;
|
|
297
|
+
const {lineNumber, columnNumber} = script.relativeLocationToRawLocation(frame);
|
|
298
|
+
|
|
299
|
+
if (!sourceMap.hasInlinedFrames(lineNumber, columnNumber) && !sourceMap.isOutlinedFrame(lineNumber, columnNumber)) {
|
|
300
|
+
// No outlining or inlining: Get the original function name and map the call-site.
|
|
301
|
+
const mapping = sourceMap.findEntry(lineNumber, columnNumber);
|
|
302
|
+
if (!mapping?.sourceURL) {
|
|
303
|
+
return false;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
const originalName = sourceMap.findOriginalFunctionName({line: lineNumber, column: columnNumber});
|
|
307
|
+
rawFrames.shift();
|
|
308
|
+
const project = this.#sourceMapToProject.get(sourceMap);
|
|
309
|
+
const uiSourceCode = project?.uiSourceCodeForURL(mapping.sourceURL);
|
|
310
|
+
translatedFrames.push([{
|
|
311
|
+
line: mapping.sourceLineNumber,
|
|
312
|
+
column: mapping.sourceColumnNumber,
|
|
313
|
+
name: originalName ?? undefined,
|
|
314
|
+
uiSourceCode: uiSourceCode ?? undefined,
|
|
315
|
+
url: uiSourceCode ? undefined : mapping.sourceURL
|
|
316
|
+
}]);
|
|
317
|
+
return true;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
// TODO(crbug.com/433162438): Expand inlined frames.
|
|
321
|
+
// TODO(crbug.com/433162438): Consolidate outlined frames.
|
|
272
322
|
return false;
|
|
273
323
|
}
|
|
274
324
|
|
|
@@ -7,7 +7,7 @@ import * as FormatterActions from '../../entrypoints/formatter_worker/FormatterA
|
|
|
7
7
|
|
|
8
8
|
export {DefinitionKind, ScopeKind, type ScopeTreeNode} from '../../entrypoints/formatter_worker/FormatterActions.js';
|
|
9
9
|
|
|
10
|
-
let formatterWorkerPoolInstance: FormatterWorkerPool;
|
|
10
|
+
let formatterWorkerPoolInstance: FormatterWorkerPool|undefined;
|
|
11
11
|
|
|
12
12
|
export class FormatterWorkerPool {
|
|
13
13
|
private taskQueue: Task[];
|
|
@@ -26,6 +26,22 @@ export class FormatterWorkerPool {
|
|
|
26
26
|
return formatterWorkerPoolInstance;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
dispose(): void {
|
|
30
|
+
for (const task of this.taskQueue) {
|
|
31
|
+
console.error('rejecting task');
|
|
32
|
+
task.errorCallback(new Event('Worker terminated'));
|
|
33
|
+
}
|
|
34
|
+
for (const [worker, task] of this.workerTasks.entries()) {
|
|
35
|
+
task?.errorCallback(new Event('Worker terminated'));
|
|
36
|
+
worker.terminate(/* immediately=*/ true);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static removeInstance(): void {
|
|
41
|
+
formatterWorkerPoolInstance?.dispose();
|
|
42
|
+
formatterWorkerPoolInstance = undefined;
|
|
43
|
+
}
|
|
44
|
+
|
|
29
45
|
private createWorker(): Common.Worker.WorkerWrapper {
|
|
30
46
|
const worker = Common.Worker.WorkerWrapper.fromURL(
|
|
31
47
|
new URL('../../entrypoints/formatter_worker/formatter_worker-entrypoint.js', import.meta.url));
|
|
@@ -687,7 +687,7 @@ export const NativeFunctions = [
|
|
|
687
687
|
{
|
|
688
688
|
name: "toJSON",
|
|
689
689
|
signatures: [["?key"]],
|
|
690
|
-
receivers: ["Date"]
|
|
690
|
+
receivers: ["Date","CSPViolationReportBody","ReportBody","CoopAccessViolationReportBody","DeprecationReportBody","DocumentPolicyViolationReportBody","IntegrityViolationReportBody","InterventionReportBody","PermissionsPolicyViolationReportBody","TestReportBody"]
|
|
691
691
|
},
|
|
692
692
|
{
|
|
693
693
|
name: "parse",
|
|
@@ -81,8 +81,13 @@ export class Model extends EventTarget {
|
|
|
81
81
|
* });
|
|
82
82
|
* void this.traceModel.parse(events);
|
|
83
83
|
**/
|
|
84
|
-
async parse(traceEvents: readonly Types.Events.Event[], config
|
|
85
|
-
|
|
84
|
+
async parse(traceEvents: readonly Types.Events.Event[], config: Types.Configuration.ParseOptions = {}):
|
|
85
|
+
Promise<void> {
|
|
86
|
+
if (config.showAllEvents === undefined) {
|
|
87
|
+
config.showAllEvents = this.#config.showAllEvents;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const metadata = config.metadata || {};
|
|
86
91
|
// During parsing, periodically update any listeners on each processors'
|
|
87
92
|
// progress (if they have any updates).
|
|
88
93
|
const onTraceUpdate = (event: Event): void => {
|
|
@@ -98,7 +103,7 @@ export class Model extends EventTarget {
|
|
|
98
103
|
try {
|
|
99
104
|
// Wait for all outstanding promises before finishing the async execution,
|
|
100
105
|
// but perform all tasks in parallel.
|
|
101
|
-
await this.#processor.parse(traceEvents, config
|
|
106
|
+
await this.#processor.parse(traceEvents, config);
|
|
102
107
|
if (!this.#processor.data) {
|
|
103
108
|
throw new Error('processor did not parse trace');
|
|
104
109
|
}
|
|
@@ -6,6 +6,10 @@ import * as Platform from '../../../core/platform/platform.js';
|
|
|
6
6
|
import * as Helpers from '../helpers/helpers.js';
|
|
7
7
|
import * as Types from '../types/types.js';
|
|
8
8
|
|
|
9
|
+
import type {FinalizeOptions} from './types.js';
|
|
10
|
+
|
|
11
|
+
let config: {showAllEvents: boolean};
|
|
12
|
+
|
|
9
13
|
// We track the renderer processes we see in each frame on the way through the trace.
|
|
10
14
|
let rendererProcessesByFrameId: FrameProcessData = new Map();
|
|
11
15
|
|
|
@@ -349,7 +353,9 @@ export function handleEvent(event: Types.Events.Event): void {
|
|
|
349
353
|
}
|
|
350
354
|
}
|
|
351
355
|
|
|
352
|
-
export async function finalize(): Promise<void> {
|
|
356
|
+
export async function finalize(options?: FinalizeOptions): Promise<void> {
|
|
357
|
+
config = {showAllEvents: Boolean(options?.showAllEvents)};
|
|
358
|
+
|
|
353
359
|
// We try to set the minimum time by finding the event with the smallest
|
|
354
360
|
// timestamp. However, if we also got a timestamp from the
|
|
355
361
|
// TracingStartedInBrowser event, we should always use that.
|
|
@@ -431,6 +437,7 @@ export async function finalize(): Promise<void> {
|
|
|
431
437
|
}
|
|
432
438
|
|
|
433
439
|
export interface MetaHandlerData {
|
|
440
|
+
config: {showAllEvents: boolean};
|
|
434
441
|
traceIsGeneric: boolean;
|
|
435
442
|
traceBounds: Types.Timing.TraceWindowMicro;
|
|
436
443
|
browserProcessId: Types.Events.ProcessID;
|
|
@@ -494,6 +501,7 @@ export type FrameProcessData =
|
|
|
494
501
|
|
|
495
502
|
export function data(): MetaHandlerData {
|
|
496
503
|
return {
|
|
504
|
+
config,
|
|
497
505
|
traceBounds,
|
|
498
506
|
browserProcessId,
|
|
499
507
|
browserThreadId,
|
|
@@ -66,6 +66,7 @@ export function configToCacheKey(config: Configuration): string {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
export interface ParseOptions {
|
|
69
|
+
showAllEvents?: boolean;
|
|
69
70
|
/**
|
|
70
71
|
* If the trace was just recorded on the current page, rather than an imported file.
|
|
71
72
|
* TODO(paulirish): Maybe remove. This is currently unused by the Processor and Handlers
|
|
@@ -215,6 +215,7 @@ UI.ViewManager.registerViewExtension({
|
|
|
215
215
|
commandPrompt: i18nLazyString(UIStrings.showOverrides),
|
|
216
216
|
order: 4,
|
|
217
217
|
persistence: UI.ViewManager.ViewPersistence.PERMANENT,
|
|
218
|
+
condition: () => !Root.Runtime.Runtime.isTraceApp(),
|
|
218
219
|
async loadView() {
|
|
219
220
|
const Sources = await loadSourcesModule();
|
|
220
221
|
return Sources.SourcesNavigator.OverridesNavigatorView.instance();
|
|
@@ -228,7 +229,7 @@ UI.ViewManager.registerViewExtension({
|
|
|
228
229
|
commandPrompt: i18nLazyString(UIStrings.showContentScripts),
|
|
229
230
|
order: 5,
|
|
230
231
|
persistence: UI.ViewManager.ViewPersistence.PERMANENT,
|
|
231
|
-
condition: () => Root.Runtime.getPathName() !== '/bundled/worker_app.html',
|
|
232
|
+
condition: () => Root.Runtime.getPathName() !== '/bundled/worker_app.html' && !Root.Runtime.Runtime.isTraceApp(),
|
|
232
233
|
async loadView() {
|
|
233
234
|
const Sources = await loadSourcesModule();
|
|
234
235
|
return new Sources.SourcesNavigator.ContentScriptsNavigatorView();
|
|
@@ -10,7 +10,6 @@ import type * as Workspace from '../../models/workspace/workspace.js';
|
|
|
10
10
|
import * as WorkspaceDiff from '../../models/workspace_diff/workspace_diff.js';
|
|
11
11
|
import type * as Diff from '../../third_party/diff/diff.js';
|
|
12
12
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
13
|
-
import * as CopyToClipboard from '../../ui/components/copy_to_clipboard/copy_to_clipboard.js';
|
|
14
13
|
import type * as DiffView from '../../ui/components/diff_view/diff_view.js';
|
|
15
14
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
16
15
|
import * as Lit from '../../ui/lit/lit.js';
|
|
@@ -168,7 +167,7 @@ export class CombinedDiffView extends UI.Widget.Widget {
|
|
|
168
167
|
return;
|
|
169
168
|
}
|
|
170
169
|
|
|
171
|
-
|
|
170
|
+
UI.UIUtils.copyTextToClipboard(content.text, i18nString(UIStrings.copied));
|
|
172
171
|
this.#copiedFiles[fileUrl] = true;
|
|
173
172
|
this.requestUpdate();
|
|
174
173
|
setTimeout(() => {
|
|
@@ -25,7 +25,11 @@ const UIStringsNotTranslate = {
|
|
|
25
25
|
/**
|
|
26
26
|
* @description Link text in the disclaimer dialog, linking to a settings page containing more information
|
|
27
27
|
*/
|
|
28
|
-
learnMore: 'Learn more
|
|
28
|
+
learnMore: 'Learn more',
|
|
29
|
+
/**
|
|
30
|
+
* @description Link text in the Console Insights Teaser info tooltip, linking to an explainer on how data is being used in this feature
|
|
31
|
+
*/
|
|
32
|
+
learnMoreAboutAiSummaries: 'Learn more about AI summaries',
|
|
29
33
|
/**
|
|
30
34
|
* @description Description of the console insights feature
|
|
31
35
|
*/
|
|
@@ -69,6 +73,10 @@ const UIStringsNotTranslate = {
|
|
|
69
73
|
* @description Label for a checkbox which turns off the teaser explanation feature
|
|
70
74
|
*/
|
|
71
75
|
dontShow: 'Don’t show',
|
|
76
|
+
/**
|
|
77
|
+
* @description Aria-label for an infor-button triggering a tooltip with more info about data usage
|
|
78
|
+
*/
|
|
79
|
+
learnDataUsage: 'Learn more about how your data is used',
|
|
72
80
|
} as const;
|
|
73
81
|
|
|
74
82
|
const lockedString = i18n.i18n.lockedString;
|
|
@@ -108,7 +116,7 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLE
|
|
|
108
116
|
>
|
|
109
117
|
<div class="teaser-tooltip-container">
|
|
110
118
|
${showPlaceholder ? html`
|
|
111
|
-
<h2
|
|
119
|
+
<h2>${lockedString(UIStringsNotTranslate.summarizing)}</h2>
|
|
112
120
|
<div
|
|
113
121
|
role="presentation"
|
|
114
122
|
aria-label=${lockedString(UIStringsNotTranslate.loading)}
|
|
@@ -126,7 +134,7 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLE
|
|
|
126
134
|
</svg>
|
|
127
135
|
</div>
|
|
128
136
|
` : html`
|
|
129
|
-
<h2
|
|
137
|
+
<h2>${input.headerText}</h2>
|
|
130
138
|
<div>${input.mainText}</div>
|
|
131
139
|
<div class="tooltip-footer">
|
|
132
140
|
${input.hasTellMeMoreButton ? html`
|
|
@@ -140,23 +148,25 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLE
|
|
|
140
148
|
${lockedString(UIStringsNotTranslate.tellMeMore)}
|
|
141
149
|
</devtools-button>
|
|
142
150
|
` : Lit.nothing}
|
|
143
|
-
<devtools-
|
|
144
|
-
|
|
145
|
-
|
|
151
|
+
<devtools-button
|
|
152
|
+
.iconName=${'info'}
|
|
153
|
+
.variant=${Buttons.Button.Variant.ICON}
|
|
146
154
|
aria-details=${'teaser-info-tooltip-' + input.uuid}
|
|
147
|
-
|
|
155
|
+
aria-label=${lockedString(UIStringsNotTranslate.learnDataUsage)}
|
|
156
|
+
></devtools-button>
|
|
148
157
|
<devtools-tooltip id=${'teaser-info-tooltip-' + input.uuid} variant="rich">
|
|
149
158
|
<div class="info-tooltip-text">${lockedString(UIStringsNotTranslate.infoTooltipText)}</div>
|
|
150
159
|
<div class="learn-more">
|
|
151
160
|
<x-link
|
|
152
161
|
class="devtools-link"
|
|
153
|
-
title=${lockedString(UIStringsNotTranslate.
|
|
162
|
+
title=${lockedString(UIStringsNotTranslate.learnMoreAboutAiSummaries)}
|
|
154
163
|
href=${DATA_USAGE_URL}
|
|
155
164
|
jslog=${VisualLogging.link().track({click: true, keydown:'Enter|Space'}).context('explain.teaser.learn-more')}
|
|
156
|
-
>${lockedString(UIStringsNotTranslate.
|
|
165
|
+
>${lockedString(UIStringsNotTranslate.learnMoreAboutAiSummaries)}</x-link>
|
|
157
166
|
</div>
|
|
158
167
|
</devtools-tooltip>
|
|
159
168
|
<devtools-checkbox
|
|
169
|
+
aria-label=${lockedString(UIStringsNotTranslate.dontShow)}
|
|
160
170
|
@change=${input.dontShowChanged}
|
|
161
171
|
jslog=${VisualLogging.toggle('explain.teaser.dont-show').track({ change: true })}>
|
|
162
172
|
${lockedString(UIStringsNotTranslate.dontShow)}
|
|
@@ -170,8 +170,7 @@ export class ConsolePrompt extends Common.ObjectWrapper.eventMixin<EventTypes, t
|
|
|
170
170
|
Common.Settings.Settings.instance().createSetting('ai-code-completion-teaser-dismissed', false);
|
|
171
171
|
if (!this.aiCodeCompletionSetting.get() && !aiCodeCompletionTeaserDismissedSetting.get()) {
|
|
172
172
|
this.teaser = new PanelCommon.AiCodeCompletionTeaser({onDetach: this.detachAiCodeCompletionTeaser.bind(this)});
|
|
173
|
-
extensions.push(this.placeholderCompartment.of(
|
|
174
|
-
TextEditor.AiCodeCompletionTeaserPlaceholder.aiCodeCompletionTeaserPlaceholder(this.teaser)));
|
|
173
|
+
extensions.push(this.placeholderCompartment.of([]));
|
|
175
174
|
}
|
|
176
175
|
extensions.push(TextEditor.Config.aiAutoCompleteSuggestion);
|
|
177
176
|
}
|
|
@@ -397,7 +396,7 @@ export class ConsolePrompt extends Common.ObjectWrapper.eventMixin<EventTypes, t
|
|
|
397
396
|
if (accepted) {
|
|
398
397
|
this.dispatchEventToListeners(
|
|
399
398
|
Events.AI_CODE_COMPLETION_SUGGESTION_ACCEPTED, {citations: this.aiCodeCompletionCitations});
|
|
400
|
-
if (suggestion?.rpcGlobalId
|
|
399
|
+
if (suggestion?.rpcGlobalId) {
|
|
401
400
|
this.aiCodeCompletion?.registerUserAcceptance(suggestion.rpcGlobalId, suggestion.sampleId);
|
|
402
401
|
}
|
|
403
402
|
}
|
|
@@ -580,9 +579,18 @@ export class ConsolePrompt extends Common.ObjectWrapper.eventMixin<EventTypes, t
|
|
|
580
579
|
this.aidaAvailability = currentAidaAvailability;
|
|
581
580
|
if (this.aidaAvailability === Host.AidaClient.AidaAccessPreconditions.AVAILABLE) {
|
|
582
581
|
this.onAiCodeCompletionSettingChanged();
|
|
582
|
+
if (this.teaser) {
|
|
583
|
+
this.editor.dispatch({
|
|
584
|
+
effects: this.placeholderCompartment.reconfigure(
|
|
585
|
+
[TextEditor.AiCodeCompletionTeaserPlaceholder.aiCodeCompletionTeaserPlaceholder(this.teaser)])
|
|
586
|
+
});
|
|
587
|
+
}
|
|
583
588
|
} else if (this.aiCodeCompletion) {
|
|
584
589
|
this.aiCodeCompletion.remove();
|
|
585
590
|
this.aiCodeCompletion = undefined;
|
|
591
|
+
if (this.teaser) {
|
|
592
|
+
this.detachAiCodeCompletionTeaser();
|
|
593
|
+
}
|
|
586
594
|
}
|
|
587
595
|
}
|
|
588
596
|
}
|