chrome-devtools-frontend 1.0.1575174 → 1.0.1575635

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 (89) hide show
  1. package/.stylelintrc.json +1 -1
  2. package/front_end/core/host/InspectorFrontendHostAPI.ts +2 -0
  3. package/front_end/core/sdk/CSSMatchedStyles.ts +27 -0
  4. package/front_end/entrypoints/main/MainImpl.ts +13 -7
  5. package/front_end/entrypoints/node_app/app/NodeConnectionsPanel.ts +3 -2
  6. package/front_end/generated/InspectorBackendCommands.ts +37 -0
  7. package/front_end/generated/protocol-mapping.d.ts +257 -0
  8. package/front_end/generated/protocol-proxy-api.d.ts +256 -0
  9. package/front_end/generated/protocol.ts +359 -0
  10. package/front_end/models/ai_assistance/AiConversation.ts +31 -10
  11. package/front_end/models/ai_assistance/AiHistoryStorage.ts +1 -0
  12. package/front_end/models/ai_assistance/agents/AiAgent.ts +29 -5
  13. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +73 -0
  14. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +141 -0
  15. package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
  16. package/front_end/models/javascript_metadata/NativeFunctions.js +5 -0
  17. package/front_end/models/live-metrics/LiveMetrics.ts +31 -51
  18. package/front_end/models/stack_trace/StackTrace.ts +2 -1
  19. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +72 -6
  20. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +1 -0
  21. package/front_end/panels/ai_assistance/components/ChatMessage.ts +6 -4
  22. package/front_end/panels/ai_assistance/components/ChatView.ts +5 -6
  23. package/front_end/panels/ai_assistance/components/chatView.css +10 -0
  24. package/front_end/panels/application/StorageView.ts +3 -3
  25. package/front_end/panels/application/preloading/components/preloadingDisabledInfobar.css +1 -1
  26. package/front_end/panels/common/aiCodeCompletionSummaryToolbar.css +1 -1
  27. package/front_end/panels/console/ConsoleContextSelector.ts +4 -3
  28. package/front_end/panels/elements/ElementsTreeElement.ts +2 -2
  29. package/front_end/panels/elements/StylePropertyTreeElement.ts +63 -0
  30. package/front_end/panels/elements/StylesSidebarPane.ts +17 -2
  31. package/front_end/panels/elements/stylePropertiesTreeOutline.css +4 -0
  32. package/front_end/panels/issues/AffectedMetadataAllowedSitesView.ts +3 -3
  33. package/front_end/panels/layer_viewer/Layers3DView.ts +2 -1
  34. package/front_end/panels/lighthouse/LighthouseStartView.ts +7 -6
  35. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +3 -2
  36. package/front_end/panels/network/RequestConditionsDrawer.ts +2 -3
  37. package/front_end/panels/network/SignedExchangeInfoView.ts +3 -4
  38. package/front_end/panels/network/components/HeaderSectionRow.css +1 -1
  39. package/front_end/panels/recorder/components/RecordingView.ts +2 -2
  40. package/front_end/panels/recorder/components/recordingView.css +5 -0
  41. package/front_end/panels/security/SecurityPanelSidebar.ts +10 -9
  42. package/front_end/panels/settings/AISettingsTab.ts +2 -1
  43. package/front_end/panels/settings/KeybindsSettingsTab.ts +3 -5
  44. package/front_end/panels/settings/SettingsScreen.ts +2 -3
  45. package/front_end/panels/sources/CallStackSidebarPane.ts +10 -0
  46. package/front_end/panels/sources/DebuggerPlugin.ts +18 -12
  47. package/front_end/panels/sources/ScopeChainSidebarPane.ts +4 -3
  48. package/front_end/panels/sources/SourcesNavigator.ts +2 -2
  49. package/front_end/panels/sources/SourcesPanel.ts +6 -3
  50. package/front_end/panels/sources/TabbedEditorContainer.ts +2 -2
  51. package/front_end/panels/sources/sources-meta.ts +2 -1
  52. package/front_end/panels/timeline/TimelinePanel.ts +2 -1
  53. package/front_end/panels/timeline/TimelineUIUtils.ts +2 -2
  54. package/front_end/panels/timeline/components/DetailsView.ts +7 -7
  55. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +2 -2
  56. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +4 -4
  57. package/front_end/panels/whats_new/releaseNoteView.css +1 -1
  58. package/front_end/third_party/chromium/README.chromium +1 -1
  59. package/front_end/third_party/puppeteer/README.chromium +2 -2
  60. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.d.ts.map +1 -1
  61. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.js +30 -25
  62. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.js.map +1 -1
  63. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  64. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  65. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  66. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  67. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +30 -21
  68. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.d.ts.map +1 -1
  69. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.js +31 -26
  70. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.js.map +1 -1
  71. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  72. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  73. package/front_end/third_party/puppeteer/package/package.json +3 -3
  74. package/front_end/third_party/puppeteer/package/src/cdp/TargetManager.ts +45 -44
  75. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  76. package/front_end/ui/components/buttons/Button.ts +2 -2
  77. package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -1
  78. package/front_end/ui/components/panel_feedback/panelFeedback.css +1 -1
  79. package/front_end/ui/kit/link/Link.ts +31 -0
  80. package/front_end/ui/legacy/LinkContextMenuProvider.ts +3 -5
  81. package/front_end/ui/legacy/components/object_ui/ObjectPopoverHelper.ts +2 -2
  82. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +336 -250
  83. package/front_end/ui/legacy/inspectorCommon.css +0 -1
  84. package/front_end/ui/legacy/legacy.ts +0 -4
  85. package/front_end/ui/visual_logging/KnownContextValues.ts +4 -0
  86. package/front_end/ui/visual_logging/LoggingDriver.ts +10 -6
  87. package/package.json +1 -1
  88. package/front_end/ui/legacy/XElement.ts +0 -41
  89. package/front_end/ui/legacy/XLink.ts +0 -128
@@ -44,10 +44,6 @@ import {MarkdownRendererWithCodeBlock} from './components/MarkdownRendererWithCo
44
44
  import {PerformanceAgentMarkdownRenderer} from './components/PerformanceAgentMarkdownRenderer.js';
45
45
  import {isAiAssistancePatchingEnabled} from './PatchWidget.js';
46
46
 
47
- // FIXME: this export is temporary to avoid rewriting tests.
48
- export {ChatMessageEntity} from './components/ChatMessage.js';
49
- export type {AnswerPart, ModelChatMessage, StepPart} from './components/ChatMessage.js';
50
-
51
47
  const {html} = Lit;
52
48
 
53
49
  const AI_ASSISTANCE_SEND_FEEDBACK = 'https://crbug.com/364805393' as Platform.DevToolsPath.UrlString;
@@ -164,6 +160,10 @@ const UIStringsNotTranslate = {
164
160
  *@description Placeholder text for the chat UI input.
165
161
  */
166
162
  inputPlaceholderForPerformanceTraceNoContext: 'Record or select a performance trace to ask a question',
163
+ /**
164
+ *@description Placeholder text for the chat UI input.
165
+ */
166
+ inputPlaceholderForNoContext: 'Ask AI Assistance',
167
167
  /**
168
168
  * @description Disclaimer text right after the chat input.
169
169
  */
@@ -204,6 +204,7 @@ const UIStringsNotTranslate = {
204
204
  */
205
205
  inputDisclaimerForPerformanceEnterpriseNoLogging:
206
206
  'Chat messages and data from your performance trace are sent to Google. The content you submit and that is generated by this feature will not be used to improve Google’s AI models. This is an experimental AI feature and won’t always get it right.',
207
+
207
208
  } as const;
208
209
 
209
210
  const str_ = i18n.i18n.registerUIStrings('panels/ai_assistance/AiAssistancePanel.ts', UIStrings);
@@ -259,6 +260,14 @@ async function getEmptyStateSuggestions(conversation?: AiAssistanceModel.AiConve
259
260
  ];
260
261
  }
261
262
 
263
+ case AiAssistanceModel.AiHistoryStorage.ConversationType.NONE: {
264
+ return [
265
+ {title: 'How can I use DevTools to debug?', jslogContext: 'empty'},
266
+ {title: 'What performance issues exist with my page?', jslogContext: 'empty'},
267
+ {title: 'What are the slowest requests on this page?', jslogContext: 'empty'},
268
+ ];
269
+ }
270
+
262
271
  default:
263
272
  Platform.assertNever(conversation.type, 'Unknown conversation type');
264
273
  }
@@ -395,7 +404,7 @@ function defaultView(input: ViewInput, output: PanelViewOutput, target: HTMLElem
395
404
  return html`
396
405
  <devtools-ai-chat-view
397
406
  .props=${input.props}
398
- ${Lit.Directives.ref((el: Element | undefined) => {
407
+ ${Lit.Directives.ref(el => {
399
408
  if (!el || !(el instanceof ChatView)) {
400
409
  return;
401
410
  }
@@ -490,6 +499,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
490
499
  #userInfo: {
491
500
  accountImage?: string,
492
501
  accountFullName?: string,
502
+ accountGivenName?: string,
493
503
  };
494
504
  #timelinePanelInstance: TimelinePanel.TimelinePanel.TimelinePanel|null = null;
495
505
  #runAbortController = new AbortController();
@@ -509,6 +519,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
509
519
  this.#userInfo = {
510
520
  accountImage: syncInfo.accountImage,
511
521
  accountFullName: syncInfo.accountFullName,
522
+ accountGivenName: syncInfo.accountGivenName,
512
523
  };
513
524
 
514
525
  if (UI.ActionRegistry.ActionRegistry.instance().hasAction('elements.toggle-element-search')) {
@@ -658,6 +669,10 @@ export class AiAssistancePanel extends UI.Panel.Panel {
658
669
  targetConversationType = AiAssistanceModel.AiHistoryStorage.ConversationType.PERFORMANCE;
659
670
  }
660
671
 
672
+ if (isAiAssistanceContextSelectionAgentEnabled() && !targetConversationType) {
673
+ return AiAssistanceModel.AiHistoryStorage.ConversationType.NONE;
674
+ }
675
+
661
676
  return targetConversationType;
662
677
  }
663
678
 
@@ -680,6 +695,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
680
695
  new AiAssistanceModel.AiConversation.AiConversation(
681
696
  targetConversationType, [], undefined, false, this.#aidaClient, this.#changeManager) :
682
697
  undefined;
698
+
683
699
  this.#updateConversationState(conversation);
684
700
  }
685
701
 
@@ -807,6 +823,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
807
823
  this.#userInfo = {
808
824
  accountImage: syncInfo.accountImage,
809
825
  accountFullName: syncInfo.accountFullName,
826
+ accountGivenName: syncInfo.accountGivenName,
810
827
  };
811
828
  this.requestUpdate();
812
829
  }
@@ -930,7 +947,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
930
947
  return true;
931
948
  }
932
949
 
933
- if (!this.#conversation.selectedContext) {
950
+ if (!this.#conversation.selectedContext && !isAiAssistanceContextSelectionAgentEnabled()) {
934
951
  return true;
935
952
  }
936
953
 
@@ -982,6 +999,8 @@ export class AiAssistancePanel extends UI.Panel.Panel {
982
999
 
983
1000
  return lockedString(UIStringsNotTranslate.inputPlaceholderForPerformanceWithNoRecording);
984
1001
  }
1002
+ case AiAssistanceModel.AiHistoryStorage.ConversationType.NONE:
1003
+ return lockedString(UIStringsNotTranslate.inputPlaceholderForNoContext);
985
1004
  }
986
1005
  }
987
1006
 
@@ -1016,6 +1035,9 @@ export class AiAssistancePanel extends UI.Panel.Panel {
1016
1035
  return lockedString(UIStringsNotTranslate.inputDisclaimerForPerformanceEnterpriseNoLogging);
1017
1036
  }
1018
1037
  return lockedString(UIStringsNotTranslate.inputDisclaimerForPerformance);
1038
+
1039
+ case AiAssistanceModel.AiHistoryStorage.ConversationType.NONE:
1040
+ return lockedString(UIStringsNotTranslate.inputDisclaimerForPerformance);
1019
1041
  }
1020
1042
  }
1021
1043
 
@@ -1249,9 +1271,41 @@ export class AiAssistancePanel extends UI.Panel.Panel {
1249
1271
  return this.#selectedRequest;
1250
1272
  case AiAssistanceModel.AiHistoryStorage.ConversationType.PERFORMANCE:
1251
1273
  return this.#selectedPerformanceTrace;
1274
+ case AiAssistanceModel.AiHistoryStorage.ConversationType.NONE:
1275
+ return null;
1252
1276
  }
1253
1277
  }
1254
1278
 
1279
+ #handleConversationContextChange = (data: unknown): void => {
1280
+ if (data instanceof Workspace.UISourceCode.UISourceCode) {
1281
+ if (this.#selectedFile?.getItem() === data) {
1282
+ return;
1283
+ }
1284
+ this.#selectedFile = new AiAssistanceModel.FileAgent.FileContext(data);
1285
+
1286
+ } else if (data instanceof SDK.DOMModel.DOMNode) {
1287
+ if (this.#selectedElement?.getItem() === data ||
1288
+ // Ignore non node type like comments or html tags
1289
+ data.nodeType() === Node.ELEMENT_NODE) {
1290
+ return;
1291
+ }
1292
+ this.#selectedElement = new AiAssistanceModel.StylingAgent.NodeContext(data);
1293
+ } else if (data instanceof SDK.NetworkRequest.NetworkRequest) {
1294
+ if (this.#selectedRequest?.getItem() === data) {
1295
+ return;
1296
+ }
1297
+ const calculator = NetworkPanel.NetworkPanel.NetworkPanel.instance().networkLogView.timeCalculator();
1298
+ this.#selectedRequest = new AiAssistanceModel.NetworkAgent.RequestContext(data, calculator);
1299
+ } else if (data instanceof AiAssistanceModel.AIContext.AgentFocus) {
1300
+ if (this.#selectedPerformanceTrace?.getItem() === data) {
1301
+ return;
1302
+ }
1303
+ this.#selectedPerformanceTrace = new AiAssistanceModel.PerformanceAgent.PerformanceTraceContext(data);
1304
+ }
1305
+
1306
+ this.#updateConversationState(this.#conversation);
1307
+ };
1308
+
1255
1309
  async #startConversation(
1256
1310
  text: string,
1257
1311
  imageInput?: Host.AidaClient.Part,
@@ -1453,6 +1507,14 @@ export class AiAssistancePanel extends UI.Panel.Panel {
1453
1507
  }
1454
1508
  break;
1455
1509
  }
1510
+
1511
+ case AiAssistanceModel.AiAgent.ResponseType.CONTEXT_CHANGE: {
1512
+ this.#handleConversationContextChange(data.context);
1513
+ step.isLoading = false;
1514
+ commitStep();
1515
+
1516
+ break;
1517
+ }
1456
1518
  }
1457
1519
 
1458
1520
  // Commit update intermediate step when not
@@ -1576,6 +1638,10 @@ function isAiAssistanceMultimodalInputEnabled(): boolean {
1576
1638
  return Boolean(Root.Runtime.hostConfig.devToolsFreestyler?.multimodal);
1577
1639
  }
1578
1640
 
1641
+ function isAiAssistanceContextSelectionAgentEnabled(): boolean {
1642
+ return Boolean(Root.Runtime.hostConfig.devToolsAiAssistanceContextSelectionAgent?.enabled);
1643
+ }
1644
+
1579
1645
  function isAiAssistanceServerSideLoggingEnabled(): boolean {
1580
1646
  return !Root.Runtime.hostConfig.aidaAvailability?.disallowLogging;
1581
1647
  }
@@ -174,6 +174,7 @@ UI.ActionRegistration.registerActionExtension({
174
174
  return new AiAssistance.ActionDelegate();
175
175
  },
176
176
  condition: config => isAnyFeatureAvailable(config) && !isPolicyRestricted(config) && !isGeoRestricted(config),
177
+ featurePromotionId: 'debug-with-ai',
177
178
  });
178
179
 
179
180
  UI.ActionRegistration.registerActionExtension({
@@ -151,7 +151,7 @@ const UIStringsNotTranslate = {
151
151
  */
152
152
  accountAvatar: 'Account avatar',
153
153
  /**
154
- * @description Title for the x-link which wraps the image input rendered in chat messages.
154
+ * @description Title for the link which wraps the image input rendered in chat messages.
155
155
  */
156
156
  openImageInNewTab: 'Open image in a new tab',
157
157
  /**
@@ -250,7 +250,7 @@ export interface MessageInput {
250
250
  isReadOnly: boolean;
251
251
  isLastMessage: boolean;
252
252
  canShowFeedbackForm: boolean;
253
- userInfo: Pick<Host.InspectorFrontendHostAPI.SyncInformation, 'accountImage'|'accountFullName'>;
253
+ userInfo: Pick<Host.InspectorFrontendHostAPI.SyncInformation, 'accountImage'|'accountFullName'|'accountGivenName'>;
254
254
  markdownRenderer: MarkdownLitRenderer;
255
255
  onSuggestionClick: (suggestion: string) => void;
256
256
  onFeedbackSubmit: (rpcId: Host.AidaClient.RpcGlobalId, rate: Host.AidaClient.Rating, feedback?: string) => void;
@@ -260,7 +260,8 @@ export interface MessageInput {
260
260
  export const DEFAULT_VIEW = (input: ChatMessageViewInput, output: ViewOutput, target: HTMLElement): void => {
261
261
  const message = input.message;
262
262
  if (message.entity === ChatMessageEntity.USER) {
263
- const name = input.userInfo.accountFullName || lockedString(UIStringsNotTranslate.you);
263
+ const givenName = AiAssistanceModel.AiUtils.isGeminiBranding() ? input.userInfo.accountGivenName : '';
264
+ const name = givenName || input.userInfo.accountFullName || lockedString(UIStringsNotTranslate.you);
264
265
  const image = input.userInfo.accountImage ?
265
266
  html`<img src="data:image/png;base64, ${input.userInfo.accountImage}" alt=${
266
267
  UIStringsNotTranslate.accountAvatar} />` :
@@ -748,7 +749,8 @@ export class ChatMessage extends UI.Widget.Widget {
748
749
  isReadOnly = false;
749
750
  canShowFeedbackForm = false;
750
751
  isLastMessage = false;
751
- userInfo: Pick<Host.InspectorFrontendHostAPI.SyncInformation, 'accountImage'|'accountFullName'> = {};
752
+ userInfo:
753
+ Pick<Host.InspectorFrontendHostAPI.SyncInformation, 'accountImage'|'accountFullName'|'accountGivenName'> = {};
752
754
  markdownRenderer!: MarkdownLitRenderer;
753
755
  onSuggestionClick: (suggestion: string) => void = () => {};
754
756
  onFeedbackSubmit:
@@ -62,7 +62,7 @@ export interface Props {
62
62
  selectedContext: AiAssistanceModel.AiAgent.ConversationContext<unknown>|null;
63
63
  isLoading: boolean;
64
64
  canShowFeedbackForm: boolean;
65
- userInfo: Pick<Host.InspectorFrontendHostAPI.SyncInformation, 'accountImage'|'accountFullName'>;
65
+ userInfo: Pick<Host.InspectorFrontendHostAPI.SyncInformation, 'accountImage'|'accountGivenName'>;
66
66
  conversationType: AiAssistanceModel.AiHistoryStorage.ConversationType;
67
67
  isReadOnly: boolean;
68
68
  blockedByCrossOrigin: boolean;
@@ -78,7 +78,7 @@ export interface Props {
78
78
  }
79
79
 
80
80
  interface ChatWidgetInput extends Props {
81
- accountName: string;
81
+ accountGivenName: string;
82
82
  handleScroll: (ev: Event) => void;
83
83
  handleSuggestionClick: (title: string) => void;
84
84
  handleMessageContainerRef: (el: Element|undefined) => void;
@@ -133,8 +133,8 @@ const DEFAULT_VIEW: View = (input, output, target) => {
133
133
  </div>
134
134
  ${AiAssistanceModel.AiUtils.isGeminiBranding() ?
135
135
  html`
136
- <h1 class='greeting'>Hello, ${input.accountName}</h1>
137
- <h1>${lockedString(UIStringsNotTranslate.emptyStateTextGemini)}</h1>
136
+ <h1 class='greeting'>Hello${input.accountGivenName ? `, ${input.accountGivenName}` : ''}</h1>
137
+ <p class='cta'>${lockedString(UIStringsNotTranslate.emptyStateTextGemini)}</p>
138
138
  ` : html`<h1>${lockedString(UIStringsNotTranslate.emptyStateText)}</h1>`
139
139
  }
140
140
  </div>
@@ -323,8 +323,7 @@ export class ChatView extends HTMLElement {
323
323
  this.#view(
324
324
  {
325
325
  ...this.#props,
326
- // TODO(b/468206227): This needs to be a first name.
327
- accountName: this.#props.userInfo.accountFullName ?? '',
326
+ accountGivenName: this.#props.userInfo.accountGivenName ?? '',
328
327
  handleScroll: this.#handleScroll,
329
328
  handleSuggestionClick: this.#handleSuggestionClick,
330
329
  handleMessageContainerRef: this.#handleMessageContainerRef,
@@ -166,12 +166,17 @@ main {
166
166
  }
167
167
 
168
168
  .gemini {
169
+ .empty-state-container {
170
+ padding: var(--sys-size-8);
171
+ }
172
+
169
173
  .empty-state-container .icon {
170
174
  display: none;
171
175
  }
172
176
 
173
177
  .empty-state-container .header {
174
178
  align-items: flex-start;
179
+ line-height: var(--sys-size-4);
175
180
  }
176
181
 
177
182
  .empty-state-content {
@@ -179,9 +184,14 @@ main {
179
184
  }
180
185
 
181
186
  .empty-state-container .greeting {
187
+ font-size: var(--sys-size-10);
182
188
  color: var(--sys-color-primary);
183
189
  }
184
190
 
191
+ .empty-state-container .cta {
192
+ font-size: var(--sys-size-10);
193
+ }
194
+
185
195
  main {
186
196
  align-items: flex-start;
187
197
  }
@@ -10,7 +10,7 @@ import * as SDK from '../../core/sdk/sdk.js';
10
10
  import * as Protocol from '../../generated/protocol.js';
11
11
  import type * as Buttons from '../../ui/components/buttons/buttons.js';
12
12
  import * as uiI18n from '../../ui/i18n/i18n.js';
13
- import {Icon} from '../../ui/kit/kit.js';
13
+ import {Icon, Link} from '../../ui/kit/kit.js';
14
14
  import * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';
15
15
  import * as SettingsUI from '../../ui/legacy/components/settings_ui/settings_ui.js';
16
16
  import * as UI from '../../ui/legacy/legacy.js';
@@ -218,9 +218,9 @@ export class StorageView extends UI.Widget.VBox {
218
218
  this.quotaRow = quota.appendSelectableRow();
219
219
  this.quotaRow.classList.add('quota-usage-row');
220
220
  const learnMoreRow = quota.appendRow();
221
- const learnMore = UI.XLink.XLink.create(
221
+ const learnMore = Link.create(
222
222
  'https://developer.chrome.com/docs/devtools/progressive-web-apps#opaque-responses',
223
- i18nString(UIStrings.learnMore), undefined, undefined, 'learn-more');
223
+ i18nString(UIStrings.learnMore), undefined, 'learn-more');
224
224
  learnMoreRow.appendChild(learnMore);
225
225
  this.quotaUsage = null;
226
226
  this.pieChart = new PerfUI.PieChart.PieChart();
@@ -30,7 +30,7 @@
30
30
  grid-column-start: span 2;
31
31
  }
32
32
 
33
- x-link {
33
+ devtools-link {
34
34
  color: var(--sys-color-primary);
35
35
  text-decoration-line: underline;
36
36
  }
@@ -85,7 +85,7 @@
85
85
  gap: var(--sys-size-2);
86
86
  white-space: normal;
87
87
 
88
- x-link {
88
+ devtools-link {
89
89
  color: var(--sys-color-primary);
90
90
  text-decoration: underline;
91
91
 
@@ -6,6 +6,7 @@ import * as Common from '../../core/common/common.js';
6
6
  import * as i18n from '../../core/i18n/i18n.js';
7
7
  import * as Platform from '../../core/platform/platform.js';
8
8
  import * as SDK from '../../core/sdk/sdk.js';
9
+ import * as StackTrace from '../../models/stack_trace/stack_trace.js';
9
10
  import * as UI from '../../ui/legacy/legacy.js';
10
11
  import * as Lit from '../../ui/lit/lit.js';
11
12
 
@@ -63,7 +64,7 @@ export class ConsoleContextSelector implements SDK.TargetManager.SDKModelObserve
63
64
  UI.Context.Context.instance().addFlavorChangeListener(
64
65
  SDK.RuntimeModel.ExecutionContext, this.executionContextChangedExternally, this);
65
66
  UI.Context.Context.instance().addFlavorChangeListener(
66
- SDK.DebuggerModel.CallFrame, this.callFrameSelectedInUI, this);
67
+ StackTrace.StackTrace.DebuggableFrameFlavor, this.callFrameSelectedInUI, this);
67
68
  SDK.TargetManager.TargetManager.instance().observeModels(SDK.RuntimeModel.RuntimeModel, this, {scoped: true});
68
69
  SDK.TargetManager.TargetManager.instance().addModelListener(
69
70
  SDK.DebuggerModel.DebuggerModel, SDK.DebuggerModel.Events.CallFrameSelected, this.callFrameSelectedInModel,
@@ -263,8 +264,8 @@ export class ConsoleContextSelector implements SDK.TargetManager.SDKModelObserve
263
264
  }
264
265
 
265
266
  private callFrameSelectedInUI(): void {
266
- const callFrame = UI.Context.Context.instance().flavor(SDK.DebuggerModel.CallFrame);
267
- const callFrameContext = callFrame?.script.executionContext();
267
+ const callFrame = UI.Context.Context.instance().flavor(StackTrace.StackTrace.DebuggableFrameFlavor);
268
+ const callFrameContext = callFrame?.sdkFrame.script.executionContext();
268
269
  if (callFrameContext) {
269
270
  UI.Context.Context.instance().setFlavor(SDK.RuntimeModel.ExecutionContext, callFrameContext);
270
271
  }
@@ -54,7 +54,7 @@ import * as Buttons from '../../ui/components/buttons/buttons.js';
54
54
  import * as CodeHighlighter from '../../ui/components/code_highlighter/code_highlighter.js';
55
55
  import * as Highlighting from '../../ui/components/highlighting/highlighting.js';
56
56
  import * as TextEditor from '../../ui/components/text_editor/text_editor.js';
57
- import {Icon} from '../../ui/kit/kit.js';
57
+ import {Icon, Link} from '../../ui/kit/kit.js';
58
58
  import * as Components from '../../ui/legacy/components/utils/utils.js';
59
59
  import * as UI from '../../ui/legacy/legacy.js';
60
60
  import * as Lit from '../../ui/lit/lit.js';
@@ -2458,7 +2458,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
2458
2458
  value = Platform.StringUtilities.trimMiddle(value, 60);
2459
2459
  }
2460
2460
  const link = node && node.nodeName().toLowerCase() === 'a' ?
2461
- UI.XLink.XLink.create(rewrittenHref, value, '', true /* preventClick */, 'image-url') :
2461
+ Link.create(rewrittenHref, value, undefined, 'image-url') :
2462
2462
  Components.Linkifier.Linkifier.linkifyURL(rewrittenHref, {
2463
2463
  text: value,
2464
2464
  preventClick: true,
@@ -101,6 +101,14 @@ const UIStrings = {
101
101
  * @description A context menu item in Styles panel to view the computed CSS property value.
102
102
  */
103
103
  viewComputedValue: 'View computed value',
104
+ /**
105
+ * @description Tooltip text for a style property overridden by an animation.
106
+ */
107
+ overriddenByAnimation: 'Overridden by animation styles.',
108
+ /**
109
+ * @description Link text in the tooltip to open the Animations panel.
110
+ */
111
+ openAnimationsPanel: 'Open Animations panel',
104
112
  /**
105
113
  * @description Title of the button that opens the flexbox editor in the Styles panel.
106
114
  */
@@ -2465,6 +2473,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
2465
2473
 
2466
2474
  if (this.property.parsedOk) {
2467
2475
  this.updateAuthoringHint();
2476
+ this.updateAnimationOverrideHint();
2468
2477
  } else {
2469
2478
  // Avoid having longhands under an invalid shorthand.
2470
2479
  this.listItemElement.classList.add('not-parsed-ok');
@@ -2695,6 +2704,60 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
2695
2704
  }
2696
2705
  }
2697
2706
 
2707
+ updateAnimationOverrideHint(): void {
2708
+ const existingElement = this.listItemElement.querySelector('.animation-override-hint-wrapper');
2709
+ if (existingElement) {
2710
+ existingElement?.remove();
2711
+ }
2712
+
2713
+ if (!this.overriddenByAnimation() || UI.ViewManager.ViewManager.instance().isViewVisible('animations')) {
2714
+ return;
2715
+ }
2716
+
2717
+ const wrapper = document.createElement('span');
2718
+ wrapper.classList.add('animation-override-hint-wrapper', 'hint-wrapper');
2719
+ const hintIcon = new Icon();
2720
+ hintIcon.name = 'info';
2721
+ hintIcon.classList.add('hint', 'small');
2722
+ hintIcon.tabIndex = -1;
2723
+
2724
+ wrapper.append(hintIcon);
2725
+ this.listItemElement.append(wrapper);
2726
+
2727
+ const tooltipId = this.getTooltipId('animation-override-hint');
2728
+ hintIcon.setAttribute('aria-details', tooltipId);
2729
+
2730
+ const tooltip = new Tooltips.Tooltip.Tooltip({
2731
+ anchor: hintIcon,
2732
+ variant: 'rich',
2733
+ padding: 'large',
2734
+ id: tooltipId,
2735
+ jslogContext: 'elements.css-animation-hint'
2736
+ });
2737
+ const message = i18nString(UIStrings.overriddenByAnimation);
2738
+ const content = document.createElement('div');
2739
+ content.classList.add('animation-override-hint');
2740
+ content.textContent = message;
2741
+
2742
+ const link = document.createElement('devtools-link');
2743
+ link.textContent = i18nString(UIStrings.openAnimationsPanel);
2744
+ link.jslogContext = 'open-in-animations-panel';
2745
+ link.addEventListener('click', event => {
2746
+ event.preventDefault();
2747
+ void UI.ViewManager.ViewManager.instance().showView('animations');
2748
+ });
2749
+
2750
+ content.appendChild(document.createTextNode(' '));
2751
+ content.appendChild(link);
2752
+ tooltip.appendChild(content);
2753
+
2754
+ this.listItemElement.appendChild(tooltip);
2755
+ }
2756
+
2757
+ private overriddenByAnimation(): boolean {
2758
+ return this.#matchedStyles.isPropertyOverriddenByAnimation(this.property);
2759
+ }
2760
+
2698
2761
  private mouseUp(event: MouseEvent): void {
2699
2762
  const activeTreeElement = parentMap.get(this.#parentPane);
2700
2763
  parentMap.delete(this.#parentPane);
@@ -237,6 +237,12 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
237
237
  }
238
238
  return null;
239
239
  }, () => this.node());
240
+
241
+ UI.ViewManager.ViewManager.instance().addEventListener(UI.ViewManager.Events.VIEW_VISIBILITY_CHANGED, event => {
242
+ if (event.data.revealedViewId === 'animations' || event.data.hiddenViewId === 'animations') {
243
+ this.#scheduleResetUpdateIfNotEditing();
244
+ }
245
+ });
240
246
  }
241
247
 
242
248
  get webCustomData(): WebCustomData|undefined {
@@ -741,6 +747,10 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
741
747
  return;
742
748
  }
743
749
 
750
+ if (!UI.ViewManager.ViewManager.instance().isViewVisible('animations')) {
751
+ return;
752
+ }
753
+
744
754
  void this.computedStyleUpdateThrottler.schedule(async () => {
745
755
  await this.#updateAnimatedStyles();
746
756
  this.handledComputedStyleChangedForTest();
@@ -1078,7 +1088,14 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
1078
1088
  // We disable the layer widget initially. If we see a layer in
1079
1089
  // the matched styles we reenable the button.
1080
1090
  LayersWidget.ButtonProvider.instance().item().setVisible(false);
1091
+ const animationsPanelVisible = UI.ViewManager.ViewManager.instance().isViewVisible('animations');
1081
1092
  for (const style of matchedStyles.nodeStyles()) {
1093
+ const isTransitionOrAnimationStyle = style.type === SDK.CSSStyleDeclaration.Type.Transition ||
1094
+ style.type === SDK.CSSStyleDeclaration.Type.Animation;
1095
+ if (isTransitionOrAnimationStyle && !animationsPanelVisible) {
1096
+ continue;
1097
+ }
1098
+
1082
1099
  const parentNode = matchedStyles.isInherited(style) ? matchedStyles.nodeForStyle(style) : null;
1083
1100
  if (parentNode && parentNode !== lastParentNode) {
1084
1101
  lastParentNode = parentNode;
@@ -1090,8 +1107,6 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
1090
1107
  addLayerSeparator(style);
1091
1108
 
1092
1109
  const lastBlock = blocks[blocks.length - 1];
1093
- const isTransitionOrAnimationStyle = style.type === SDK.CSSStyleDeclaration.Type.Transition ||
1094
- style.type === SDK.CSSStyleDeclaration.Type.Animation;
1095
1110
  if (lastBlock && (!isTransitionOrAnimationStyle || style.allProperties().length > 0)) {
1096
1111
  this.idleCallbackManager.schedule(() => {
1097
1112
  const section = new StylePropertiesSection(
@@ -165,6 +165,10 @@ devtools-icon.icon-link {
165
165
  opacity: 50%;
166
166
  }
167
167
 
168
+ .animation-override-hint {
169
+ max-width: 232px;
170
+ }
171
+
168
172
  .hint-wrapper {
169
173
  align-items: center;
170
174
  display: inline-block;
@@ -5,7 +5,7 @@
5
5
 
6
6
  import * as i18n from '../../core/i18n/i18n.js';
7
7
  import type * as Platform from '../../core/platform/platform.js';
8
- import * as UI from '../../ui/legacy/legacy.js';
8
+ import {Link} from '../../ui/kit/kit.js';
9
9
 
10
10
  import {AffectedResourcesView} from './AffectedResourcesView.js';
11
11
 
@@ -46,8 +46,8 @@ export class AffectedMetadataAllowedSitesView extends AffectedResourcesView {
46
46
  optOutTextElement.textContent = ' (opt-out: ' + issueData.details().optOutPercentage + '% - ';
47
47
  textContentElement.appendChild(optOutTextElement);
48
48
 
49
- const linkElement = UI.XLink.XLink.create(
50
- 'https://developers.google.com/privacy-sandbox/blog/grace-period-opt-out', 'learn more');
49
+ const linkElement =
50
+ Link.create('https://developers.google.com/privacy-sandbox/blog/grace-period-opt-out', 'learn more');
51
51
  textContentElement.appendChild(linkElement);
52
52
 
53
53
  const endTextElement = document.createElement('span');
@@ -9,6 +9,7 @@ import type * as SDK from '../../core/sdk/sdk.js';
9
9
  import type * as Protocol from '../../generated/protocol.js';
10
10
  import * as Geometry from '../../models/geometry/geometry.js';
11
11
  import * as uiI18n from '../../ui/i18n/i18n.js';
12
+ import {Link} from '../../ui/kit/kit.js';
12
13
  import * as UI from '../../ui/legacy/legacy.js';
13
14
  import * as Lit from '../../ui/lit/lit.js';
14
15
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
@@ -118,7 +119,7 @@ export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLE
118
119
  uiI18n.getFormatLocalizedString(
119
120
  str_, UIStrings.checkSForPossibleReasons,
120
121
  {
121
- PH1: UI.XLink.XLink.create('about:gpu', undefined, undefined, undefined, 'about-gpu')
122
+ PH1: Link.create('about:gpu', undefined, undefined, 'about-gpu')
122
123
  }
123
124
  )
124
125
  ],
@@ -9,6 +9,7 @@ import type * as Common from '../../core/common/common.js';
9
9
  import * as i18n from '../../core/i18n/i18n.js';
10
10
  import type * as Platform from '../../core/platform/platform.js';
11
11
  import * as Buttons from '../../ui/components/buttons/buttons.js';
12
+ import {Link} from '../../ui/kit/kit.js';
12
13
  import * as UI from '../../ui/legacy/legacy.js';
13
14
 
14
15
  import {type LighthouseController, type Preset, Presets, RuntimeSettings} from './LighthouseController.js';
@@ -87,8 +88,8 @@ export class StartView extends UI.Widget.Widget {
87
88
  labelEl.textContent = label;
88
89
 
89
90
  if (runtimeSetting.learnMore) {
90
- const link = UI.XLink.XLink.create(
91
- runtimeSetting.learnMore, i18nString(UIStrings.learnMore), 'lighthouse-learn-more', undefined, 'learn-more');
91
+ const link =
92
+ Link.create(runtimeSetting.learnMore, i18nString(UIStrings.learnMore), 'lighthouse-learn-more', 'learn-more');
92
93
  labelEl.append(link);
93
94
  }
94
95
  parentElement.appendChild(labelEl);
@@ -111,8 +112,8 @@ export class StartView extends UI.Widget.Widget {
111
112
  runtimeSetting.setting as Common.Settings.Setting<boolean>, runtimeSetting.description());
112
113
  toolbar.appendToolbarItem(control);
113
114
  if (runtimeSetting.learnMore) {
114
- const link = UI.XLink.XLink.create(
115
- runtimeSetting.learnMore, i18nString(UIStrings.learnMore), 'lighthouse-learn-more', undefined, 'learn-more');
115
+ const link =
116
+ Link.create(runtimeSetting.learnMore, i18nString(UIStrings.learnMore), 'lighthouse-learn-more', 'learn-more');
116
117
  link.style.margin = '5px';
117
118
  control.element.appendChild(link);
118
119
  }
@@ -135,8 +136,8 @@ export class StartView extends UI.Widget.Widget {
135
136
  control.setTitle(runtimeSetting.description());
136
137
  toolbar.appendToolbarItem(control);
137
138
  if (runtimeSetting.learnMore) {
138
- const link = UI.XLink.XLink.create(
139
- runtimeSetting.learnMore, i18nString(UIStrings.learnMore), 'lighthouse-learn-more', undefined, 'learn-more');
139
+ const link =
140
+ Link.create(runtimeSetting.learnMore, i18nString(UIStrings.learnMore), 'lighthouse-learn-more', 'learn-more');
140
141
  link.style.marginLeft = '5px';
141
142
  link.style.display = 'inline-flex';
142
143
  link.style.height = 'revert';
@@ -6,6 +6,7 @@
6
6
  import * as Common from '../../core/common/common.js';
7
7
  import * as i18n from '../../core/i18n/i18n.js';
8
8
  import type * as Platform from '../../core/platform/platform.js';
9
+ import {Link} from '../../ui/kit/kit.js';
9
10
  import * as UI from '../../ui/legacy/legacy.js';
10
11
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
11
12
 
@@ -59,8 +60,8 @@ export class LinearMemoryInspectorPane extends Common.ObjectWrapper.eventMixin<E
59
60
 
60
61
  const description = placeholder.createChild('div', 'empty-state-description');
61
62
  description.createChild('span').textContent = i18nString(UIStrings.memoryInspectorExplanation);
62
- const link = UI.XLink.XLink.create(
63
- MEMORY_INSPECTOR_EXPLANATION_URL, i18nString(UIStrings.learnMore), undefined, undefined, 'learn-more');
63
+ const link =
64
+ Link.create(MEMORY_INSPECTOR_EXPLANATION_URL, i18nString(UIStrings.learnMore), undefined, 'learn-more');
64
65
  description.appendChild(link);
65
66
 
66
67
  return placeholder;