chrome-devtools-frontend 1.0.1575174 → 1.0.1576287

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 (125) hide show
  1. package/.stylelintrc.json +1 -1
  2. package/front_end/core/host/AidaClient.ts +21 -0
  3. package/front_end/core/host/InspectorFrontendHostAPI.ts +2 -0
  4. package/front_end/core/sdk/CSSMatchedStyles.ts +27 -0
  5. package/front_end/core/sdk/NetworkManager.ts +3 -1
  6. package/front_end/core/sdk/NetworkRequest.ts +7 -0
  7. package/front_end/core/sdk/SourceMapScopesInfo.ts +2 -1
  8. package/front_end/entrypoints/main/MainImpl.ts +13 -7
  9. package/front_end/entrypoints/node_app/app/NodeConnectionsPanel.ts +3 -2
  10. package/front_end/generated/InspectorBackendCommands.ts +37 -0
  11. package/front_end/generated/SupportedCSSProperties.js +7 -0
  12. package/front_end/generated/protocol-mapping.d.ts +257 -0
  13. package/front_end/generated/protocol-proxy-api.d.ts +256 -0
  14. package/front_end/generated/protocol.ts +359 -0
  15. package/front_end/models/ai_assistance/AiConversation.ts +31 -10
  16. package/front_end/models/ai_assistance/AiHistoryStorage.ts +1 -0
  17. package/front_end/models/ai_assistance/agents/AiAgent.ts +35 -5
  18. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +73 -0
  19. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +141 -0
  20. package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
  21. package/front_end/models/ai_code_generation/AiCodeGeneration.ts +6 -0
  22. package/front_end/models/javascript_metadata/NativeFunctions.js +9 -0
  23. package/front_end/models/live-metrics/LiveMetrics.ts +31 -51
  24. package/front_end/models/source_map_scopes/NamesResolver.ts +5 -8
  25. package/front_end/models/stack_trace/StackTrace.ts +2 -1
  26. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +84 -6
  27. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +1 -0
  28. package/front_end/panels/ai_assistance/components/ChatMessage.ts +6 -4
  29. package/front_end/panels/ai_assistance/components/ChatView.ts +5 -6
  30. package/front_end/panels/ai_assistance/components/chatView.css +10 -0
  31. package/front_end/panels/application/DeviceBoundSessionsTreeElement.ts +22 -1
  32. package/front_end/panels/application/DeviceBoundSessionsView.ts +44 -33
  33. package/front_end/panels/application/StorageView.ts +3 -3
  34. package/front_end/panels/application/deviceBoundSessionsView.css +1 -1
  35. package/front_end/panels/application/preloading/components/preloadingDisabledInfobar.css +1 -1
  36. package/front_end/panels/common/AiCodeGenerationUpgradeDialog.ts +12 -4
  37. package/front_end/panels/common/GeminiRebrandPromoDialog.ts +5 -5
  38. package/front_end/panels/common/aiCodeCompletionSummaryToolbar.css +1 -1
  39. package/front_end/panels/console/ConsoleContextSelector.ts +4 -3
  40. package/front_end/panels/elements/ElementsTreeElement.ts +2 -2
  41. package/front_end/panels/elements/StylePropertyTreeElement.ts +63 -0
  42. package/front_end/panels/elements/StylesSidebarPane.ts +17 -2
  43. package/front_end/panels/elements/stylePropertiesTreeOutline.css +4 -0
  44. package/front_end/panels/issues/AffectedMetadataAllowedSitesView.ts +3 -3
  45. package/front_end/panels/layer_viewer/Layers3DView.ts +2 -1
  46. package/front_end/panels/lighthouse/LighthouseStartView.ts +7 -6
  47. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +3 -2
  48. package/front_end/panels/network/NetworkItemView.ts +32 -3
  49. package/front_end/panels/network/RequestConditionsDrawer.ts +2 -3
  50. package/front_end/panels/network/RequestDeviceBoundSessionsView.ts +160 -0
  51. package/front_end/panels/network/RequestPayloadView.ts +72 -97
  52. package/front_end/panels/network/SignedExchangeInfoView.ts +3 -4
  53. package/front_end/panels/network/components/HeaderSectionRow.css +1 -1
  54. package/front_end/panels/network/forward/UIRequestLocation.ts +1 -0
  55. package/front_end/panels/network/network.ts +3 -0
  56. package/front_end/panels/network/requestDeviceBoundSessionsView.css +14 -0
  57. package/front_end/panels/recorder/components/RecordingView.ts +2 -2
  58. package/front_end/panels/recorder/components/recordingView.css +5 -0
  59. package/front_end/panels/security/SecurityPanelSidebar.ts +10 -9
  60. package/front_end/panels/settings/AISettingsTab.ts +4 -3
  61. package/front_end/panels/settings/KeybindsSettingsTab.ts +3 -5
  62. package/front_end/panels/settings/SettingsScreen.ts +2 -3
  63. package/front_end/panels/sources/CallStackSidebarPane.ts +10 -0
  64. package/front_end/panels/sources/DebuggerPlugin.ts +18 -12
  65. package/front_end/panels/sources/ScopeChainSidebarPane.ts +4 -3
  66. package/front_end/panels/sources/SourcesNavigator.ts +2 -2
  67. package/front_end/panels/sources/SourcesPanel.ts +6 -3
  68. package/front_end/panels/sources/TabbedEditorContainer.ts +2 -2
  69. package/front_end/panels/sources/sources-meta.ts +2 -1
  70. package/front_end/panels/timeline/TimelinePanel.ts +2 -1
  71. package/front_end/panels/timeline/TimelineUIUtils.ts +2 -2
  72. package/front_end/panels/timeline/components/DetailsView.ts +7 -7
  73. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +2 -2
  74. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +11 -4
  75. package/front_end/panels/whats_new/releaseNoteView.css +1 -1
  76. package/front_end/panels/whats_new/resources/WNDT.md +1 -1
  77. package/front_end/third_party/chromium/README.chromium +1 -1
  78. package/front_end/third_party/puppeteer/README.chromium +2 -2
  79. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.d.ts.map +1 -1
  80. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.js +30 -25
  81. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.js.map +1 -1
  82. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  83. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  84. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  85. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  86. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +30 -21
  87. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.d.ts.map +1 -1
  88. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.js +31 -26
  89. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.js.map +1 -1
  90. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  91. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  92. package/front_end/third_party/puppeteer/package/package.json +3 -3
  93. package/front_end/third_party/puppeteer/package/src/cdp/TargetManager.ts +45 -44
  94. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  95. package/front_end/third_party/source-map-scopes-codec/README.chromium +2 -2
  96. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts +2 -2
  97. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts.map +1 -1
  98. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts +1 -1
  99. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts.map +1 -1
  100. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/scopes.d.ts +9 -1
  101. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/scopes.d.ts.map +1 -1
  102. package/front_end/third_party/source-map-scopes-codec/package/deno.json +8 -1
  103. package/front_end/third_party/source-map-scopes-codec/package/package.json +1 -1
  104. package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js +20 -7
  105. package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js.map +1 -1
  106. package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.ts +29 -9
  107. package/front_end/third_party/source-map-scopes-codec/package/src/mod.js.map +1 -1
  108. package/front_end/third_party/source-map-scopes-codec/package/src/mod.ts +1 -0
  109. package/front_end/third_party/source-map-scopes-codec/package/src/scopes.js +1 -1
  110. package/front_end/third_party/source-map-scopes-codec/package/src/scopes.ts +12 -1
  111. package/front_end/ui/components/buttons/Button.ts +2 -2
  112. package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -1
  113. package/front_end/ui/components/panel_feedback/panelFeedback.css +1 -1
  114. package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +37 -5
  115. package/front_end/ui/kit/link/Link.ts +31 -0
  116. package/front_end/ui/legacy/LinkContextMenuProvider.ts +3 -5
  117. package/front_end/ui/legacy/components/object_ui/ObjectPopoverHelper.ts +2 -2
  118. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +336 -250
  119. package/front_end/ui/legacy/inspectorCommon.css +0 -1
  120. package/front_end/ui/legacy/legacy.ts +0 -4
  121. package/front_end/ui/visual_logging/KnownContextValues.ts +11 -0
  122. package/front_end/ui/visual_logging/LoggingDriver.ts +10 -6
  123. package/package.json +1 -1
  124. package/front_end/ui/legacy/XElement.ts +0 -41
  125. 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,16 @@ 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
+ /**
208
+ * @description Disclaimer text right after the chat input.
209
+ */
210
+ inputDisclaimerForNoContext:
211
+ 'Chat messages, any data the inspected page can see using Web APIs, and the items you select such as files, network requests, and performance traces are sent to Google and may be seen by human reviewers to improve this feature. This is an experimental AI feature and won’t always get it right.',
212
+ /**
213
+ * @description Disclaimer text right after the chat input.
214
+ */
215
+ inputDisclaimerForNoContextEnterpriseNoLogging:
216
+ 'Chat messages, any data the inspected page can see using Web APIs, and the items you select such as files, network requests, and performance traces are sent to Google. This data will not be used to improve Google’s AI models. This is an experimental AI feature and won’t always get it right.',
207
217
  } as const;
208
218
 
209
219
  const str_ = i18n.i18n.registerUIStrings('panels/ai_assistance/AiAssistancePanel.ts', UIStrings);
@@ -259,6 +269,14 @@ async function getEmptyStateSuggestions(conversation?: AiAssistanceModel.AiConve
259
269
  ];
260
270
  }
261
271
 
272
+ case AiAssistanceModel.AiHistoryStorage.ConversationType.NONE: {
273
+ return [
274
+ {title: 'How can I use DevTools to debug?', jslogContext: 'empty'},
275
+ {title: 'What performance issues exist with my page?', jslogContext: 'empty'},
276
+ {title: 'What are the slowest requests on this page?', jslogContext: 'empty'},
277
+ ];
278
+ }
279
+
262
280
  default:
263
281
  Platform.assertNever(conversation.type, 'Unknown conversation type');
264
282
  }
@@ -395,7 +413,7 @@ function defaultView(input: ViewInput, output: PanelViewOutput, target: HTMLElem
395
413
  return html`
396
414
  <devtools-ai-chat-view
397
415
  .props=${input.props}
398
- ${Lit.Directives.ref((el: Element | undefined) => {
416
+ ${Lit.Directives.ref(el => {
399
417
  if (!el || !(el instanceof ChatView)) {
400
418
  return;
401
419
  }
@@ -490,6 +508,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
490
508
  #userInfo: {
491
509
  accountImage?: string,
492
510
  accountFullName?: string,
511
+ accountGivenName?: string,
493
512
  };
494
513
  #timelinePanelInstance: TimelinePanel.TimelinePanel.TimelinePanel|null = null;
495
514
  #runAbortController = new AbortController();
@@ -509,6 +528,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
509
528
  this.#userInfo = {
510
529
  accountImage: syncInfo.accountImage,
511
530
  accountFullName: syncInfo.accountFullName,
531
+ accountGivenName: syncInfo.accountGivenName,
512
532
  };
513
533
 
514
534
  if (UI.ActionRegistry.ActionRegistry.instance().hasAction('elements.toggle-element-search')) {
@@ -658,6 +678,10 @@ export class AiAssistancePanel extends UI.Panel.Panel {
658
678
  targetConversationType = AiAssistanceModel.AiHistoryStorage.ConversationType.PERFORMANCE;
659
679
  }
660
680
 
681
+ if (isAiAssistanceContextSelectionAgentEnabled() && !targetConversationType) {
682
+ return AiAssistanceModel.AiHistoryStorage.ConversationType.NONE;
683
+ }
684
+
661
685
  return targetConversationType;
662
686
  }
663
687
 
@@ -680,6 +704,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
680
704
  new AiAssistanceModel.AiConversation.AiConversation(
681
705
  targetConversationType, [], undefined, false, this.#aidaClient, this.#changeManager) :
682
706
  undefined;
707
+
683
708
  this.#updateConversationState(conversation);
684
709
  }
685
710
 
@@ -807,6 +832,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
807
832
  this.#userInfo = {
808
833
  accountImage: syncInfo.accountImage,
809
834
  accountFullName: syncInfo.accountFullName,
835
+ accountGivenName: syncInfo.accountGivenName,
810
836
  };
811
837
  this.requestUpdate();
812
838
  }
@@ -930,7 +956,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
930
956
  return true;
931
957
  }
932
958
 
933
- if (!this.#conversation.selectedContext) {
959
+ if (!this.#conversation.selectedContext && !isAiAssistanceContextSelectionAgentEnabled()) {
934
960
  return true;
935
961
  }
936
962
 
@@ -982,6 +1008,8 @@ export class AiAssistancePanel extends UI.Panel.Panel {
982
1008
 
983
1009
  return lockedString(UIStringsNotTranslate.inputPlaceholderForPerformanceWithNoRecording);
984
1010
  }
1011
+ case AiAssistanceModel.AiHistoryStorage.ConversationType.NONE:
1012
+ return lockedString(UIStringsNotTranslate.inputPlaceholderForNoContext);
985
1013
  }
986
1014
  }
987
1015
 
@@ -1016,6 +1044,12 @@ export class AiAssistancePanel extends UI.Panel.Panel {
1016
1044
  return lockedString(UIStringsNotTranslate.inputDisclaimerForPerformanceEnterpriseNoLogging);
1017
1045
  }
1018
1046
  return lockedString(UIStringsNotTranslate.inputDisclaimerForPerformance);
1047
+
1048
+ case AiAssistanceModel.AiHistoryStorage.ConversationType.NONE:
1049
+ if (noLogging) {
1050
+ return lockedString(UIStringsNotTranslate.inputDisclaimerForNoContextEnterpriseNoLogging);
1051
+ }
1052
+ return lockedString(UIStringsNotTranslate.inputDisclaimerForNoContext);
1019
1053
  }
1020
1054
  }
1021
1055
 
@@ -1249,9 +1283,41 @@ export class AiAssistancePanel extends UI.Panel.Panel {
1249
1283
  return this.#selectedRequest;
1250
1284
  case AiAssistanceModel.AiHistoryStorage.ConversationType.PERFORMANCE:
1251
1285
  return this.#selectedPerformanceTrace;
1286
+ case AiAssistanceModel.AiHistoryStorage.ConversationType.NONE:
1287
+ return null;
1252
1288
  }
1253
1289
  }
1254
1290
 
1291
+ #handleConversationContextChange = (data: unknown): void => {
1292
+ if (data instanceof Workspace.UISourceCode.UISourceCode) {
1293
+ if (this.#selectedFile?.getItem() === data) {
1294
+ return;
1295
+ }
1296
+ this.#selectedFile = new AiAssistanceModel.FileAgent.FileContext(data);
1297
+
1298
+ } else if (data instanceof SDK.DOMModel.DOMNode) {
1299
+ if (this.#selectedElement?.getItem() === data ||
1300
+ // Ignore non node type like comments or html tags
1301
+ data.nodeType() === Node.ELEMENT_NODE) {
1302
+ return;
1303
+ }
1304
+ this.#selectedElement = new AiAssistanceModel.StylingAgent.NodeContext(data);
1305
+ } else if (data instanceof SDK.NetworkRequest.NetworkRequest) {
1306
+ if (this.#selectedRequest?.getItem() === data) {
1307
+ return;
1308
+ }
1309
+ const calculator = NetworkPanel.NetworkPanel.NetworkPanel.instance().networkLogView.timeCalculator();
1310
+ this.#selectedRequest = new AiAssistanceModel.NetworkAgent.RequestContext(data, calculator);
1311
+ } else if (data instanceof AiAssistanceModel.AIContext.AgentFocus) {
1312
+ if (this.#selectedPerformanceTrace?.getItem() === data) {
1313
+ return;
1314
+ }
1315
+ this.#selectedPerformanceTrace = new AiAssistanceModel.PerformanceAgent.PerformanceTraceContext(data);
1316
+ }
1317
+
1318
+ this.#updateConversationState(this.#conversation);
1319
+ };
1320
+
1255
1321
  async #startConversation(
1256
1322
  text: string,
1257
1323
  imageInput?: Host.AidaClient.Part,
@@ -1453,6 +1519,14 @@ export class AiAssistancePanel extends UI.Panel.Panel {
1453
1519
  }
1454
1520
  break;
1455
1521
  }
1522
+
1523
+ case AiAssistanceModel.AiAgent.ResponseType.CONTEXT_CHANGE: {
1524
+ this.#handleConversationContextChange(data.context);
1525
+ step.isLoading = false;
1526
+ commitStep();
1527
+
1528
+ break;
1529
+ }
1456
1530
  }
1457
1531
 
1458
1532
  // Commit update intermediate step when not
@@ -1576,6 +1650,10 @@ function isAiAssistanceMultimodalInputEnabled(): boolean {
1576
1650
  return Boolean(Root.Runtime.hostConfig.devToolsFreestyler?.multimodal);
1577
1651
  }
1578
1652
 
1653
+ function isAiAssistanceContextSelectionAgentEnabled(): boolean {
1654
+ return Boolean(Root.Runtime.hostConfig.devToolsAiAssistanceContextSelectionAgent?.enabled);
1655
+ }
1656
+
1579
1657
  function isAiAssistanceServerSideLoggingEnabled(): boolean {
1580
1658
  return !Root.Runtime.hostConfig.aidaAvailability?.disallowLogging;
1581
1659
  }
@@ -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
  }
@@ -6,6 +6,7 @@ import type * as Common from '../../core/common/common.js';
6
6
  import * as i18n from '../../core/i18n/i18n.js';
7
7
  import type * as Platform from '../../core/platform/platform.js';
8
8
  import {createIcon} from '../../ui/kit/kit.js';
9
+ import * as UI from '../../ui/legacy/legacy.js';
9
10
 
10
11
  import {ApplicationPanelTreeElement} from './ApplicationPanelTreeElement.js';
11
12
  import {
@@ -46,6 +47,16 @@ const UIStrings = {
46
47
  * linked to a session.
47
48
  */
48
49
  noSession: 'No session',
50
+ /**
51
+ *@description Tooltip text for a terminated session.
52
+ *@example {session_1} sessionName
53
+ */
54
+ terminatedSession: '{sessionName}, Session terminated',
55
+ /**
56
+ *@description Tooltip text for a session with errors.
57
+ *@example {session_1} sessionName
58
+ */
59
+ sessionWithErrors: '{sessionName}, Session has errors',
49
60
  } as const;
50
61
 
51
62
  const str_ = i18n.i18n.registerUIStrings('panels/application/DeviceBoundSessionsTreeElement.ts', UIStrings);
@@ -122,13 +133,23 @@ export class RootTreeElement extends ApplicationPanelTreeElement {
122
133
 
123
134
  #updateElementIconAndStyling(
124
135
  sessionElement: ApplicationPanelTreeElement, isSessionTerminated: boolean, sessionHasErrors: boolean): void {
136
+ const title = sessionElement.title as string;
125
137
  if (isSessionTerminated) {
126
138
  sessionElement.listItemElement.classList.add('device-bound-session-terminated');
127
139
  sessionElement.setLeadingIcons([createIcon('database-off')]);
140
+ const terminatedTitle = i18nString(UIStrings.terminatedSession, {sessionName: title});
141
+ UI.ARIAUtils.setLabel(sessionElement.listItemElement, terminatedTitle);
128
142
  return;
129
143
  }
130
144
  sessionElement.listItemElement.classList.remove('device-bound-session-terminated');
131
- sessionElement.setLeadingIcons([createIcon(sessionHasErrors ? 'warning' : 'database')]);
145
+ if (sessionHasErrors) {
146
+ sessionElement.setLeadingIcons([createIcon('warning')]);
147
+ const errorTitle = i18nString(UIStrings.sessionWithErrors, {sessionName: title});
148
+ UI.ARIAUtils.setLabel(sessionElement.listItemElement, errorTitle);
149
+ } else {
150
+ sessionElement.setLeadingIcons([createIcon('database')]);
151
+ UI.ARIAUtils.setLabel(sessionElement.listItemElement, title);
152
+ }
132
153
  }
133
154
 
134
155
  #updateIconAndStyling(site: string, sessionId: string|undefined): void {
@@ -125,6 +125,10 @@ const UIStrings = {
125
125
  *@description Section header for details about an event.
126
126
  */
127
127
  eventDetails: 'Event details',
128
+ /**
129
+ *@description Accessible label for the main area containing session details.
130
+ */
131
+ sessionDetails: 'Session details',
128
132
  /**
129
133
  *@description Placeholder text when no row is selected in a table of events.
130
134
  */
@@ -576,7 +580,8 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: ViewOutput, target: HTML
576
580
  const {key, inclusionRules, cookieCravings} = sessionAndEvents.session;
577
581
  sessionDetailsHtml = html`
578
582
  <devtools-report>
579
- <devtools-report-section-header>${i18nString(UIStrings.sessionConfig)}</devtools-report-section-header>
583
+ <devtools-report-section-header role="heading" aria-level="2">${
584
+ i18nString(UIStrings.sessionConfig)}</devtools-report-section-header>
580
585
  <devtools-report-key>${i18nString(UIStrings.keySite)}</devtools-report-key>
581
586
  <devtools-report-value>${key.site}</devtools-report-value>
582
587
  <devtools-report-key>${i18nString(UIStrings.keyId)}</devtools-report-key>
@@ -590,7 +595,8 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: ViewOutput, target: HTML
590
595
  <devtools-report-value>${sessionAndEvents.session.cachedChallenge || ''}</devtools-report-value>
591
596
  <devtools-report-key>${i18nString(UIStrings.allowedRefreshInitiators)}</devtools-report-key>
592
597
  <devtools-report-value>${sessionAndEvents.session.allowedRefreshInitiators.join(', ')}</devtools-report-value>
593
- <devtools-report-section-header>${i18nString(UIStrings.scope)}</devtools-report-section-header>
598
+ <devtools-report-section-header role="heading" aria-level="2">${
599
+ i18nString(UIStrings.scope)}</devtools-report-section-header>
594
600
  <devtools-report-key>${i18nString(UIStrings.origin)}</devtools-report-key>
595
601
  <devtools-report-value>${inclusionRules.origin}</devtools-report-value>
596
602
  <devtools-report-key>${i18nString(UIStrings.includeSite)}</devtools-report-key>
@@ -599,13 +605,14 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: ViewOutput, target: HTML
599
605
  ${
600
606
  inclusionRules.urlRules.length > 0 ? html`
601
607
  <div class="device-bound-session-grid-wrapper">
602
- <devtools-data-grid class="device-bound-session-url-rules-grid" striped inline>
608
+ <devtools-data-grid class="device-bound-session-url-rules-grid" striped inline name=${
609
+ i18nString(UIStrings.scope)}>
603
610
  <table>
604
611
  <thead>
605
612
  <tr>
606
- <th id="should-include" weight="1" sortable>${i18nString(UIStrings.ruleType)}</th>
607
- <th id="host-pattern" weight="2" sortable>${i18nString(UIStrings.ruleHostPattern)}</th>
608
- <th id="path-prefix" weight="2" sortable>${i18nString(UIStrings.rulePathPrefix)}</th>
613
+ <th id="should-include" sortable>${i18nString(UIStrings.ruleType)}</th>
614
+ <th id="host-pattern" sortable>${i18nString(UIStrings.ruleHostPattern)}</th>
615
+ <th id="path-prefix" sortable>${i18nString(UIStrings.rulePathPrefix)}</th>
609
616
  </tr>
610
617
  </thead>
611
618
  <tbody>
@@ -622,22 +629,22 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: ViewOutput, target: HTML
622
629
  </div>
623
630
  ` :
624
631
  nothing}
625
- <devtools-report-section-header>${i18nString(UIStrings.cookieCravings)}</devtools-report-section-header>
632
+ <devtools-report-section-header role="heading" aria-level="2">${
633
+ i18nString(UIStrings.cookieCravings)}</devtools-report-section-header>
626
634
  ${
627
635
  cookieCravings.length > 0 ? html`
628
636
  <div class="device-bound-session-grid-wrapper">
629
- <devtools-data-grid class="device-bound-session-cookie-cravings-grid" striped inline>
637
+ <devtools-data-grid class="device-bound-session-cookie-cravings-grid" striped inline name=${
638
+ i18nString(UIStrings.cookieCravings)}>
630
639
  <table>
631
640
  <thead>
632
641
  <tr>
633
- <th id="name" weight="2" sortable>${i18nString(UIStrings.name)}</th>
634
- <th id="domain" weight="2" sortable>${i18n.i18n.lockedString('Domain')}</th>
635
- <th id="path" weight="2" sortable>${i18n.i18n.lockedString('Path')}</th>
636
- <th id="secure" type="boolean" align="center" weight="1" sortable>${
637
- i18n.i18n.lockedString('Secure')}</th>
638
- <th id="http-only" type="boolean" align="center" weight="1" sortable>${
639
- i18n.i18n.lockedString('HttpOnly')}</th>
640
- <th id="same-site" weight="1" sortable>${i18n.i18n.lockedString('SameSite')}</th>
642
+ <th id="name" sortable>${i18nString(UIStrings.name)}</th>
643
+ <th id="domain" sortable>${i18n.i18n.lockedString('Domain')}</th>
644
+ <th id="path" sortable>${i18n.i18n.lockedString('Path')}</th>
645
+ <th id="secure" type="boolean" align="center" sortable>${i18n.i18n.lockedString('Secure')}</th>
646
+ <th id="http-only" type="boolean" align="center" sortable>${i18n.i18n.lockedString('HttpOnly')}</th>
647
+ <th id="same-site" sortable>${i18n.i18n.lockedString('SameSite')}</th>
641
648
  </tr>
642
649
  </thead>
643
650
  <tbody>
@@ -660,27 +667,28 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: ViewOutput, target: HTML
660
667
  }
661
668
  const events = [...sessionAndEvents.eventsById.values()];
662
669
  const eventsHtml = html`
663
- <devtools-report-section-header>${i18nString(UIStrings.events)}</devtools-report-section-header>
670
+ <devtools-report-section-header role="heading" aria-level="2">${
671
+ i18nString(UIStrings.events)}</devtools-report-section-header>
664
672
  ${
665
673
  events.length > 0 && onEventRowSelected ?
666
674
  html`
667
675
  <div class="device-bound-session-grid-wrapper">
668
- <devtools-data-grid class="device-bound-session-events-grid" striped inline ${
669
- Directives.ref((el?: Element) => {
670
- if (!el || !(el instanceof HTMLElement)) {
671
- return;
672
- }
673
- const grid = el as HTMLElement & {deselectRow(): void};
674
- if (!selectedEvent) {
675
- grid.deselectRow();
676
- }
677
- })}>
676
+ <devtools-data-grid class="device-bound-session-events-grid" striped inline name=${
677
+ i18nString(UIStrings.events)} ${Directives.ref((el?: Element) => {
678
+ if (!el || !(el instanceof HTMLElement)) {
679
+ return;
680
+ }
681
+ const grid = el as HTMLElement & {deselectRow(): void};
682
+ if (!selectedEvent) {
683
+ grid.deselectRow();
684
+ }
685
+ })}>
678
686
  <table>
679
687
  <thead>
680
688
  <tr>
681
- <th id="type" weight="1" sortable>${i18nString(UIStrings.type)}</th>
682
- <th id="timestamp" weight="2" sortable>${i18nString(UIStrings.timestamp)}</th>
683
- <th id="details" weight="2" sortable>${i18nString(UIStrings.result)}</th>
689
+ <th id="type" sortable>${i18nString(UIStrings.type)}</th>
690
+ <th id="timestamp" sortable>${i18nString(UIStrings.timestamp)}</th>
691
+ <th id="details" sortable>${i18nString(UIStrings.result)}</th>
684
692
  </tr>
685
693
  </thead>
686
694
  <tbody>${events.map(({event, timestamp}) => html`
@@ -764,7 +772,8 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: ViewOutput, target: HTML
764
772
  ` :
765
773
  html`<div class="device-bound-session-no-event-details">${i18nString(UIStrings.selectEventToViewDetails)}</div>`;
766
774
  const eventDetailsHtml = html`
767
- <devtools-report-section-header>${i18nString(UIStrings.eventDetails)}</devtools-report-section-header>
775
+ <devtools-report-section-header role="heading" aria-level="2">${
776
+ i18nString(UIStrings.eventDetails)}</devtools-report-section-header>
768
777
  ${eventDetailsContentHtml}
769
778
  `;
770
779
 
@@ -774,11 +783,13 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: ViewOutput, target: HTML
774
783
  <style>${deviceBoundSessionsViewStyles}</style>
775
784
  ${toolbarHtml}
776
785
  <devtools-split-view sidebar-position="second">
777
- <div slot="main" class="device-bound-session-view-wrapper">
786
+ <div slot="main" class="device-bound-session-view-wrapper" role="region" aria-label=${
787
+ i18nString(UIStrings.sessionDetails)}>
778
788
  ${sessionDetailsHtml || nothing}
779
789
  ${eventsHtml}
780
790
  </div>
781
- <div slot="sidebar" class="device-bound-session-sidebar">
791
+ <div slot="sidebar" class="device-bound-session-sidebar" role="region" aria-label=${
792
+ i18nString(UIStrings.eventDetails)}>
782
793
  ${eventDetailsHtml}
783
794
  </div>
784
795
  </devtools-split-view>`,
@@ -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();
@@ -4,7 +4,7 @@
4
4
  * found in the LICENSE file.
5
5
  */
6
6
  .device-bound-session-grid-wrapper {
7
- padding: 0 20px 5px;
7
+ margin: 0 20px 5px;
8
8
  }
9
9
 
10
10
  .device-bound-session-grid-wrapper devtools-data-grid {
@@ -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
  }
@@ -55,9 +55,10 @@ const UIStringsNotTranslate = {
55
55
  const lockedString = i18n.i18n.lockedString;
56
56
 
57
57
  export class AiCodeGenerationUpgradeDialog {
58
- static show({noLogging}: {noLogging: boolean}): void {
58
+ static show({noLogging}: {noLogging: boolean}): Promise<boolean> {
59
59
  const dialog = new UI.Dialog.Dialog();
60
60
  dialog.setAriaLabel(lockedString(UIStringsNotTranslate.codeCompletionJustGotBetter));
61
+ const result = Promise.withResolvers<boolean>();
61
62
  // clang-format off
62
63
  Lit.render(html`
63
64
  <div class="ai-code-generation-upgrade-dialog">
@@ -96,7 +97,8 @@ export class AiCodeGenerationUpgradeDialog {
96
97
  <div class="right-buttons">
97
98
  <devtools-button
98
99
  @click=${() => {
99
- void UI.ViewManager.ViewManager.instance().showView('chrome-ai');
100
+ result.resolve(true);
101
+ void UI.ViewManager.ViewManager.instance().showView('chrome-ai');
100
102
  }}
101
103
  jslogcontext="ai-code-generation-upgrade-dialog.manage-in-settings"
102
104
  .variant=${Buttons.Button.Variant.OUTLINED}
@@ -105,6 +107,7 @@ export class AiCodeGenerationUpgradeDialog {
105
107
  </devtools-button>
106
108
  <devtools-button
107
109
  @click=${() => {
110
+ result.resolve(true);
108
111
  dialog.hide();
109
112
  }}
110
113
  jslogcontext="ai-code-generation-upgrade-dialog.continue"
@@ -117,13 +120,18 @@ export class AiCodeGenerationUpgradeDialog {
117
120
  // clang-format on
118
121
 
119
122
  dialog.setOutsideClickCallback(ev => {
120
- ev.consume(true); // true = preventDefault()
121
- dialog.hide();
123
+ ev.consume(true);
124
+ });
125
+
126
+ dialog.setOnHideCallback(() => {
127
+ result.resolve(false);
122
128
  });
123
129
 
124
130
  dialog.setSizeBehavior(UI.GlassPane.SizeBehavior.MEASURE_CONTENT);
125
131
  dialog.setDimmed(true);
126
132
  dialog.show();
133
+
134
+ return result.promise;
127
135
  }
128
136
 
129
137
  private constructor() {
@@ -81,7 +81,7 @@ export const DEFAULT_VIEW: View = (input, _output, target): void => {
81
81
  .variant=${Buttons.Button.Variant.ICON}
82
82
  .size=${Buttons.Button.Size.REGULAR}
83
83
  .title=${i18nString(UIStrings.dismiss)}
84
- jslog=${VisualLogging.close().track({click: true})}
84
+ jslog=${VisualLogging.close().track({click: true}).context('gemini-promo-dismiss')}
85
85
  @click=${() => input.onCancelClick()}
86
86
  ></devtools-button>
87
87
  </div>
@@ -111,11 +111,11 @@ export const DEFAULT_VIEW: View = (input, _output, target): void => {
111
111
  <div class="buttons">
112
112
  <devtools-button
113
113
  .variant=${Buttons.Button.Variant.OUTLINED}
114
- .jslogContext=${'cancel'}
114
+ jslog=${VisualLogging.close().track({click: true}).context('gemini-promo-dismiss')}
115
115
  @click=${input.onCancelClick}>${i18nString(UIStrings.dismiss)}</devtools-button>
116
116
  <devtools-button
117
117
  .variant=${Buttons.Button.Variant.PRIMARY}
118
- .jslogContext=${'get-started'}
118
+ .jslogContext=${'gemini-promo-get-started'}
119
119
  @click=${input.onGetStartedClick}>${i18nString(UIStrings.getStarted)}</devtools-button>
120
120
  </div>
121
121
  `,
@@ -160,7 +160,7 @@ export class GeminiRebrandPromoDialog extends UI.Widget.VBox {
160
160
  }
161
161
 
162
162
  static show(): void {
163
- const dialog = new UI.Dialog.Dialog('gemini-rebranding-dialog');
163
+ const dialog = new UI.Dialog.Dialog('gemini-promo-dialog');
164
164
  dialog.setAriaLabel(i18nString(UIStrings.dialogAriaLabel));
165
165
  dialog.setMaxContentSize(new Geometry.Size(384, 500));
166
166
  dialog.setSizeBehavior(UI.GlassPane.SizeBehavior.SET_EXACT_WIDTH_MAX_HEIGHT);
@@ -181,7 +181,7 @@ export class GeminiRebrandPromoDialog extends UI.Widget.VBox {
181
181
  }
182
182
 
183
183
  const setting = Common.Settings.Settings.instance().createSetting<boolean>(
184
- 'gemini-rebranding-dialog-shown', false, Common.Settings.SettingStorageType.SYNCED);
184
+ 'gemini-promo-dialog-shown', false, Common.Settings.SettingStorageType.SYNCED);
185
185
  if (setting.get()) {
186
186
  return;
187
187
  }