chrome-devtools-frontend 1.0.1571573 → 1.0.1572937

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 (140) hide show
  1. package/front_end/Images/geminiInDevTools.png +0 -0
  2. package/front_end/Images/geminiInDevTools_2x.png +0 -0
  3. package/front_end/Images/src/database-off.svg +1 -0
  4. package/front_end/Images/src/lock-person.svg +1 -1
  5. package/front_end/core/common/Debouncer.ts +10 -1
  6. package/front_end/core/common/SettingRegistration.ts +1 -1
  7. package/front_end/core/host/AidaClient.ts +8 -0
  8. package/front_end/core/host/InspectorFrontendHostAPI.ts +0 -6
  9. package/front_end/core/host/UserMetrics.ts +0 -30
  10. package/front_end/core/root/ExperimentNames.ts +30 -0
  11. package/front_end/core/root/Runtime.ts +12 -27
  12. package/front_end/core/root/root.ts +2 -0
  13. package/front_end/core/sdk/CSSModel.ts +36 -13
  14. package/front_end/core/sdk/CSSProperty.ts +1 -1
  15. package/front_end/core/sdk/CSSPropertyParserMatchers.ts +9 -0
  16. package/front_end/core/sdk/CookieModel.ts +2 -1
  17. package/front_end/core/sdk/DOMModel.ts +1 -1
  18. package/front_end/core/sdk/DebuggerModel.ts +1 -1
  19. package/front_end/core/sdk/OverlayModel.ts +1 -1
  20. package/front_end/core/sdk/SourceMap.ts +1 -1
  21. package/front_end/devtools_compatibility.js +0 -6
  22. package/front_end/entrypoints/main/MainImpl.ts +34 -25
  23. package/front_end/entrypoints/main/main-meta.ts +1 -1
  24. package/front_end/generated/SupportedCSSProperties.js +4 -8
  25. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +0 -180
  26. package/front_end/models/ai_assistance/ai_assistance.ts +0 -2
  27. package/front_end/models/breakpoints/BreakpointManager.ts +3 -3
  28. package/front_end/models/issues_manager/ContrastCheckTrigger.ts +2 -2
  29. package/front_end/models/source_map_scopes/NamesResolver.ts +1 -1
  30. package/front_end/models/trace/EventsSerializer.ts +5 -1
  31. package/front_end/models/trace/types/TraceEvents.ts +4 -0
  32. package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +1 -1
  33. package/front_end/panels/accessibility/AccessibilitySidebarView.ts +1 -1
  34. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +8 -63
  35. package/front_end/panels/ai_assistance/aiAssistancePanel.css +0 -16
  36. package/front_end/panels/ai_assistance/ai_assistance.ts +0 -1
  37. package/front_end/panels/ai_assistance/components/ChatView.ts +123 -108
  38. package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +1 -145
  39. package/front_end/panels/application/DeviceBoundSessionsModel.ts +23 -1
  40. package/front_end/panels/application/DeviceBoundSessionsTreeElement.ts +23 -0
  41. package/front_end/panels/application/FrameDetailsView.ts +11 -10
  42. package/front_end/panels/application/components/BackForwardCacheView.ts +6 -8
  43. package/front_end/panels/application/components/BounceTrackingMitigationsView.ts +4 -3
  44. package/front_end/panels/application/components/ProtocolHandlersView.ts +5 -6
  45. package/front_end/panels/application/components/ReportsGrid.ts +8 -9
  46. package/front_end/panels/application/components/SharedStorageAccessGrid.ts +5 -4
  47. package/front_end/panels/application/components/TrustTokensView.ts +4 -6
  48. package/front_end/panels/application/preloading/PreloadingView.ts +9 -8
  49. package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +237 -230
  50. package/front_end/panels/application/preloading/components/PreloadingGrid.ts +3 -2
  51. package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +6 -10
  52. package/front_end/panels/application/resourcesSidebar.css +8 -0
  53. package/front_end/panels/autofill/AutofillView.ts +4 -3
  54. package/front_end/panels/common/AiCodeGenerationTeaser.ts +35 -4
  55. package/front_end/panels/common/BadgeNotification.ts +17 -14
  56. package/front_end/panels/common/GdpSignUpDialog.ts +5 -6
  57. package/front_end/panels/common/GeminiRebrandPromoDialog.ts +192 -0
  58. package/front_end/panels/common/aiCodeGenerationTeaser.css +16 -1
  59. package/front_end/panels/common/common.ts +1 -0
  60. package/front_end/panels/common/geminiRebrandPromoDialog.css +47 -0
  61. package/front_end/panels/console/ErrorStackParser.ts +11 -16
  62. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +2 -2
  63. package/front_end/panels/css_overview/CSSOverviewModel.ts +1 -1
  64. package/front_end/panels/elements/ComputedStyleModel.ts +7 -54
  65. package/front_end/panels/elements/ElementsPanel.ts +33 -6
  66. package/front_end/panels/elements/ElementsTreeOutline.ts +1 -1
  67. package/front_end/panels/elements/StylePropertiesSection.ts +16 -8
  68. package/front_end/panels/elements/StylePropertyTreeElement.ts +67 -32
  69. package/front_end/panels/elements/StylesSidebarPane.ts +28 -11
  70. package/front_end/panels/elements/components/CSSHintDetailsView.ts +3 -2
  71. package/front_end/panels/elements/components/CSSPropertyDocsView.ts +3 -2
  72. package/front_end/panels/elements/elements-meta.ts +1 -1
  73. package/front_end/panels/issues/IssueView.ts +6 -6
  74. package/front_end/panels/network/RequestConditionsDrawer.ts +4 -3
  75. package/front_end/panels/network/RequestCookiesView.ts +3 -4
  76. package/front_end/panels/network/RequestTimingView.ts +2 -7
  77. package/front_end/panels/network/components/HeaderSectionRow.ts +3 -2
  78. package/front_end/panels/network/components/RequestHeaderSection.ts +3 -1
  79. package/front_end/panels/profiler/HeapProfileView.ts +3 -3
  80. package/front_end/panels/profiler/HeapSnapshotView.ts +1 -1
  81. package/front_end/panels/profiler/profiler-meta.ts +3 -3
  82. package/front_end/panels/protocol_monitor/protocol_monitor-meta.ts +1 -1
  83. package/front_end/panels/recorder/RecorderController.ts +2 -7
  84. package/front_end/panels/recorder/components/CreateRecordingView.ts +6 -6
  85. package/front_end/panels/recorder/components/RecordingView.ts +0 -38
  86. package/front_end/panels/recorder/components/ReplaySection.ts +0 -14
  87. package/front_end/panels/recorder/components/StepEditor.ts +2 -40
  88. package/front_end/panels/recorder/recorderController.css +3 -3
  89. package/front_end/panels/security/CookieReportView.ts +14 -14
  90. package/front_end/panels/security/cookieControlsView.css +1 -1
  91. package/front_end/panels/security/cookieReportView.css +1 -1
  92. package/front_end/panels/settings/AISettingsTab.ts +8 -10
  93. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +4 -12
  94. package/front_end/panels/settings/settings-meta.ts +1 -1
  95. package/front_end/panels/sources/BreakpointEditDialog.ts +4 -3
  96. package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +1 -1
  97. package/front_end/panels/sources/NavigatorView.ts +4 -4
  98. package/front_end/panels/sources/SourcesPanel.ts +5 -4
  99. package/front_end/panels/sources/components/HeadersView.ts +2 -2
  100. package/front_end/panels/timeline/CompatibilityTracksAppender.ts +3 -2
  101. package/front_end/panels/timeline/ThreadAppender.ts +2 -1
  102. package/front_end/panels/timeline/TimelineController.ts +3 -3
  103. package/front_end/panels/timeline/TimelinePanel.ts +6 -4
  104. package/front_end/panels/timeline/TimelineUIUtils.ts +2 -2
  105. package/front_end/panels/timeline/components/ExportTraceOptions.ts +4 -4
  106. package/front_end/panels/timeline/components/FieldSettingsDialog.ts +13 -6
  107. package/front_end/panels/timeline/components/LiveMetricsView.ts +13 -9
  108. package/front_end/panels/timeline/components/exportTraceOptions.css +1 -1
  109. package/front_end/panels/timeline/components/fieldSettingsDialog.css +1 -1
  110. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +2 -19
  111. package/front_end/panels/timeline/components/insights/InsightRenderer.ts +3 -4
  112. package/front_end/panels/timeline/components/insights/baseInsightComponent.css +0 -5
  113. package/front_end/panels/timeline/components/liveMetricsView.css +1 -1
  114. package/front_end/third_party/chromium/README.chromium +1 -1
  115. package/front_end/ui/components/buttons/button.css +4 -0
  116. package/front_end/ui/components/panel_feedback/PreviewToggle.ts +5 -5
  117. package/front_end/ui/components/panel_feedback/previewToggle.css +2 -2
  118. package/front_end/ui/components/text_editor/AiCodeGenerationParser.ts +27 -8
  119. package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +36 -6
  120. package/front_end/ui/legacy/ActionRegistration.ts +1 -1
  121. package/front_end/ui/legacy/ContextMenu.ts +2 -2
  122. package/front_end/ui/legacy/EmptyWidget.ts +3 -3
  123. package/front_end/ui/legacy/LinkContextMenuProvider.ts +42 -0
  124. package/front_end/ui/legacy/ViewRegistration.ts +1 -1
  125. package/front_end/ui/legacy/XLink.ts +0 -27
  126. package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +1 -1
  127. package/front_end/ui/legacy/components/color_picker/ContrastOverlay.ts +4 -4
  128. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +2 -2
  129. package/front_end/ui/legacy/components/perf_ui/perf_ui-meta.ts +1 -1
  130. package/front_end/ui/legacy/inspectorCommon.css +2 -1
  131. package/front_end/ui/legacy/legacy.ts +3 -1
  132. package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
  133. package/front_end/ui/visual_logging/LoggingDriver.ts +3 -0
  134. package/package.json +1 -1
  135. package/front_end/models/ai_assistance/ArtifactsManager.ts +0 -67
  136. package/front_end/panels/ai_assistance/components/ArtifactsViewer.ts +0 -183
  137. package/front_end/panels/ai_assistance/components/CollapsibleAssistanceContentWidget.ts +0 -89
  138. package/front_end/panels/ai_assistance/components/PerformanceAgentFlameChart.ts +0 -133
  139. package/front_end/panels/ai_assistance/components/artifactsViewer.css +0 -15
  140. package/front_end/panels/ai_assistance/components/collapsibleAssistanceContentWidget.css +0 -32
@@ -10,10 +10,8 @@ import * as Root from '../../../core/root/root.js';
10
10
  import * as SDK from '../../../core/sdk/sdk.js';
11
11
  import * as Tracing from '../../../services/tracing/tracing.js';
12
12
  import * as Annotations from '../../annotations/annotations.js';
13
- import * as Logs from '../../logs/logs.js';
14
13
  import * as SourceMapScopes from '../../source_map_scopes/source_map_scopes.js';
15
14
  import * as Trace from '../../trace/trace.js';
16
- import {ArtifactsManager} from '../ArtifactsManager.js';
17
15
  import {
18
16
  PerformanceInsightFormatter,
19
17
  } from '../data_formatters/PerformanceInsightFormatter.js';
@@ -69,77 +67,6 @@ const greenDevAdditionalAnnotationsGuidelines = `
69
67
  - The annotationMessage should be descriptive and relevant to why the element or network request is being highlighted.
70
68
  `;
71
69
 
72
- const getGreenDevAdditionalWidgetGuidelines = (): string => {
73
- // GreenDev is experimenting with multiple ways to display widget:
74
- // if widgetsFromFunctionCalls is true, then we use function calls to add widgets
75
- // otherwise we use ai-insight tags
76
- const widgetsFromFunctionCalls = true;
77
-
78
- if (widgetsFromFunctionCalls) {
79
- return `
80
- - CRITICAL: You have access to a function for adding rich, interactive widgets to your response: \`addWidget\`.
81
- You MUST use this function whenever you refer to a corresponding entity.
82
-
83
- - **\`addWidget({widget: {type: 'insight', insightType: '...'}})\`**:
84
- - **When to use**: Call this function every time you mention a specific performance insight (e.g., LCP, INP, CLS culprits).
85
- - **Purpose**: It embeds an interactive widget that provides a detailed breakdown and visualization of the insight.
86
- - **Example**: If you are explaining the causes of a poor LCP score, you MUST also call \`addWidget({widget: {type: 'insight', insightType: 'LCPBreakdown'}})\`.
87
-
88
- - **\`addWidget({widget: {type: 'network-request', eventKey: '...'}})\`**:
89
- - **When to use**: Call this function whenever you discuss a specific network request.
90
- - **Purpose**: It adds a widget displaying the full details of the network request, such as its timing, headers, and priority.
91
- - **Critical**: The eventKey should be the trace event key (only the number, no letters prefix or -) of that script's network request.
92
- - **Example**: If you identify a render-blocking script, you MUST also call \`addWidget({widget: {type: 'network-request', eventKey: '...'}})\`.
93
-
94
- - **\`addWidget({widget: {type: 'flamechart', start: ..., end: ...}})\`**:
95
- - **When to use**: Call this function to highlight a specific time range within the trace, especially when discussing long tasks, specific events, or periods of high activity.
96
- - **Purpose**: It embeds a focused flame chart visualization for the given time range (in microseconds).
97
- - **Example**: If you find a long task that is blocking the main thread, you MUST also call \`addWidget({widget: {type: 'flamechart', start: 123456, end: 789012}})\`.
98
-
99
- - **General Rules**:
100
- - You MUST call this function as soon as you identify the entity you are discussing.
101
- - Do NOT add more than one widget for the same insight, network request, or time range to avoid redundancy.
102
- - If you have already shown a widget for any specific insight, network request, or time range, do not show it again.
103
- `;
104
- }
105
-
106
- return `
107
- - **Visualizing Insights**: When discussing the breakdown of specific metrics or a performance problem,
108
- you must render the appropriate Insight Overview component. Use these tags on a new line within your response:
109
- - For LCP breakdown: <ai-insight value="LCPBreakdown">
110
- - For INP breakdown: <ai-insight value="INPBreakdown">
111
- - For CLS culprits: <ai-insight value="CLSCulprits">
112
- - For third parties: <ai-insight value="ThirdParties">
113
- - For document latency: <ai-insight value="DocumentLatency">
114
- - For DOM size: <ai-insight value="DOMSize">
115
- - For duplicate JavaScript: <ai-insight value="DuplicatedJavaScript">
116
- - For font display: <ai-insight value="FontDisplay">
117
- - For forced reflow: <ai-insight value="ForcedReflow">
118
- - For image delivery: <ai-insight value="ImageDelivery">
119
- - For LCP discovery: <ai-insight value="LCPDiscovery">
120
- - For legacy JavaScript: <ai-insight value="LegacyJavaScript">
121
- - For network dependency tree: <ai-insight value="NetworkDependencyTree">
122
- - For render blocking: <ai-insight value="RenderBlocking">
123
- - For slow CSS selector: <ai-insight value="SlowCSSSelector">
124
- - For viewport: <ai-insight value="Viewport">
125
- - For modern HTTP: <ai-insight value="ModernHTTP">
126
- - For cache: <ai-insight value="Cache">
127
- - Do not place the <ai-insight> tag inside markdown code blocks (backticks). Output the tag directly as raw text.
128
- - **Visualizing Network Request Details**: When discussing a specific network request, represent its details in a structured widget for improved readability and focus.
129
- - Use this tag on a new line within your response, replacing \`EVENT_KEY\` (only the number, no letters prefix or -) with the actual trace event key:
130
- - For network event details: <network-request-widget value="EVENT_KEY">
131
- - **Visualizing Flamechart**: When discussing an interesting part of the trace, represent its details in a structured widget for improved readability and focus.
132
- - Use this tag on a new line within your response, replacing "MIN_MICROSECONDS" and "MAX_MICROSECONDS" with the actual start and end times in microseconds:
133
- - For a flame chart of a specific time range: <flame-chart-widget start="MIN_MICROSECONDS" end="MAX_MICROSECONDS">
134
- - CRITICAL: MIN_MICROSECONDS and MAX_MICROSECONDS must be within the flamechart bounds and in microseconds.
135
- - When you mention a specific performance event like LCP, INP, or a long task, you MUST also include a flamechart widget focused on the exact time range of that event.
136
- - This provides essential visual context to your explanation.
137
- - CRITICAL: Avoid Redundancy - When using insight or network request widgets, do not repeat details in the text response.
138
- - For example, for LCP, the phases like Time to First Byte will be part of the insight widget, so you must not state them in the text. This applies to other insights and network request timings.
139
- - Do not display any of the same widgets more than once. For example, if you have already displayed a network request widget for a specific event, do not display it again in the same response.
140
- `;
141
- };
142
-
143
70
  /**
144
71
  * Preamble clocks in at ~1341 tokens.
145
72
  * The prose is around 4.5 chars per token.
@@ -148,7 +75,6 @@ you must render the appropriate Insight Overview component. Use these tags on a
148
75
  * Check token length in https://aistudio.google.com/
149
76
  */
150
77
  const buildPreamble = (): string => {
151
- const greenDevEnabled = Boolean(Root.Runtime.hostConfig.devToolsGreenDevUi?.enabled);
152
78
  const annotationsEnabled = Annotations.AnnotationRepository.annotationsEnabled();
153
79
  return `You are an assistant, expert in web performance and highly skilled with Chrome DevTools.
154
80
 
@@ -203,7 +129,6 @@ Note: if the user asks a specific question about the trace (such as "What is my
203
129
  - Be direct and to the point. Avoid unnecessary introductory phrases or filler content. Focus on delivering actionable advice efficiently.
204
130
 
205
131
  ${annotationsEnabled ? greenDevAdditionalAnnotationsGuidelines : ''}
206
- ${greenDevEnabled ? getGreenDevAdditionalWidgetGuidelines() : ''}
207
132
 
208
133
  ## Strict Constraints
209
134
 
@@ -1248,111 +1173,6 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
1248
1173
  },
1249
1174
  });
1250
1175
  }
1251
-
1252
- if (Root.Runtime.hostConfig.devToolsGreenDevUi?.enabled) {
1253
- this.declareFunction<
1254
- {
1255
- type: 'insight' | 'network-request' | 'flamechart',
1256
- insightType?: Trace.Insights.Types.InsightKeys,
1257
- eventKey?: number,
1258
- start?: number,
1259
- end?: number,
1260
- },
1261
- object|{error: string}>('addWidget', {
1262
- description:
1263
- 'Adds an insight widget to the response. When mentioning an insight, call this function to also display an appropriate widget. Use this as much as possible to provide a better user experience.',
1264
- parameters: {
1265
- type: Host.AidaClient.ParametersTypes.OBJECT,
1266
- description: '',
1267
- nullable: false,
1268
- properties: {
1269
- type: {
1270
- type: Host.AidaClient.ParametersTypes.STRING,
1271
- description: 'The type of the widget to add. Possible values: insight, network-request, flamechart',
1272
- nullable: false,
1273
- },
1274
- insightType: {
1275
- type: Host.AidaClient.ParametersTypes.STRING,
1276
- description: 'The type of the insight widget. Include for insight widgets.',
1277
- nullable: true,
1278
- },
1279
- eventKey: {
1280
- type: Host.AidaClient.ParametersTypes.STRING,
1281
- description: 'The event key for the network request widget. Include for network request widgets.',
1282
- nullable: true,
1283
- },
1284
- start: {
1285
- type: Host.AidaClient.ParametersTypes.INTEGER,
1286
- description: 'The start time for the flame chart widget. Include for flame chart widgets.',
1287
- nullable: true,
1288
- },
1289
- end: {
1290
- type: Host.AidaClient.ParametersTypes.INTEGER,
1291
- description: 'The end time for the flame chart widget. Include for flame chart widgets.',
1292
- nullable: true,
1293
- },
1294
- },
1295
- required: ['type']
1296
- },
1297
- handler: async params => {
1298
- switch (params.type) {
1299
- case 'insight':
1300
- if (!params.insightType) {
1301
- return {error: 'Missing insightType for insight widget'};
1302
- }
1303
- ArtifactsManager.instance().addArtifact({type: 'insight', insightType: params.insightType});
1304
- return {result: {success: true}};
1305
- case 'network-request': {
1306
- if (!params.eventKey) {
1307
- return {error: 'Missing eventKey for network-request widget'};
1308
- }
1309
- const rawTraceEvent =
1310
- Trace.Helpers.SyntheticEvents.SyntheticEventsManager.getActiveManager().getRawTraceEvents().at(
1311
- Number(params.eventKey));
1312
- // Get the trace event object if it is available.
1313
- // If the trace is uploaded, we need to use the synthetic event.
1314
- if (rawTraceEvent && Trace.Types.Events.isSyntheticNetworkRequest(rawTraceEvent)) {
1315
- const rawTraceEventId = rawTraceEvent?.args?.data?.requestId;
1316
- const rawTraceEventUrl = rawTraceEvent?.args?.data?.url;
1317
- const networkRequest = rawTraceEvent ? Logs.NetworkLog.NetworkLog.instance()
1318
- .requestsForId(rawTraceEventId)
1319
- .find(r => r.url() === rawTraceEventUrl) :
1320
- null;
1321
- if (networkRequest) {
1322
- ArtifactsManager.instance().addArtifact({type: 'network-request', request: networkRequest});
1323
- return {result: {success: true}};
1324
- }
1325
- }
1326
-
1327
- const syntheticRequest = Trace.Helpers.SyntheticEvents.SyntheticEventsManager.getActiveManager()
1328
- .syntheticEventForRawEventIndex(Number(params.eventKey));
1329
-
1330
- if (syntheticRequest && Trace.Types.Events.isSyntheticNetworkRequest(syntheticRequest)) {
1331
- ArtifactsManager.instance().addArtifact({
1332
- type: 'network-request',
1333
- request: syntheticRequest,
1334
- });
1335
- return {result: {success: true}};
1336
- }
1337
-
1338
- return {result: {error: 'Could not find network request'}};
1339
- }
1340
- case 'flamechart':
1341
- if (params.start === undefined || params.end === undefined) {
1342
- return {error: 'Missing start or end for flamechart widget'};
1343
- }
1344
- ArtifactsManager.instance().addArtifact({
1345
- type: 'flamechart',
1346
- start: Trace.Types.Timing.Micro(params.start),
1347
- end: Trace.Types.Timing.Micro(params.end),
1348
- });
1349
- return {result: {success: true}};
1350
- default:
1351
- return {error: 'Invalid widget type'};
1352
- }
1353
- },
1354
- });
1355
- }
1356
1176
  }
1357
1177
 
1358
1178
  async addElementAnnotation(elementId: string, annotationMessage: string):
@@ -13,7 +13,6 @@ import * as StylingAgent from './agents/StylingAgent.js';
13
13
  import * as AiConversation from './AiConversation.js';
14
14
  import * as AiHistoryStorage from './AiHistoryStorage.js';
15
15
  import * as AiUtils from './AiUtils.js';
16
- import * as ArtifactsManager from './ArtifactsManager.js';
17
16
  import * as BuiltInAi from './BuiltInAi.js';
18
17
  import * as ChangeManager from './ChangeManager.js';
19
18
  import * as ConversationHandler from './ConversationHandler.js';
@@ -39,7 +38,6 @@ export {
39
38
  AiHistoryStorage,
40
39
  AIQueries,
41
40
  AiUtils,
42
- ArtifactsManager,
43
41
  BuiltInAi,
44
42
  ChangeManager,
45
43
  ConversationHandler,
@@ -91,7 +91,7 @@ export class BreakpointManager extends Common.ObjectWrapper.ObjectWrapper<EventT
91
91
  }
92
92
 
93
93
  modelAdded(debuggerModel: SDK.DebuggerModel.DebuggerModel): void {
94
- if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.INSTRUMENTATION_BREAKPOINTS)) {
94
+ if (Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.INSTRUMENTATION_BREAKPOINTS)) {
95
95
  debuggerModel.setSynchronizeBreakpointsCallback(this.restoreBreakpointsForScript.bind(this));
96
96
  }
97
97
  }
@@ -128,7 +128,7 @@ export class BreakpointManager extends Common.ObjectWrapper.ObjectWrapper<EventT
128
128
  // This method explicitly awaits the source map (if necessary) and the uiSourceCodes
129
129
  // required to set all breakpoints that are related to this script.
130
130
  async restoreBreakpointsForScript(script: SDK.Script.Script): Promise<void> {
131
- if (!Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.INSTRUMENTATION_BREAKPOINTS)) {
131
+ if (!Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.INSTRUMENTATION_BREAKPOINTS)) {
132
132
  return;
133
133
  }
134
134
  if (!script.sourceURL) {
@@ -1006,7 +1006,7 @@ export class ModelBreakpoint {
1006
1006
  };
1007
1007
  }));
1008
1008
  newState = positions.slice(0); // Create a copy
1009
- } else if (!Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.INSTRUMENTATION_BREAKPOINTS)) {
1009
+ } else if (!Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.INSTRUMENTATION_BREAKPOINTS)) {
1010
1010
  // Use this fallback if we do not have instrumentation breakpoints enabled yet. This currently makes
1011
1011
  // sure that v8 knows about the breakpoint and is able to restore it whenever the script is parsed.
1012
1012
  const lastResolvedState = this.#breakpoint.getLastResolvedState();
@@ -45,7 +45,7 @@ export class ContrastCheckTrigger {
45
45
  }
46
46
 
47
47
  #checkContrast(resourceTreeModel: SDK.ResourceTreeModel.ResourceTreeModel): void {
48
- if (!Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.CONTRAST_ISSUES)) {
48
+ if (!Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.CONTRAST_ISSUES)) {
49
49
  return;
50
50
  }
51
51
  void resourceTreeModel.target().auditsAgent().invoke_checkContrast({});
@@ -60,7 +60,7 @@ export class ContrastCheckTrigger {
60
60
 
61
61
  async #frameAdded(event: Common.EventTarget.EventTargetEvent<SDK.ResourceTreeModel.ResourceTreeFrame>):
62
62
  Promise<void> {
63
- if (!Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.CONTRAST_ISSUES)) {
63
+ if (!Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.CONTRAST_ISSUES)) {
64
64
  return;
65
65
  }
66
66
  const frame = event.data;
@@ -371,7 +371,7 @@ export const resolveScopeChain =
371
371
  return scopeChain;
372
372
  }
373
373
 
374
- scopeChain = Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.USE_SOURCE_MAP_SCOPES) ?
374
+ scopeChain = Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.USE_SOURCE_MAP_SCOPES) ?
375
375
  callFrame.script.sourceMap()?.resolveScopeChain(callFrame) :
376
376
  null;
377
377
  if (scopeChain) {
@@ -19,11 +19,15 @@ export class EventsSerializer {
19
19
  return `${Types.File.EventKeyType.LEGACY_TIMELINE_FRAME}-${event.index}`;
20
20
  }
21
21
 
22
+ if (Types.Events.isJSSample(event)) {
23
+ return null;
24
+ }
25
+
22
26
  const rawEvents = Helpers.SyntheticEvents.SyntheticEventsManager.getActiveManager().getRawTraceEvents();
23
27
  const isSynthetic = Types.Events.isSyntheticBased(event);
24
28
  const index = rawEvents.indexOf(isSynthetic ? event.rawSourceEvent : event);
25
29
  if (index === -1) {
26
- throw new Error(`Unknown trace event: ${event.name}`);
30
+ return null;
27
31
  }
28
32
 
29
33
  const key: Types.File.SyntheticEventKey|Types.File.RawEventKey = Types.Events.isSyntheticBased(event) ?
@@ -1832,6 +1832,10 @@ export interface SyntheticJSSample extends Event {
1832
1832
  ph: Phase.INSTANT;
1833
1833
  }
1834
1834
 
1835
+ export function isJSSample(event: Event): event is SyntheticJSSample {
1836
+ return event.name === Name.JS_SAMPLE;
1837
+ }
1838
+
1835
1839
  export function isSyntheticInteraction(event: Event): event is SyntheticInteractionPair {
1836
1840
  return Boolean(
1837
1841
  'interactionId' in event && event.args?.data && 'beginEvent' in event.args.data && 'endEvent' in event.args.data);
@@ -77,7 +77,7 @@ export class AXBreadcrumbsPane extends AccessibilitySubPane {
77
77
  const previewToggle = new Feedback.PreviewToggle.PreviewToggle();
78
78
  previewToggle.setAttribute('jslog', `${VisualLogging.toggle('full-accessibility-tree')}`);
79
79
  const name = i18nString(UIStrings.fullTreeExperimentName);
80
- const experiment = Root.Runtime.ExperimentName.FULL_ACCESSIBILITY_TREE;
80
+ const experiment = Root.ExperimentNames.ExperimentName.FULL_ACCESSIBILITY_TREE;
81
81
  const onChangeCallback: (checked: boolean) => void = checked => {
82
82
  Host.userMetrics.experimentChanged(experiment, checked);
83
83
  UI.InspectorView.InspectorView.instance().displayReloadRequiredWarning(i18nString(UIStrings.reloadRequired));
@@ -95,7 +95,7 @@ export class AccessibilitySidebarView extends UI.Widget.VBox {
95
95
  if (!accessibilityModel) {
96
96
  return;
97
97
  }
98
- if (!Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.FULL_ACCESSIBILITY_TREE)) {
98
+ if (!Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.FULL_ACCESSIBILITY_TREE)) {
99
99
  accessibilityModel.clear();
100
100
  }
101
101
  await accessibilityModel.requestPartialAXTree(node);
@@ -27,7 +27,6 @@ import * as NetworkPanel from '../network/network.js';
27
27
  import * as TimelinePanel from '../timeline/timeline.js';
28
28
 
29
29
  import aiAssistancePanelStyles from './aiAssistancePanel.css.js';
30
- import {ArtifactsViewer} from './components/ArtifactsViewer.js';
31
30
  import {
32
31
  type AnswerPart,
33
32
  ChatMessageEntity,
@@ -273,7 +272,7 @@ function getMarkdownRenderer(conversation?: AiAssistanceModel.AiConversation.AiC
273
272
  if (!context.external) {
274
273
  const focus = context.getItem();
275
274
  return new PerformanceAgentMarkdownRenderer(
276
- focus.parsedTrace.data.Meta.mainFrameId, focus.lookupEvent.bind(focus), focus.parsedTrace);
275
+ focus.parsedTrace.data.Meta.mainFrameId, focus.lookupEvent.bind(focus));
277
276
  }
278
277
  } else if (conversation?.type === AiAssistanceModel.AiHistoryStorage.ConversationType.PERFORMANCE) {
279
278
  // Handle historical conversations (can't linkify anything).
@@ -290,8 +289,6 @@ interface ToolbarViewInput {
290
289
  onExportConversationClick: () => void;
291
290
  onHelpClick: () => void;
292
291
  onSettingsClick: () => void;
293
- onArtifactsSidebarToggle: () => void;
294
- artifactsSidebarVisible: boolean;
295
292
  isLoading: boolean;
296
293
  showChatActions: boolean;
297
294
  showActiveConversationActions: boolean;
@@ -384,13 +381,6 @@ function toolbarView(input: ToolbarViewInput): Lit.LitTemplate {
384
381
  .jslogContext=${'freestyler.settings'}
385
382
  .variant=${Buttons.Button.Variant.TOOLBAR}
386
383
  @click=${input.onSettingsClick}></devtools-button>
387
- <!-- If the green experiment is enabled, render the artifacts sidebar toggle button -->
388
- ${GreenDev.Prototypes.instance().isEnabled('artifactViewer') ? html`<devtools-button
389
- title=${i18nString(UIStrings.settings)}
390
- aria-label=${i18nString(UIStrings.settings)}
391
- .iconName=${input.artifactsSidebarVisible ? 'left-panel-open' : 'left-panel-close'}
392
- .variant=${Buttons.Button.Variant.TOOLBAR}
393
- @click=${input.onArtifactsSidebarToggle}></devtools-button>` : Lit.nothing}
394
384
  </devtools-toolbar>
395
385
  </div>
396
386
  `;
@@ -428,40 +418,13 @@ function defaultView(input: ViewInput, output: PanelViewOutput, target: HTMLElem
428
418
  }
429
419
  }
430
420
 
431
- const panelWithToolbar = html`
432
- ${toolbarView(input)}
433
- <div class="ai-assistance-view-container">${renderState()}</div>`;
434
-
435
- // If the green experiment is enabled, render the chat view inside
436
- // a split view to also have an artifacts viewer sidebar.
437
- if(GreenDev.Prototypes.instance().isEnabled('artifactViewer')) {
438
- Lit.render(
439
- html`
440
- <devtools-split-view
441
- direction="column"
442
- sidebar-visibility=${input.artifactsSidebarVisible ? 'visible' : 'hidden'}
443
- sidebar-position="second"
444
- sidebar-initial-size="520"
445
- style="width: 100%;">
446
- <div slot="main" class="assistance-view-wrapper-with-sidebar">
447
- ${panelWithToolbar}
448
- </div>
449
- <div slot="sidebar">
450
- <div class="artifacts-toolbar-container" role="toolbar">
451
- <div>Artifacts Viewer</div>
452
- </div>
453
- <devtools-widget
454
- class="fill-panel"
455
- .widgetConfig=${UI.Widget.widgetConfig(ArtifactsViewer)}
456
- ></devtools-widget>
457
- </div>
458
- </devtools-split-view>
459
- `,
460
- target
461
- );
462
- } else {
463
- Lit.render(panelWithToolbar, target);
464
- }
421
+ Lit.render(
422
+ html`
423
+ ${toolbarView(input)}
424
+ <div class="ai-assistance-view-container">${renderState()}</div>
425
+ `,
426
+ target
427
+ );
465
428
  // clang-format on
466
429
  }
467
430
 
@@ -516,7 +479,6 @@ export class AiAssistancePanel extends UI.Panel.Panel {
516
479
  #selectedElement: AiAssistanceModel.StylingAgent.NodeContext|null = null;
517
480
  #selectedPerformanceTrace: AiAssistanceModel.PerformanceAgent.PerformanceTraceContext|null = null;
518
481
  #selectedRequest: AiAssistanceModel.NetworkAgent.RequestContext|null = null;
519
- #isArtifactsSidebarOpen = false;
520
482
  // Messages displayed in the `ChatView` component.
521
483
  #messages: Message[] = [];
522
484
 
@@ -555,10 +517,6 @@ export class AiAssistancePanel extends UI.Panel.Panel {
555
517
  }
556
518
  AiAssistanceModel.AiHistoryStorage.AiHistoryStorage.instance().addEventListener(
557
519
  AiAssistanceModel.AiHistoryStorage.Events.HISTORY_DELETED, this.#onHistoryDeleted, this);
558
- if (GreenDev.Prototypes.instance().isEnabled('artifactViewer')) {
559
- AiAssistanceModel.ArtifactsManager.ArtifactsManager.instance().addEventListener(
560
- AiAssistanceModel.ArtifactsManager.ArtifactAddedEvent.eventName, this.#onArtifactAdded.bind(this));
561
- }
562
520
  }
563
521
 
564
522
  async #getPanelViewInput(): Promise<PanelViewInput> {
@@ -601,7 +559,6 @@ export class AiAssistancePanel extends UI.Panel.Panel {
601
559
  uploadImageInputEnabled: isAiAssistanceMultimodalUploadInputEnabled() &&
602
560
  this.#conversation.type === AiAssistanceModel.AiHistoryStorage.ConversationType.STYLING,
603
561
  markdownRenderer,
604
- isArtifactsSidebarOpen: this.#isArtifactsSidebarOpen,
605
562
  onTextSubmit: async (
606
563
  text: string, imageInput?: Host.AidaClient.Part,
607
564
  multimodalInputType?: AiAssistanceModel.AiAgent.MultimodalInputType) => {
@@ -803,13 +760,6 @@ export class AiAssistancePanel extends UI.Panel.Panel {
803
760
  }
804
761
  }
805
762
 
806
- #onArtifactAdded(): void {
807
- if (AiAssistanceModel.ArtifactsManager.ArtifactsManager.instance().artifacts.length > 0) {
808
- this.#isArtifactsSidebarOpen = true;
809
- this.requestUpdate();
810
- }
811
- }
812
-
813
763
  override willHide(): void {
814
764
  super.willHide();
815
765
  this.#aiAssistanceEnabledSetting?.removeChangeListener(this.requestUpdate, this);
@@ -941,11 +891,6 @@ export class AiAssistancePanel extends UI.Panel.Panel {
941
891
  onSettingsClick: () => {
942
892
  void UI.ViewManager.ViewManager.instance().showView('chrome-ai');
943
893
  },
944
- onArtifactsSidebarToggle: () => {
945
- this.#isArtifactsSidebarOpen = !this.#isArtifactsSidebarOpen;
946
- this.requestUpdate();
947
- },
948
- artifactsSidebarVisible: this.#isArtifactsSidebarOpen,
949
894
  };
950
895
  }
951
896
 
@@ -13,22 +13,6 @@
13
13
  justify-content: space-between;
14
14
  }
15
15
 
16
- .artifacts-toolbar-container {
17
- display: flex;
18
- align-items: center;
19
- justify-content: flex-start;
20
- height: 27px;
21
- padding: 5px;
22
- border-bottom: 1px solid var(--sys-color-divider);
23
- }
24
-
25
- .assistance-view-wrapper-with-sidebar {
26
- display: flex;
27
- flex-direction: column;
28
- height: 100%;
29
- overflow: hidden;
30
- }
31
-
32
16
  .ai-assistance-view-container {
33
17
  display: flex;
34
18
  flex-direction: column;
@@ -6,7 +6,6 @@ export * from './AiAssistancePanel.js';
6
6
  export * from './components/ChatView.js';
7
7
  export * as ChatInput from './components/ChatInput.js';
8
8
  export * from './components/MarkdownRendererWithCodeBlock.js';
9
- export * from './components/PerformanceAgentFlameChart.js';
10
9
  export * from './SelectWorkspaceDialog.js';
11
10
  export * as ChatMessage from './components/ChatMessage.js';
12
11
  export * as ExploreWidget from './components/ExploreWidget.js';