chrome-devtools-frontend 1.0.1568864 → 1.0.1569477

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.
Files changed (35) hide show
  1. package/front_end/core/common/ParsedURL.ts +3 -0
  2. package/front_end/core/host/AidaClient.ts +1 -0
  3. package/front_end/core/root/Runtime.ts +4 -8
  4. package/front_end/entrypoints/main/MainImpl.ts +17 -20
  5. package/front_end/generated/SupportedCSSProperties.js +14 -14
  6. package/front_end/models/ai_assistance/agents/PatchAgent.ts +4 -1
  7. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +12 -0
  8. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +12 -2
  9. package/front_end/models/ai_assistance/agents/StylingAgent.ts +4 -1
  10. package/front_end/models/stack_trace/StackTraceImpl.ts +12 -2
  11. package/front_end/models/stack_trace/StackTraceModel.ts +9 -1
  12. package/front_end/models/trace/Styles.ts +11 -8
  13. package/front_end/models/trace/handlers/PageLoadMetricsHandler.ts +3 -2
  14. package/front_end/models/trace/types/TraceEvents.ts +19 -10
  15. package/front_end/panels/common/AiCodeGenerationTeaser.ts +1 -1
  16. package/front_end/panels/elements/ElementsPanel.ts +6 -3
  17. package/front_end/panels/elements/ElementsSidebarPane.ts +5 -2
  18. package/front_end/panels/elements/MetricsSidebarPane.ts +192 -177
  19. package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
  20. package/front_end/panels/elements/metricsSidebarPane.css +3 -11
  21. package/front_end/panels/settings/SettingsScreen.ts +8 -38
  22. package/front_end/panels/settings/settingsScreen.css +0 -4
  23. package/front_end/panels/sources/BreakpointEditDialog.ts +203 -138
  24. package/front_end/panels/sources/DebuggerPlugin.ts +15 -7
  25. package/front_end/panels/timeline/TimelineUIUtils.ts +9 -3
  26. package/front_end/panels/timeline/TimingsTrackAppender.ts +1 -0
  27. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +3 -1
  28. package/front_end/panels/timeline/timelineFlameChartView.css +1 -0
  29. package/front_end/third_party/chromium/README.chromium +1 -1
  30. package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +23 -1
  31. package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +16 -4
  32. package/front_end/ui/kit/link/Link.ts +14 -8
  33. package/front_end/ui/kit/link/link.css +1 -1
  34. package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
  35. package/package.json +1 -1
@@ -49,7 +49,10 @@ export interface AiCodeGenerationConfig {
49
49
 
50
50
  export class AiCodeGenerationProvider {
51
51
  #devtoolsLocale: string;
52
- #aiCodeCompletionSetting = Common.Settings.Settings.instance().createSetting('ai-code-completion-enabled', false);
52
+ // 'ai-code-completion-enabled' setting controls both AI code completion and AI code generation.
53
+ // Since this provider deals with code generation, the field has been named `#aiCodeGenerationEnabledSetting`.
54
+ #aiCodeGenerationEnabledSetting =
55
+ Common.Settings.Settings.instance().createSetting('ai-code-completion-enabled', false);
53
56
  #generationTeaserCompartment = new CodeMirror.Compartment();
54
57
  #generationTeaser: PanelCommon.AiCodeGenerationTeaser.AiCodeGenerationTeaser;
55
58
  #editor?: TextEditor;
@@ -92,13 +95,16 @@ export class AiCodeGenerationProvider {
92
95
  dispose(): void {
93
96
  this.#controller.abort();
94
97
  this.#cleanupAiCodeGeneration();
98
+ this.#aiCodeGenerationEnabledSetting.removeChangeListener(this.#boundOnUpdateAiCodeGenerationState);
99
+ Host.AidaClient.HostConfigTracker.instance().removeEventListener(
100
+ Host.AidaClient.Events.AIDA_AVAILABILITY_CHANGED, this.#boundOnUpdateAiCodeGenerationState);
95
101
  }
96
102
 
97
103
  editorInitialized(editor: TextEditor): void {
98
104
  this.#editor = editor;
99
105
  Host.AidaClient.HostConfigTracker.instance().addEventListener(
100
106
  Host.AidaClient.Events.AIDA_AVAILABILITY_CHANGED, this.#boundOnUpdateAiCodeGenerationState);
101
- this.#aiCodeCompletionSetting.addChangeListener(this.#boundOnUpdateAiCodeGenerationState);
107
+ this.#aiCodeGenerationEnabledSetting.addChangeListener(this.#boundOnUpdateAiCodeGenerationState);
102
108
  void this.#updateAiCodeGenerationState();
103
109
  }
104
110
 
@@ -126,7 +132,7 @@ export class AiCodeGenerationProvider {
126
132
  async #updateAiCodeGenerationState(): Promise<void> {
127
133
  const aidaAvailability = await Host.AidaClient.AidaClient.checkAccessPreconditions();
128
134
  const isAvailable = aidaAvailability === Host.AidaClient.AidaAccessPreconditions.AVAILABLE;
129
- const isEnabled = this.#aiCodeCompletionSetting.get();
135
+ const isEnabled = this.#aiCodeGenerationEnabledSetting.get();
130
136
  if (isAvailable && isEnabled) {
131
137
  this.#setupAiCodeGeneration();
132
138
  } else {
@@ -309,6 +315,10 @@ export class AiCodeGenerationProvider {
309
315
  this.#aiCodeGenerationConfig?.onResponseReceived();
310
316
  return;
311
317
  } catch (e) {
318
+ if (e instanceof Host.DispatchHttpRequestClient.DispatchHttpRequestError &&
319
+ e.type === Host.DispatchHttpRequestClient.ErrorType.ABORT) {
320
+ return;
321
+ }
312
322
  AiCodeGeneration.debugLog('Error while fetching code generation suggestions from AIDA', e);
313
323
  this.#aiCodeGenerationConfig?.onResponseReceived();
314
324
  Host.userMetrics.actionTaken(Host.UserMetrics.Action.AiCodeGenerationError);
@@ -347,10 +357,12 @@ function aiCodeGenerationTeaserExtension(teaser: PanelCommon.AiCodeGenerationTea
347
357
  const line = this.#view.state.doc.lineAt(cursorPosition);
348
358
 
349
359
  const isEmptyLine = line.length === 0;
360
+ const canShowDiscoveryState =
361
+ UI.UIUtils.PromotionManager.instance().canShowPromotion(PanelCommon.AiCodeGenerationTeaser.PROMOTION_ID);
350
362
  const isComment = Boolean(AiCodeGenerationParser.extractCommentText(this.#view.state, cursorPosition));
351
363
  const isCursorAtEndOfLine = cursorPosition >= line.to;
352
364
 
353
- if ((isEmptyLine) || (isComment && isCursorAtEndOfLine)) {
365
+ if ((isEmptyLine && canShowDiscoveryState) || (isComment && isCursorAtEndOfLine)) {
354
366
  return CodeMirror.Decoration.set([
355
367
  CodeMirror.Decoration.widget({widget: new AccessiblePlaceholder(teaser), side: 1}).range(cursorPosition),
356
368
  ]);
@@ -39,6 +39,7 @@ export class Link extends HTMLElement {
39
39
  this.setAttribute('tabindex', '0');
40
40
  }
41
41
  this.#setDefaultTitle();
42
+ this.#onJslogContextChange();
42
43
 
43
44
  this.setAttribute('role', 'link');
44
45
  this.setAttribute('target', '_blank');
@@ -81,15 +82,20 @@ export class Link extends HTMLElement {
81
82
  }
82
83
 
83
84
  #onJslogContextChange(): void {
84
- const href = this.href;
85
- if (!href) {
86
- throw new Error('`href` is a required attribute.');
85
+ let jslogContext = this.jslogContext;
86
+ if (!jslogContext) {
87
+ try {
88
+ if (!this.href) {
89
+ return;
90
+ }
91
+ const urlForContext = new URL(this.href);
92
+ urlForContext.search = '';
93
+ jslogContext = Platform.StringUtilities.toKebabCase(urlForContext.toString());
94
+ } catch {
95
+ return;
96
+ }
87
97
  }
88
- const urlForContext = new URL(href);
89
- urlForContext.search = '';
90
- const jslogContext = Platform.StringUtilities.toKebabCase(
91
- this.jslogContext ?? urlForContext.toString(),
92
- );
98
+
93
99
  const jslog = VisualLogging.link().track({click: true, keydown: 'Enter|Space'}).context(jslogContext);
94
100
  this.setAttribute('jslog', jslog.toString());
95
101
  }
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  :host {
8
- display: inline-block;
8
+ display: inline;
9
9
  cursor: pointer;
10
10
  text-decoration: underline;
11
11
  color: var(--text-link);
@@ -352,6 +352,7 @@ export const knownContextValues = new Set([
352
352
  'ai-code-completion-teaser-dismissed',
353
353
  'ai-code-completion-teaser.dismiss',
354
354
  'ai-code-completion-teaser.fre',
355
+ 'ai-code-generation-disclaimer',
355
356
  'ai-code-generation-teaser.info-button',
356
357
  'ai-code-generation-upgrade-dialog.continue',
357
358
  'ai-code-generation-upgrade-dialog.manage-in-settings',
@@ -1626,6 +1627,7 @@ export const knownContextValues = new Set([
1626
1627
  'float-64-bit',
1627
1628
  'flood-color',
1628
1629
  'flood-opacity',
1630
+ 'flow-tolerance',
1629
1631
  'focus',
1630
1632
  'focus-visible',
1631
1633
  'focus-within',
package/package.json CHANGED
@@ -104,5 +104,5 @@
104
104
  "flat-cache": "6.1.12"
105
105
  }
106
106
  },
107
- "version": "1.0.1568864"
107
+ "version": "1.0.1569477"
108
108
  }