chrome-devtools-frontend 1.0.1376716 → 1.0.1380117
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/gni/devtools_grd_files.gni +15 -7
- package/config/gni/devtools_image_files.gni +2 -0
- package/front_end/Images/src/animation.svg +3 -0
- package/front_end/Images/src/brush-2.svg +3 -0
- package/front_end/core/common/SettingRegistration.ts +1 -1
- package/front_end/core/host/AidaClient.ts +1 -0
- package/front_end/core/host/InspectorFrontendHost.ts +4 -0
- package/front_end/core/i18n/ByteUtilities.test.ts +34 -0
- package/front_end/core/i18n/ByteUtilities.ts +65 -0
- package/front_end/core/i18n/NumberFormatter.ts +75 -0
- package/front_end/core/i18n/i18n.ts +4 -0
- package/front_end/core/i18n/time-utilities.test.ts +20 -2
- package/front_end/core/i18n/time-utilities.ts +125 -86
- package/front_end/core/platform/NumberUtilities.test.ts +3 -26
- package/front_end/core/platform/NumberUtilities.ts +0 -20
- package/front_end/core/root/Runtime.ts +6 -3
- package/front_end/core/sdk/CPUThrottlingManager.ts +4 -0
- package/front_end/core/sdk/CSSContainerQuery.test.ts +10 -16
- package/front_end/core/sdk/CSSContainerQuery.ts +3 -15
- package/front_end/core/sdk/CSSMatchedStyles.test.ts +4 -0
- package/front_end/core/sdk/CSSMatchedStyles.ts +5 -5
- package/front_end/core/sdk/CSSModel.ts +18 -0
- package/front_end/core/sdk/CSSPropertyParser.test.ts +16 -1
- package/front_end/core/sdk/CSSPropertyParser.ts +2 -2
- package/front_end/core/sdk/sdk-meta.ts +8 -0
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +3 -3
- package/front_end/generated/ARIAProperties.js +4 -0
- package/front_end/generated/InspectorBackendCommands.js +8 -6
- package/front_end/generated/SupportedCSSProperties.js +17 -4
- package/front_end/generated/protocol-mapping.d.ts +15 -1
- package/front_end/generated/protocol-proxy-api.d.ts +14 -1
- package/front_end/generated/protocol.ts +26 -2
- package/front_end/models/extensions/ExtensionAPI.ts +9 -1
- package/front_end/models/heap_snapshot_model/HeapSnapshotModel.ts +2 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +8 -21
- package/front_end/models/live-metrics/web-vitals-injected/{rollup.config.js → rollup.config.mjs} +1 -1
- package/front_end/models/persistence/EditFileSystemView.ts +19 -9
- package/front_end/models/persistence/WorkspaceSettingsTab.ts +50 -54
- package/front_end/models/persistence/editFileSystemView.css +35 -15
- package/front_end/models/persistence/workspaceSettingsTab.css +21 -87
- package/front_end/models/timeline_model/timeline_model.ts +0 -6
- package/front_end/models/trace/Processor.test.ts +18 -17
- package/front_end/models/trace/Processor.ts +10 -14
- package/front_end/models/trace/README.md +0 -1
- package/front_end/models/{timeline_model → trace/extras}/TimelineJSProfile.ts +19 -29
- package/front_end/models/{timeline_model/TimelineModelFilter.test.ts → trace/extras/TraceFilter.test.ts} +15 -17
- package/front_end/models/trace/extras/TraceFilter.ts +62 -0
- package/front_end/models/{timeline_model/TimelineProfileTree.test.ts → trace/extras/TraceTree.test.ts} +44 -43
- package/front_end/models/{timeline_model/TimelineProfileTree.ts → trace/extras/TraceTree.ts} +65 -59
- package/front_end/models/trace/extras/extras.ts +3 -0
- package/front_end/models/trace/handlers/AnimationHandler.ts +0 -8
- package/front_end/models/trace/handlers/ExtensionTraceDataHandler.ts +1 -11
- package/front_end/models/trace/handlers/FramesHandler.test.ts +1 -6
- package/front_end/models/trace/handlers/FramesHandler.ts +1 -14
- package/front_end/models/trace/handlers/GPUHandler.test.ts +0 -2
- package/front_end/models/trace/handlers/GPUHandler.ts +1 -25
- package/front_end/models/trace/handlers/ImagePaintingHandler.ts +3 -0
- package/front_end/models/trace/handlers/InitiatorsHandler.test.ts +0 -1
- package/front_end/models/trace/handlers/InitiatorsHandler.ts +0 -20
- package/front_end/models/trace/handlers/InvalidationsHandler.test.ts +0 -1
- package/front_end/models/trace/handlers/InvalidationsHandler.ts +0 -18
- package/front_end/models/trace/handlers/LargestImagePaintHandler.test.ts +2 -2
- package/front_end/models/trace/handlers/LargestImagePaintHandler.ts +63 -3
- package/front_end/models/trace/handlers/LargestTextPaintHandler.ts +3 -0
- package/front_end/models/trace/handlers/LayerTreeHandler.test.ts +0 -2
- package/front_end/models/trace/handlers/LayerTreeHandler.ts +1 -18
- package/front_end/models/trace/handlers/LayoutShiftsHandler.test.ts +0 -3
- package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +1 -20
- package/front_end/models/trace/handlers/MemoryHandler.test.ts +0 -1
- package/front_end/models/trace/handlers/MemoryHandler.ts +3 -0
- package/front_end/models/trace/handlers/MetaHandler.test.ts +1 -32
- package/front_end/models/trace/handlers/MetaHandler.ts +2 -30
- package/front_end/models/trace/handlers/NetworkRequestsHandler.test.ts +0 -26
- package/front_end/models/trace/handlers/NetworkRequestsHandler.ts +4 -23
- package/front_end/models/trace/handlers/PageFramesHandler.ts +3 -0
- package/front_end/models/trace/handlers/RendererHandler.test.ts +0 -4
- package/front_end/models/trace/handlers/RendererHandler.ts +1 -24
- package/front_end/models/trace/handlers/SamplesHandler.test.ts +0 -5
- package/front_end/models/trace/handlers/SamplesHandler.ts +0 -26
- package/front_end/models/trace/handlers/ScreenshotsHandler.test.ts +0 -1
- package/front_end/models/trace/handlers/SelectorStatsHandler.ts +3 -0
- package/front_end/models/trace/handlers/ServerTimingsHandler.ts +1 -16
- package/front_end/models/trace/handlers/Threads.test.ts +1 -2
- package/front_end/models/trace/handlers/UserInteractionsHandler.test.ts +4 -27
- package/front_end/models/trace/handlers/UserInteractionsHandler.ts +16 -25
- package/front_end/models/trace/handlers/UserTimingsHandler.ts +0 -17
- package/front_end/models/trace/handlers/WorkersHandler.test.ts +0 -1
- package/front_end/models/trace/handlers/WorkersHandler.ts +0 -23
- package/front_end/models/trace/handlers/types.ts +1 -8
- package/front_end/models/trace/insights/{CumulativeLayoutShift.test.ts → CLSCulprits.test.ts} +21 -21
- package/front_end/models/trace/insights/{CumulativeLayoutShift.ts → CLSCulprits.ts} +24 -5
- package/front_end/models/trace/insights/Common.ts +5 -55
- package/front_end/models/trace/insights/DocumentLatency.test.ts +2 -2
- package/front_end/models/trace/insights/DocumentLatency.ts +26 -6
- package/front_end/models/trace/insights/FontDisplay.ts +24 -5
- package/front_end/models/trace/insights/InteractionToNextPaint.test.ts +1 -1
- package/front_end/models/trace/insights/InteractionToNextPaint.ts +26 -6
- package/front_end/models/trace/insights/LCPDiscovery.test.ts +58 -0
- package/front_end/models/trace/insights/LCPDiscovery.ts +101 -0
- package/front_end/models/trace/insights/{LargestContentfulPaint.test.ts → LCPPhases.test.ts} +6 -28
- package/front_end/models/trace/insights/{LargestContentfulPaint.ts → LCPPhases.ts} +37 -38
- package/front_end/models/trace/insights/{InsightRunners.ts → Models.ts} +4 -3
- package/front_end/models/trace/insights/RenderBlocking.test.ts +1 -1
- package/front_end/models/trace/insights/RenderBlocking.ts +33 -28
- package/front_end/models/trace/insights/SlowCSSSelector.ts +26 -5
- package/front_end/models/trace/insights/{ThirdPartyWeb.test.ts → ThirdParties.test.ts} +3 -3
- package/front_end/models/trace/insights/{ThirdPartyWeb.ts → ThirdParties.ts} +24 -5
- package/front_end/models/trace/insights/Viewport.test.ts +1 -1
- package/front_end/models/trace/insights/Viewport.ts +27 -9
- package/front_end/models/trace/insights/insights.ts +1 -1
- package/front_end/models/trace/insights/types.ts +11 -9
- package/front_end/models/trace/types/TraceEvents.ts +51 -22
- package/front_end/panels/application/SharedStorageItemsView.test.ts +3 -3
- package/front_end/panels/application/SharedStorageItemsView.ts +5 -3
- package/front_end/panels/application/StorageView.ts +3 -3
- package/front_end/panels/application/components/StorageMetadataView.ts +1 -2
- package/front_end/panels/browser_debugger/XHRBreakpointsSidebarPane.ts +34 -31
- package/front_end/panels/coverage/CoverageView.ts +3 -3
- package/front_end/panels/elements/ComputedStyleModel.ts +9 -2
- package/front_end/panels/elements/ComputedStyleWidget.test.ts +72 -0
- package/front_end/panels/elements/ComputedStyleWidget.ts +12 -0
- package/front_end/panels/elements/ElementStatePaneWidget.test.ts +84 -30
- package/front_end/panels/elements/ElementStatePaneWidget.ts +42 -24
- package/front_end/panels/elements/ElementsTreeElement.ts +24 -11
- package/front_end/panels/elements/MetricsSidebarPane.ts +12 -7
- package/front_end/panels/elements/PropertyMatchers.ts +3 -0
- package/front_end/panels/elements/StylePropertiesSection.ts +15 -6
- package/front_end/panels/elements/StylePropertyTreeElement.test.ts +3 -1
- package/front_end/panels/elements/StylePropertyTreeElement.ts +8 -3
- package/front_end/panels/elements/stylePropertiesTreeOutline.css +2 -2
- package/front_end/panels/explain/components/ConsoleInsight.ts +8 -18
- package/front_end/panels/freestyler/AiAgent.test.ts +58 -1
- package/front_end/panels/freestyler/AiAgent.ts +58 -3
- package/front_end/panels/freestyler/DrJonesFileAgent.test.ts +99 -23
- package/front_end/panels/freestyler/DrJonesFileAgent.ts +53 -20
- package/front_end/panels/freestyler/DrJonesNetworkAgent.test.ts +15 -7
- package/front_end/panels/freestyler/DrJonesNetworkAgent.ts +36 -15
- package/front_end/panels/freestyler/DrJonesPerformanceAgent.test.ts +6 -6
- package/front_end/panels/freestyler/DrJonesPerformanceAgent.ts +48 -8
- package/front_end/panels/freestyler/FreestylerAgent.test.ts +15 -14
- package/front_end/panels/freestyler/FreestylerAgent.ts +52 -8
- package/front_end/panels/freestyler/FreestylerPanel.test.ts +539 -39
- package/front_end/panels/freestyler/FreestylerPanel.ts +349 -215
- package/front_end/panels/freestyler/components/FreestylerChatUi.test.ts +126 -34
- package/front_end/panels/freestyler/components/FreestylerChatUi.ts +320 -268
- package/front_end/panels/freestyler/components/UserActionRow.ts +156 -47
- package/front_end/panels/freestyler/components/freestylerChatUi.css +69 -34
- package/front_end/panels/freestyler/components/userActionRow.css +40 -67
- package/front_end/panels/freestyler/freestyler-meta.ts +3 -11
- package/front_end/panels/issues/components/HideIssuesMenu.ts +2 -11
- package/front_end/panels/layer_viewer/LayerDetailsView.ts +1 -2
- package/front_end/panels/layer_viewer/PaintProfilerView.ts +5 -5
- package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +46 -0
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +26 -17
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +25 -19
- package/front_end/panels/network/BinaryResourceView.ts +6 -7
- package/front_end/panels/network/EventSourceMessagesView.ts +1 -1
- package/front_end/panels/network/NetworkDataGridNode.ts +3 -3
- package/front_end/panels/network/NetworkLogView.ts +7 -8
- package/front_end/panels/network/RequestTimingView.test.ts +35 -1
- package/front_end/panels/network/RequestTimingView.ts +96 -0
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +2 -2
- package/front_end/panels/network/networkTimingTable.css +2 -1
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +1 -1
- package/front_end/panels/profiler/HeapProfileView.ts +3 -3
- package/front_end/panels/profiler/HeapSnapshotView.ts +2 -2
- package/front_end/panels/profiler/HeapTimelineOverview.ts +12 -12
- package/front_end/panels/profiler/IsolateSelector.ts +3 -4
- package/front_end/panels/profiler/ProfileFlameChartDataProvider.ts +1 -1
- package/front_end/panels/profiler/ProfileSidebarTreeElement.ts +7 -6
- package/front_end/panels/profiler/ProfileView.ts +1 -1
- package/front_end/panels/recorder/components/RecordingView.ts +2 -2
- package/front_end/panels/recorder/injected/{rollup.config.js → rollup.config.mjs} +1 -1
- package/front_end/panels/recorder/recorderController.css +0 -4
- package/front_end/panels/security/CookieReportTreeElement.ts +1 -9
- package/front_end/panels/security/CookieReportView.ts +120 -0
- package/front_end/panels/security/SecurityPanel.ts +8 -2
- package/front_end/panels/security/cookieReportView.css +46 -0
- package/front_end/panels/security/sidebar.css +1 -2
- package/front_end/panels/sensors/LocationsSettingsTab.ts +26 -11
- package/front_end/panels/sensors/locationsSettingsTab.css +18 -18
- package/front_end/panels/settings/AISettingsTab.ts +6 -15
- package/front_end/panels/settings/KeybindsSettingsTab.ts +1 -1
- package/front_end/panels/settings/SettingsScreen.ts +61 -56
- package/front_end/panels/settings/aiSettingsTab.css +3 -14
- package/front_end/panels/settings/components/SyncSection.ts +1 -2
- package/front_end/panels/settings/components/syncSection.css +0 -10
- package/front_end/panels/settings/frameworkIgnoreListSettingsTab.css +3 -1
- package/front_end/panels/settings/keybindsSettingsTab.css +7 -10
- package/front_end/panels/settings/settingsScreen.css +27 -125
- package/front_end/panels/sources/DebuggerPlugin.ts +9 -4
- package/front_end/panels/sources/NavigatorView.ts +11 -13
- package/front_end/panels/timeline/ActiveFilters.ts +3 -4
- package/front_end/panels/timeline/AnimationsTrackAppender.ts +1 -2
- package/front_end/panels/timeline/CountersGraph.ts +2 -4
- package/front_end/panels/timeline/EventsTimelineTreeView.ts +7 -8
- package/front_end/panels/timeline/README.md +2 -1
- package/front_end/panels/timeline/TimelineController.ts +14 -4
- package/front_end/panels/timeline/TimelineEventOverview.ts +3 -4
- package/front_end/panels/timeline/TimelineFilters.ts +3 -4
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.test.ts +1 -1
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +3 -10
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +1 -2
- package/front_end/panels/timeline/TimelineFlameChartView.ts +21 -12
- package/front_end/panels/timeline/TimelineLoader.test.ts +1 -2
- package/front_end/panels/timeline/TimelineLoader.ts +3 -4
- package/front_end/panels/timeline/TimelineMiniMap.ts +10 -0
- package/front_end/panels/timeline/TimelinePanel.ts +20 -8
- package/front_end/panels/timeline/TimelineTreeView.test.ts +12 -13
- package/front_end/panels/timeline/TimelineTreeView.ts +35 -40
- package/front_end/panels/timeline/TimelineUIUtils.test.ts +2 -2
- package/front_end/panels/timeline/TimelineUIUtils.ts +12 -14
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +6 -7
- package/front_end/panels/timeline/components/LiveMetricsView.test.ts +3 -3
- package/front_end/panels/timeline/components/LiveMetricsView.ts +14 -26
- package/front_end/panels/timeline/components/MetricCard.test.ts +1 -1
- package/front_end/panels/timeline/components/MetricCard.ts +46 -0
- package/front_end/panels/timeline/components/NetworkRequestDetails.ts +3 -4
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.test.ts +2 -0
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +41 -36
- package/front_end/panels/timeline/components/insights/CLSCulprits.ts +19 -33
- package/front_end/panels/timeline/components/insights/DocumentLatency.ts +29 -40
- package/front_end/panels/timeline/components/insights/FontDisplay.ts +17 -23
- package/front_end/panels/timeline/components/insights/Helpers.ts +12 -16
- package/front_end/panels/timeline/components/insights/InteractionToNextPaint.ts +14 -26
- package/front_end/panels/timeline/components/insights/LCPDiscovery.ts +25 -37
- package/front_end/panels/timeline/components/insights/LCPPhases.ts +20 -47
- package/front_end/panels/timeline/components/insights/RenderBlocking.ts +19 -28
- package/front_end/panels/timeline/components/insights/SidebarInsight.ts +1 -2
- package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +18 -31
- package/front_end/panels/timeline/components/insights/Table.ts +5 -3
- package/front_end/panels/timeline/components/insights/ThirdParties.ts +18 -25
- package/front_end/panels/timeline/components/insights/Viewport.ts +14 -25
- package/front_end/panels/timeline/components/liveMetricsView.css +5 -13
- package/front_end/panels/timeline/components/metricCard.css +11 -0
- package/front_end/panels/timeline/components/sidebarInsightsTab.css +1 -1
- package/front_end/panels/timeline/overlays/OverlaysImpl.test.ts +5 -5
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +13 -12
- package/front_end/panels/timeline/timelineFlameChartView.css +1 -1
- package/front_end/panels/timeline/utils/AICallTree.test.ts +105 -0
- package/front_end/panels/timeline/utils/AICallTree.ts +25 -24
- package/front_end/testing/EnvironmentHelpers.ts +5 -18
- package/front_end/testing/InsightHelpers.ts +4 -4
- package/front_end/testing/TraceHelpers.ts +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts +2 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts +14 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js +16 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Input.d.ts +34 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Input.js +51 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Input.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/ElementHandle.js +10 -8
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Input.d.ts +14 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Input.js +57 -23
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Input.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ElementHandle.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ElementHandle.js +13 -10
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Input.d.ts +15 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Input.js +55 -26
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Input.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.d.ts +0 -8
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.js +2 -11
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js +5 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.js +9 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WaitTask.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WaitTask.js +5 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WaitTask.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/environment.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/environment.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/environment.js +0 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/environment.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/incremental-id-generator.d.ts +14 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/incremental-id-generator.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/incremental-id-generator.js +18 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/incremental-id-generator.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +51 -10
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +215 -97
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +2 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts +14 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js +16 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Input.d.ts +34 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Input.js +51 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Input.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/ElementHandle.js +10 -8
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Input.d.ts +14 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Input.js +57 -23
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Input.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ElementHandle.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ElementHandle.js +13 -10
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Input.d.ts +15 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Input.js +55 -26
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Input.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.d.ts +0 -8
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.js +1 -9
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js +5 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.js +7 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WaitTask.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WaitTask.js +5 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WaitTask.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/environment.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/environment.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/environment.js +0 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/environment.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/incremental-id-generator.d.ts +14 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/incremental-id-generator.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/incremental-id-generator.js +15 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/incremental-id-generator.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +51 -10
- package/front_end/third_party/puppeteer/package/package.json +4 -4
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +2 -3
- package/front_end/third_party/puppeteer/package/src/api/ElementHandle.ts +21 -3
- package/front_end/third_party/puppeteer/package/src/api/Input.ts +57 -8
- package/front_end/third_party/puppeteer/package/src/bidi/ElementHandle.ts +9 -7
- package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/bidi/Input.ts +72 -31
- package/front_end/third_party/puppeteer/package/src/cdp/ElementHandle.ts +14 -9
- package/front_end/third_party/puppeteer/package/src/cdp/Input.ts +71 -26
- package/front_end/third_party/puppeteer/package/src/common/CallbackRegistry.ts +1 -15
- package/front_end/third_party/puppeteer/package/src/common/ConsoleMessage.ts +8 -1
- package/front_end/third_party/puppeteer/package/src/common/Errors.ts +7 -0
- package/front_end/third_party/puppeteer/package/src/common/WaitTask.ts +9 -9
- package/front_end/third_party/puppeteer/package/src/environment.ts +1 -4
- package/front_end/third_party/puppeteer/package/src/generated/injected.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/generated/version.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/incremental-id-generator.ts +20 -0
- package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +1 -0
- package/front_end/ui/components/buttons/Button.test.ts +14 -0
- package/front_end/ui/components/buttons/Button.ts +27 -4
- package/front_end/ui/components/cards/card.css +7 -4
- package/front_end/ui/components/dialogs/Dialog.ts +2 -4
- package/front_end/ui/components/dialogs/ShortcutDialog.ts +15 -13
- package/front_end/ui/components/dialogs/dialog.css +2 -6
- package/front_end/ui/components/dialogs/shortcutDialog.css +33 -41
- package/front_end/ui/components/docs/freestyler/basic.ts +6 -8
- package/front_end/ui/components/docs/freestyler/empty_state.ts +6 -8
- package/front_end/ui/components/docs/performance_panel/track_example.html +1 -1
- package/front_end/ui/components/markdown_view/MarkdownView.test.ts +39 -17
- package/front_end/ui/components/markdown_view/MarkdownView.ts +77 -14
- package/front_end/ui/components/markdown_view/markdownView.css +15 -0
- package/front_end/ui/components/settings/SettingCheckbox.ts +3 -2
- package/front_end/ui/legacy/ContextMenu.ts +2 -2
- package/front_end/ui/legacy/InplaceEditor.ts +18 -14
- package/front_end/ui/legacy/TabbedPane.ts +0 -14
- package/front_end/ui/legacy/UIUtils.ts +0 -7
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +7 -2
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +8 -4
- package/front_end/ui/legacy/components/data_grid/ViewportDataGrid.ts +20 -11
- package/front_end/ui/legacy/components/inline_editor/LinkSwatch.test.ts +19 -0
- package/front_end/ui/legacy/components/inline_editor/LinkSwatch.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +5 -22
- package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +129 -100
- package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +4 -2
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewCalculator.test.ts +9 -4
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewCalculator.ts +6 -6
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +22 -4
- package/front_end/ui/legacy/components/perf_ui/flameChart.css +0 -2
- package/front_end/ui/legacy/components/source_frame/BinaryResourceViewFactory.test.ts +49 -0
- package/front_end/ui/legacy/components/source_frame/BinaryResourceViewFactory.ts +23 -46
- package/front_end/ui/legacy/components/source_frame/ImageView.ts +1 -1
- package/front_end/ui/legacy/components/utils/ImagePreview.ts +1 -1
- package/front_end/ui/legacy/textPrompt.css +1 -1
- package/front_end/ui/legacy/toolbar.css +4 -5
- package/front_end/ui/visual_logging/KnownContextValues.ts +174 -0
- package/front_end/ui/visual_logging/LoggingConfig.ts +6 -2
- package/package.json +7 -6
- package/scripts/build/ninja/bundle.gni +3 -3
- package/scripts/build/{rollup.config.js → rollup.config.mjs} +4 -4
- package/scripts/devtools_paths.py +8 -4
- package/scripts/eslint_rules/tests/check_test_definitions_test.js +8 -3
- package/scripts/tools/update_goldens_v2.py +1 -1
- package/front_end/models/timeline_model/TimelineModelFilter.ts +0 -61
- /package/front_end/Images/{rollup.config.js → rollup.config.mjs} +0 -0
@@ -9,9 +9,6 @@ import * as Common from '../../../core/common/common.js';
|
|
9
9
|
import * as Host from '../../../core/host/host.js';
|
10
10
|
import * as i18n from '../../../core/i18n/i18n.js';
|
11
11
|
import type * as Platform from '../../../core/platform/platform.js';
|
12
|
-
import * as SDK from '../../../core/sdk/sdk.js';
|
13
|
-
import type * as Workspace from '../../../models/workspace/workspace.js';
|
14
|
-
import * as TimelineUtils from '../../../panels/timeline/utils/utils.js';
|
15
12
|
import * as Marked from '../../../third_party/marked/marked.js';
|
16
13
|
import * as Buttons from '../../../ui/components/buttons/buttons.js';
|
17
14
|
import type * as IconButton from '../../../ui/components/icon_button/icon_button.js';
|
@@ -19,8 +16,7 @@ import * as MarkdownView from '../../../ui/components/markdown_view/markdown_vie
|
|
19
16
|
import * as UI from '../../../ui/legacy/legacy.js';
|
20
17
|
import * as LitHtml from '../../../ui/lit-html/lit-html.js';
|
21
18
|
import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
|
22
|
-
import {
|
23
|
-
import {AgentType, type ContextDetail, ErrorType} from '../AiAgent.js';
|
19
|
+
import {AgentType, type ContextDetail, type ConversationContext, ErrorType} from '../AiAgent.js';
|
24
20
|
|
25
21
|
import freestylerChatUiStyles from './freestylerChatUi.css.js';
|
26
22
|
import type {UserActionRowProps} from './UserActionRow.js';
|
@@ -115,10 +111,22 @@ const UIStringsNotTranslate = {
|
|
115
111
|
*@description Placeholder text for the chat UI input.
|
116
112
|
*/
|
117
113
|
inputPlaceholderForDrJonesPerformanceAgent: 'Ask a question about the selected item and its call tree',
|
114
|
+
/**
|
115
|
+
* @description Placeholder text for the input shown when the conversation is blocked because a cross-origin context was selected.
|
116
|
+
*/
|
117
|
+
crossOriginError: 'To talk about data from another origin, start a new chat',
|
118
|
+
/**
|
119
|
+
* @description Placeholder text for the input shown when the conversation is blocked because a cross-origin context was selected.
|
120
|
+
*/
|
121
|
+
newConversationError: 'To talk about this data, start a new chat',
|
118
122
|
/**
|
119
123
|
*@description Title for the send icon button.
|
120
124
|
*/
|
121
125
|
sendButtonTitle: 'Send',
|
126
|
+
/**
|
127
|
+
*@description Title for the start new chat
|
128
|
+
*/
|
129
|
+
startNewChat: 'Start new chat',
|
122
130
|
/**
|
123
131
|
*@description Title for the cancel icon button.
|
124
132
|
*/
|
@@ -135,6 +143,10 @@ const UIStringsNotTranslate = {
|
|
135
143
|
*@description Text for the empty state of the AI assistance panel.
|
136
144
|
*/
|
137
145
|
emptyStateText: 'How can I help you?',
|
146
|
+
/**
|
147
|
+
*@description Text for the empty state of the AI assistance panel when there is no agent selected.
|
148
|
+
*/
|
149
|
+
noAgentStateText: 'Explore AI assistance',
|
138
150
|
/**
|
139
151
|
* @description The error message when the LLM loop is stopped for some reason (Max steps reached or request to LLM failed)
|
140
152
|
*/
|
@@ -200,68 +212,16 @@ const UIStringsNotTranslate = {
|
|
200
212
|
*@description Aria label for the cancel icon to be read by screen reader
|
201
213
|
*/
|
202
214
|
canceled: 'Canceled',
|
203
|
-
/*
|
204
|
-
* @description Header text for instructions on how to use the AI assistance feature.
|
205
|
-
*/
|
206
|
-
getStarted: 'Hi! Here’s how to get started:',
|
207
|
-
/**
|
208
|
-
* @description AI assistance for CSS.
|
209
|
-
*/
|
210
|
-
cssHelp: 'CSS help:',
|
211
|
-
/**
|
212
|
-
* @description Explanation on how to use AI assistance for DOM elements.
|
213
|
-
*/
|
214
|
-
cssHelpExplainer:
|
215
|
-
'Navigate to the Elements panel, right-click a DOM element, and select "Ask AI assistant". I’ll be happy to explain its styles or behavior.',
|
216
|
-
/**
|
217
|
-
* @description AI assistance for files.
|
218
|
-
*/
|
219
|
-
fileHelp: 'File insights:',
|
220
215
|
/**
|
221
|
-
|
216
|
+
*@description Text displayed when the chat input is disabled due to reading past conversation.
|
222
217
|
*/
|
223
|
-
|
224
|
-
'Open the Sources panel, right-click a file, and select "Ask AI". I can provide insights into its purpose or origin.',
|
225
|
-
/**
|
226
|
-
* @description AI assistance for network requests.
|
227
|
-
*/
|
228
|
-
networkHelp: 'Network request insights:',
|
229
|
-
/**
|
230
|
-
* @description Explanation on how to use AI assistance for network requests.
|
231
|
-
*/
|
232
|
-
networkHelpExplainer:
|
233
|
-
'In the Network panel, right-click any request and select "Ask AI assistant". I’ll help break down what’s happening with each request.',
|
234
|
-
/**
|
235
|
-
* @description AI assistance for performance traces.
|
236
|
-
*/
|
237
|
-
performanceHelp: 'Performance analysis:',
|
238
|
-
/**
|
239
|
-
* @description Explanation on how to use AI assistance for performance traces.
|
240
|
-
*/
|
241
|
-
performanceHelpExplainer:
|
242
|
-
'In the Performance panel, run a trace. Then, right-click any function in the timeline and select "Ask AI". I’ll help you analyze its performance impact and suggest improvements.',
|
218
|
+
pastConversation: 'You\'re viewing a past conversation.',
|
243
219
|
};
|
244
220
|
|
245
221
|
const str_ = i18n.i18n.registerUIStrings('panels/freestyler/components/FreestylerChatUi.ts', UIStrings);
|
246
222
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
247
223
|
const lockedString = i18n.i18n.lockedString;
|
248
224
|
|
249
|
-
function getInputPlaceholderString(state: State, agentType?: AgentType): Platform.UIString.LocalizedString {
|
250
|
-
if (state === State.CONSENT_VIEW || !agentType) {
|
251
|
-
return i18nString(UIStrings.followTheSteps);
|
252
|
-
}
|
253
|
-
switch (agentType) {
|
254
|
-
case AgentType.FREESTYLER:
|
255
|
-
return lockedString(UIStringsNotTranslate.inputPlaceholderForFreestylerAgent);
|
256
|
-
case AgentType.DRJONES_FILE:
|
257
|
-
return lockedString(UIStringsNotTranslate.inputPlaceholderForDrJonesFileAgent);
|
258
|
-
case AgentType.DRJONES_NETWORK_REQUEST:
|
259
|
-
return lockedString(UIStringsNotTranslate.inputPlaceholderForDrJonesNetworkAgent);
|
260
|
-
case AgentType.DRJONES_PERFORMANCE:
|
261
|
-
return lockedString(UIStringsNotTranslate.inputPlaceholderForDrJonesPerformanceAgent);
|
262
|
-
}
|
263
|
-
}
|
264
|
-
|
265
225
|
export interface Step {
|
266
226
|
isLoading: boolean;
|
267
227
|
thought?: string;
|
@@ -307,20 +267,21 @@ export interface Props {
|
|
307
267
|
onInspectElementClick: () => void;
|
308
268
|
onFeedbackSubmit: (rpcId: number, rate: Host.AidaClient.Rating, feedback?: string) => void;
|
309
269
|
onCancelClick: () => void;
|
310
|
-
|
311
|
-
|
270
|
+
onContextClick: () => void | Promise<void>;
|
271
|
+
onNewConversation: () => void;
|
312
272
|
inspectElementToggled: boolean;
|
313
273
|
state: State;
|
314
274
|
aidaAvailability: Host.AidaClient.AidaAccessPreconditions;
|
315
275
|
messages: ChatMessage[];
|
316
|
-
|
317
|
-
selectedFile: Workspace.UISourceCode.UISourceCode|null;
|
318
|
-
selectedNetworkRequest: SDK.NetworkRequest.NetworkRequest|null;
|
319
|
-
selectedAiCallTree: TimelineUtils.AICallTree.AICallTree|null;
|
276
|
+
selectedContext: ConversationContext<unknown>|null;
|
320
277
|
isLoading: boolean;
|
321
278
|
canShowFeedbackForm: boolean;
|
322
279
|
userInfo: Pick<Host.InspectorFrontendHostAPI.SyncInformation, 'accountImage'|'accountFullName'>;
|
323
280
|
agentType?: AgentType;
|
281
|
+
isReadOnly: boolean;
|
282
|
+
blockedByCrossOrigin: boolean;
|
283
|
+
requiresNewConversation?: boolean;
|
284
|
+
stripLinks: boolean;
|
324
285
|
}
|
325
286
|
|
326
287
|
// The model returns multiline code blocks in an erroneous way with the language being in new line.
|
@@ -334,6 +295,11 @@ export interface Props {
|
|
334
295
|
// }
|
335
296
|
// ```
|
336
297
|
class MarkdownRendererWithCodeBlock extends MarkdownView.MarkdownView.MarkdownInsightRenderer {
|
298
|
+
#stripLinks: boolean = false;
|
299
|
+
constructor(opts: {stripLinks?: boolean} = {}) {
|
300
|
+
super();
|
301
|
+
this.#stripLinks = Boolean(opts.stripLinks);
|
302
|
+
}
|
337
303
|
override templateForToken(token: Marked.Marked.MarkedToken): LitHtml.TemplateResult|null {
|
338
304
|
if (token.type === 'code') {
|
339
305
|
const lines = (token.text as string).split('\n');
|
@@ -343,13 +309,34 @@ class MarkdownRendererWithCodeBlock extends MarkdownView.MarkdownView.MarkdownIn
|
|
343
309
|
}
|
344
310
|
}
|
345
311
|
|
312
|
+
// Potentially remove links from the rendered result
|
313
|
+
if (this.#stripLinks && (token.type === 'link' || token.type === 'image')) {
|
314
|
+
// Insert an extra text node at the end after any link text. Show the link as plaintext (surrounded by parentheses)
|
315
|
+
const urlText = ` ( ${token.href} )`;
|
316
|
+
// Images would be turned into as links (but we'll skip that) https://source.chromium.org/chromium/chromium/src/+/main:third_party/devtools-frontend/src/front_end/ui/components/markdown_view/MarkdownView.ts;l=286-291;drc=d2cc89e48c913666655542d818ad0a09d25d0d08
|
317
|
+
const childTokens = token.type === 'image' ? undefined : [
|
318
|
+
...token.tokens,
|
319
|
+
{type: 'text', text: urlText, raw: urlText},
|
320
|
+
];
|
321
|
+
|
322
|
+
token = {
|
323
|
+
...token,
|
324
|
+
// Marked doesn't read .text or .raw of a link, but we'll update anyway
|
325
|
+
// https://github.com/markedjs/marked/blob/035af38ab1e5aae95ece213dcc9a9c6d79cff46f/src/Renderer.ts#L178-L191
|
326
|
+
text: `${token.text}${urlText}`,
|
327
|
+
raw: `${token.text}${urlText}`,
|
328
|
+
type: 'text',
|
329
|
+
tokens: childTokens,
|
330
|
+
};
|
331
|
+
}
|
332
|
+
|
346
333
|
return super.templateForToken(token);
|
347
334
|
}
|
348
335
|
}
|
349
336
|
|
350
337
|
export class FreestylerChatUi extends HTMLElement {
|
351
338
|
readonly #shadow = this.attachShadow({mode: 'open'});
|
352
|
-
|
339
|
+
#markdownRenderer = new MarkdownRendererWithCodeBlock();
|
353
340
|
#scrollTop?: number;
|
354
341
|
#props: Props;
|
355
342
|
|
@@ -359,6 +346,7 @@ export class FreestylerChatUi extends HTMLElement {
|
|
359
346
|
}
|
360
347
|
|
361
348
|
set props(props: Props) {
|
349
|
+
this.#markdownRenderer = new MarkdownRendererWithCodeBlock({stripLinks: props.stripLinks});
|
362
350
|
this.#props = props;
|
363
351
|
this.#render();
|
364
352
|
}
|
@@ -408,6 +396,9 @@ export class FreestylerChatUi extends HTMLElement {
|
|
408
396
|
}
|
409
397
|
|
410
398
|
#isTextInputDisabled = (): boolean => {
|
399
|
+
if (this.#props.blockedByCrossOrigin || this.#props.requiresNewConversation) {
|
400
|
+
return true;
|
401
|
+
}
|
411
402
|
const isAidaAvailable = this.#props.aidaAvailability === Host.AidaClient.AidaAccessPreconditions.AVAILABLE;
|
412
403
|
const isConsentView = this.#props.state === State.CONSENT_VIEW;
|
413
404
|
const showsSideEffects = this.#props.messages.some(message => {
|
@@ -416,15 +407,25 @@ export class FreestylerChatUi extends HTMLElement {
|
|
416
407
|
});
|
417
408
|
});
|
418
409
|
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
410
|
+
if (!isAidaAvailable || isConsentView || !this.#props.agentType) {
|
411
|
+
return true;
|
412
|
+
}
|
413
|
+
|
414
|
+
if (!this.#props.selectedContext) {
|
415
|
+
return true;
|
416
|
+
}
|
423
417
|
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
418
|
+
// Agent-specific input disabled rules.
|
419
|
+
switch (this.#props.agentType) {
|
420
|
+
case AgentType.FREESTYLER:
|
421
|
+
return showsSideEffects;
|
422
|
+
case AgentType.DRJONES_NETWORK_REQUEST:
|
423
|
+
return false;
|
424
|
+
case AgentType.DRJONES_FILE:
|
425
|
+
return false;
|
426
|
+
case AgentType.DRJONES_PERFORMANCE:
|
427
|
+
return false;
|
428
|
+
}
|
428
429
|
};
|
429
430
|
|
430
431
|
#handleScroll = (ev: Event): void => {
|
@@ -743,14 +744,14 @@ export class FreestylerChatUi extends HTMLElement {
|
|
743
744
|
// clang-format on
|
744
745
|
}
|
745
746
|
|
746
|
-
const shouldShowSuggestions = (isLast && !this.#props.isLoading && message.suggestions);
|
747
747
|
// clang-format off
|
748
748
|
return html`
|
749
|
-
<section
|
749
|
+
<section
|
750
|
+
class="chat-message answer"
|
751
|
+
jslog=${VisualLogging.section('answer')}
|
752
|
+
>
|
750
753
|
<div class="message-info">
|
751
|
-
<devtools-icon
|
752
|
-
name="smart-assistant"
|
753
|
-
></devtools-icon>
|
754
|
+
<devtools-icon name="smart-assistant"></devtools-icon>
|
754
755
|
<div class="message-name">
|
755
756
|
<h2>${lockedString(UIStringsNotTranslate.ai)}</h2>
|
756
757
|
</div>
|
@@ -764,14 +765,17 @@ export class FreestylerChatUi extends HTMLElement {
|
|
764
765
|
});
|
765
766
|
},
|
766
767
|
)}
|
767
|
-
${
|
768
|
-
message.answer
|
769
|
-
|
770
|
-
: LitHtml.nothing
|
771
|
-
}
|
768
|
+
${message.answer
|
769
|
+
? html`<p>${this.#renderTextAsMarkdown(message.answer)}</p>`
|
770
|
+
: LitHtml.nothing}
|
772
771
|
${this.#renderError(message)}
|
773
772
|
<div class="actions">
|
774
|
-
${this.#
|
773
|
+
${isLast && this.#props.isLoading
|
774
|
+
? LitHtml.nothing
|
775
|
+
: this.#renderUserActionRow(
|
776
|
+
message.rpcId,
|
777
|
+
isLast ? message.suggestions : undefined,
|
778
|
+
)}
|
775
779
|
</div>
|
776
780
|
</section>
|
777
781
|
`;
|
@@ -782,130 +786,52 @@ export class FreestylerChatUi extends HTMLElement {
|
|
782
786
|
if (!this.#props.agentType) {
|
783
787
|
return LitHtml.nothing;
|
784
788
|
}
|
785
|
-
|
786
|
-
case AgentType.FREESTYLER:
|
787
|
-
return this.#renderSelectAnElement();
|
788
|
-
case AgentType.DRJONES_FILE:
|
789
|
-
return this.#renderSelectedFileName();
|
790
|
-
case AgentType.DRJONES_NETWORK_REQUEST:
|
791
|
-
return this.#renderSelectedNetworkRequest();
|
792
|
-
case AgentType.DRJONES_PERFORMANCE:
|
793
|
-
return this.#renderSelectedTask();
|
794
|
-
}
|
795
|
-
}
|
796
|
-
|
797
|
-
#renderSelectedFileName(): LitHtml.TemplateResult {
|
798
|
-
const resourceClass = LitHtml.Directives.classMap({
|
799
|
-
'not-selected': !this.#props.selectedFile,
|
800
|
-
'resource-link': true,
|
801
|
-
});
|
802
|
-
|
803
|
-
if (!this.#props.selectedFile) {
|
804
|
-
return html`${LitHtml.nothing}`;
|
805
|
-
}
|
806
|
-
|
807
|
-
const icon = PanelUtils.getIconForSourceFile(this.#props.selectedFile);
|
808
|
-
|
809
|
-
// clang-format off
|
810
|
-
return html`<div class="select-element">
|
811
|
-
<div role=button class=${resourceClass}
|
812
|
-
@click=${this.#props.onSelectedFileRequestClick}>
|
813
|
-
${icon}${this.#props.selectedFile?.displayName()}
|
814
|
-
</div></div>`;
|
815
|
-
// clang-format on
|
789
|
+
return this.#renderContextSelector();
|
816
790
|
}
|
817
791
|
|
818
|
-
#
|
792
|
+
#renderContextSelector(): LitHtml.LitTemplate {
|
819
793
|
const resourceClass = LitHtml.Directives.classMap({
|
820
|
-
'not-selected': !this.#props.
|
794
|
+
'not-selected': !this.#props.selectedContext,
|
821
795
|
'resource-link': true,
|
822
796
|
});
|
823
797
|
|
824
|
-
|
825
|
-
|
826
|
-
}
|
798
|
+
// TODO: currently the picker behavior is SDKNode specific.
|
799
|
+
const hasPickerBehavior = this.#props.agentType === AgentType.FREESTYLER;
|
827
800
|
|
828
|
-
|
829
|
-
|
830
|
-
return html`<div class="select-element">
|
831
|
-
<div role=button class=${resourceClass}
|
832
|
-
@click=${this.#props.onSelectedNetworkRequestClick}>
|
833
|
-
${icon}${this.#props.selectedNetworkRequest?.name()}
|
834
|
-
</div></div>`;
|
835
|
-
// clang-format on
|
836
|
-
};
|
837
|
-
|
838
|
-
#renderSelectAnElement = (): LitHtml.TemplateResult => {
|
839
|
-
const resourceClass = LitHtml.Directives.classMap({
|
840
|
-
'not-selected': !this.#props.selectedElement,
|
841
|
-
'resource-link': true,
|
842
|
-
});
|
843
|
-
|
844
|
-
// clang-format off
|
845
|
-
return html`
|
846
|
-
<div class="select-element">
|
847
|
-
<devtools-button
|
848
|
-
.data=${{
|
849
|
-
variant: Buttons.Button.Variant.ICON_TOGGLE,
|
850
|
-
size: Buttons.Button.Size.REGULAR,
|
851
|
-
iconName: 'select-element',
|
852
|
-
toggledIconName: 'select-element',
|
853
|
-
toggleType: Buttons.Button.ToggleType.PRIMARY,
|
854
|
-
toggled: this.#props.inspectElementToggled,
|
855
|
-
title: lockedString(UIStringsNotTranslate.selectAnElement),
|
856
|
-
jslogContext: 'select-element',
|
857
|
-
} as Buttons.Button.ButtonData}
|
858
|
-
@click=${this.#props.onInspectElementClick}
|
859
|
-
></devtools-button>
|
860
|
-
<div class=${resourceClass}>${
|
861
|
-
this.#props.selectedElement
|
862
|
-
? LitHtml.Directives.until(
|
863
|
-
Common.Linkifier.Linkifier.linkify(this.#props.selectedElement),
|
864
|
-
)
|
865
|
-
: html`<span>${
|
866
|
-
lockedString(UIStringsNotTranslate.noElementSelected)
|
867
|
-
}</span>`
|
868
|
-
}</div>
|
869
|
-
</div>`;
|
870
|
-
// clang-format on
|
871
|
-
};
|
872
|
-
|
873
|
-
#renderSelectedTask = (): LitHtml.TemplateResult => {
|
874
|
-
const resourceClass = LitHtml.Directives.classMap({
|
875
|
-
'not-selected': !this.#props.selectedAiCallTree,
|
876
|
-
'resource-task': true,
|
877
|
-
});
|
878
|
-
|
879
|
-
if (!this.#props.selectedAiCallTree) {
|
880
|
-
return html`${LitHtml.nothing}`;
|
801
|
+
if (!this.#props.selectedContext && !hasPickerBehavior) {
|
802
|
+
return LitHtml.nothing;
|
881
803
|
}
|
882
804
|
|
883
|
-
const
|
884
|
-
if (!event) {
|
885
|
-
return html`${LitHtml.nothing}`;
|
886
|
-
}
|
887
|
-
|
888
|
-
const displayName = TimelineUtils.EntryName.nameForEntry(event);
|
889
|
-
const handleClick = (): void => {
|
890
|
-
const trace = new SDK.TraceObject.RevealableEvent(event);
|
891
|
-
void Common.Revealer.reveal(trace);
|
892
|
-
};
|
893
|
-
|
894
|
-
const iconData = {
|
895
|
-
iconName: 'performance',
|
896
|
-
color: 'var(--sys-color-on-surface-subtle)',
|
897
|
-
};
|
898
|
-
const icon = PanelUtils.createIconElement(iconData, 'Performance');
|
899
|
-
icon.classList.add('icon');
|
805
|
+
const icon = this.#props.selectedContext?.getIcon() ?? LitHtml.nothing;
|
900
806
|
|
901
807
|
// clang-format off
|
902
808
|
return html`<div class="select-element">
|
903
|
-
|
904
|
-
|
809
|
+
${
|
810
|
+
hasPickerBehavior ? html`
|
811
|
+
<devtools-button
|
812
|
+
.data=${{
|
813
|
+
variant: Buttons.Button.Variant.ICON_TOGGLE,
|
814
|
+
size: Buttons.Button.Size.REGULAR,
|
815
|
+
iconName: 'select-element',
|
816
|
+
toggledIconName: 'select-element',
|
817
|
+
toggleType: Buttons.Button.ToggleType.PRIMARY,
|
818
|
+
toggled: this.#props.inspectElementToggled,
|
819
|
+
title: lockedString(UIStringsNotTranslate.selectAnElement),
|
820
|
+
jslogContext: 'select-element',
|
821
|
+
} as Buttons.Button.ButtonData}
|
822
|
+
@click=${this.#props.onInspectElementClick}
|
823
|
+
></devtools-button>
|
824
|
+
` : LitHtml.nothing
|
825
|
+
}
|
826
|
+
<div role=button class=${resourceClass}
|
827
|
+
@click=${this.#props.onContextClick}>
|
828
|
+
${icon}${this.#props.selectedContext?.getTitle() ?? html`<span>${
|
829
|
+
lockedString(UIStringsNotTranslate.noElementSelected)
|
830
|
+
}</span>`}
|
905
831
|
</div>
|
906
832
|
</div>`;
|
907
833
|
// clang-format on
|
908
|
-
}
|
834
|
+
}
|
909
835
|
|
910
836
|
#renderMessages = (): LitHtml.TemplateResult => {
|
911
837
|
// clang-format off
|
@@ -934,7 +860,7 @@ export class FreestylerChatUi extends HTMLElement {
|
|
934
860
|
</div>
|
935
861
|
<h1>${lockedString(UIStringsNotTranslate.emptyStateText)}</h1>
|
936
862
|
</div>
|
937
|
-
<div class="
|
863
|
+
<div class="empty-state-content">
|
938
864
|
${suggestions.map(suggestion => {
|
939
865
|
return html`<devtools-button
|
940
866
|
class="suggestion"
|
@@ -955,6 +881,10 @@ export class FreestylerChatUi extends HTMLElement {
|
|
955
881
|
// clang-format on
|
956
882
|
};
|
957
883
|
|
884
|
+
#onNewConversation(): void {
|
885
|
+
this.#props.onNewConversation();
|
886
|
+
}
|
887
|
+
|
958
888
|
#getEmptyStateSuggestions = (): string[] => {
|
959
889
|
if (!this.#props.agentType) {
|
960
890
|
return [];
|
@@ -987,53 +917,139 @@ export class FreestylerChatUi extends HTMLElement {
|
|
987
917
|
}
|
988
918
|
};
|
989
919
|
|
990
|
-
#
|
920
|
+
#getInputPlaceholderString(): Platform.UIString.LocalizedString {
|
921
|
+
const state = this.#props.state;
|
922
|
+
const agentType = this.#props.agentType;
|
923
|
+
if (state === State.CONSENT_VIEW || !agentType) {
|
924
|
+
return i18nString(UIStrings.followTheSteps);
|
925
|
+
}
|
926
|
+
if (this.#props.requiresNewConversation) {
|
927
|
+
return lockedString(UIStringsNotTranslate.newConversationError);
|
928
|
+
}
|
929
|
+
if (this.#props.blockedByCrossOrigin) {
|
930
|
+
return lockedString(UIStringsNotTranslate.crossOriginError);
|
931
|
+
}
|
932
|
+
switch (agentType) {
|
933
|
+
case AgentType.FREESTYLER:
|
934
|
+
return lockedString(UIStringsNotTranslate.inputPlaceholderForFreestylerAgent);
|
935
|
+
case AgentType.DRJONES_FILE:
|
936
|
+
return lockedString(UIStringsNotTranslate.inputPlaceholderForDrJonesFileAgent);
|
937
|
+
case AgentType.DRJONES_NETWORK_REQUEST:
|
938
|
+
return lockedString(UIStringsNotTranslate.inputPlaceholderForDrJonesNetworkAgent);
|
939
|
+
case AgentType.DRJONES_PERFORMANCE:
|
940
|
+
return lockedString(UIStringsNotTranslate.inputPlaceholderForDrJonesPerformanceAgent);
|
941
|
+
}
|
942
|
+
}
|
943
|
+
|
944
|
+
#renderReadOnlySection(): LitHtml.LitTemplate {
|
945
|
+
if (!this.#props.agentType) {
|
946
|
+
return LitHtml.nothing;
|
947
|
+
}
|
948
|
+
|
949
|
+
// clang-format off
|
950
|
+
return html`<div
|
951
|
+
class="chat-readonly-container"
|
952
|
+
jslog=${VisualLogging.section('read-only')}
|
953
|
+
>
|
954
|
+
<span>${lockedString(UIStringsNotTranslate.pastConversation)}</span>
|
955
|
+
<devtools-button
|
956
|
+
aria-label=${lockedString(UIStringsNotTranslate.startNewChat)}
|
957
|
+
@click=${this.#onNewConversation}
|
958
|
+
.data=${{
|
959
|
+
variant: Buttons.Button.Variant.TEXT,
|
960
|
+
title: lockedString(UIStringsNotTranslate.startNewChat),
|
961
|
+
jslogContext: 'start-new-chat',
|
962
|
+
} as Buttons.Button.ButtonData}
|
963
|
+
>${lockedString(UIStringsNotTranslate.startNewChat)}</devtools-button>
|
964
|
+
</div>`;
|
965
|
+
// clang-format on
|
966
|
+
}
|
967
|
+
|
968
|
+
#renderChatInputButton(): LitHtml.TemplateResult {
|
969
|
+
if (this.#props.isLoading) {
|
970
|
+
// clang-format off
|
971
|
+
return html`<devtools-button
|
972
|
+
class="chat-input-button"
|
973
|
+
aria-label=${lockedString(UIStringsNotTranslate.cancelButtonTitle)}
|
974
|
+
@click=${this.#handleCancel}
|
975
|
+
.data=${
|
976
|
+
{
|
977
|
+
variant: Buttons.Button.Variant.ICON,
|
978
|
+
size: Buttons.Button.Size.REGULAR,
|
979
|
+
iconName: 'record-stop',
|
980
|
+
title: lockedString(UIStringsNotTranslate.cancelButtonTitle),
|
981
|
+
jslogContext: 'stop',
|
982
|
+
} as Buttons.Button.ButtonData
|
983
|
+
}
|
984
|
+
></devtools-button>`;
|
985
|
+
// clang-format on
|
986
|
+
}
|
987
|
+
if (this.#props.blockedByCrossOrigin || this.#props.requiresNewConversation) {
|
988
|
+
// clang-format off
|
989
|
+
return html`<devtools-button
|
990
|
+
class="chat-input-button"
|
991
|
+
aria-label=${lockedString(UIStringsNotTranslate.startNewChat)}
|
992
|
+
@click=${this.#onNewConversation}
|
993
|
+
.data=${
|
994
|
+
{
|
995
|
+
variant: Buttons.Button.Variant.PRIMARY,
|
996
|
+
size: Buttons.Button.Size.REGULAR,
|
997
|
+
title: lockedString(UIStringsNotTranslate.startNewChat),
|
998
|
+
jslogContext: 'start-new-chat',
|
999
|
+
} as Buttons.Button.ButtonData
|
1000
|
+
}
|
1001
|
+
>${lockedString(UIStringsNotTranslate.startNewChat)}</devtools-button>`;
|
1002
|
+
// clang-format on
|
1003
|
+
}
|
1004
|
+
// clang-format off
|
1005
|
+
return html`<devtools-button
|
1006
|
+
class="chat-input-button"
|
1007
|
+
aria-label=${lockedString(UIStringsNotTranslate.sendButtonTitle)}
|
1008
|
+
.data=${
|
1009
|
+
{
|
1010
|
+
type: 'submit',
|
1011
|
+
variant: Buttons.Button.Variant.ICON,
|
1012
|
+
size: Buttons.Button.Size.REGULAR,
|
1013
|
+
disabled: this.#isTextInputDisabled(),
|
1014
|
+
iconName: 'send',
|
1015
|
+
title: lockedString(UIStringsNotTranslate.sendButtonTitle),
|
1016
|
+
jslogContext: 'send',
|
1017
|
+
} as Buttons.Button.ButtonData
|
1018
|
+
}
|
1019
|
+
></devtools-button>`;
|
1020
|
+
}
|
1021
|
+
|
1022
|
+
#renderChatInput = (): LitHtml.LitTemplate => {
|
1023
|
+
if (!this.#props.agentType) {
|
1024
|
+
return LitHtml.nothing;
|
1025
|
+
}
|
1026
|
+
|
991
1027
|
// clang-format off
|
992
1028
|
return html`
|
1029
|
+
<form class="input-form" @submit=${this.#handleSubmit}>
|
1030
|
+
${this.#props.state !== State.CONSENT_VIEW ? html`
|
1031
|
+
<div class="input-header">
|
1032
|
+
<div class="header-link-container">
|
1033
|
+
${this.#renderSelection()}
|
1034
|
+
</div>
|
1035
|
+
</div>
|
1036
|
+
` : LitHtml.nothing}
|
993
1037
|
<div class="chat-input-container">
|
994
1038
|
<textarea class="chat-input"
|
995
1039
|
.disabled=${this.#isTextInputDisabled()}
|
996
1040
|
wrap="hard"
|
997
1041
|
@keydown=${this.#handleTextAreaKeyDown}
|
998
|
-
placeholder=${getInputPlaceholderString(
|
999
|
-
jslog=${VisualLogging.textField('query').track({ keydown: 'Enter' })}
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
@click=${this.#handleCancel}
|
1005
|
-
.data=${
|
1006
|
-
{
|
1007
|
-
variant: Buttons.Button.Variant.ICON,
|
1008
|
-
size: Buttons.Button.Size.REGULAR,
|
1009
|
-
disabled: this.#isTextInputDisabled(),
|
1010
|
-
iconName: 'record-stop',
|
1011
|
-
title: lockedString(UIStringsNotTranslate.cancelButtonTitle),
|
1012
|
-
jslogContext: 'stop',
|
1013
|
-
} as Buttons.Button.ButtonData
|
1014
|
-
}
|
1015
|
-
></devtools-button>`
|
1016
|
-
: html`<devtools-button
|
1017
|
-
class="chat-input-button"
|
1018
|
-
aria-label=${lockedString(UIStringsNotTranslate.sendButtonTitle)}
|
1019
|
-
.data=${
|
1020
|
-
{
|
1021
|
-
type: 'submit',
|
1022
|
-
variant: Buttons.Button.Variant.ICON,
|
1023
|
-
size: Buttons.Button.Size.REGULAR,
|
1024
|
-
disabled: this.#isTextInputDisabled(),
|
1025
|
-
iconName: 'send',
|
1026
|
-
title: lockedString(UIStringsNotTranslate.sendButtonTitle),
|
1027
|
-
jslogContext: 'send',
|
1028
|
-
} as Buttons.Button.ButtonData
|
1029
|
-
}
|
1030
|
-
></devtools-button>`}
|
1031
|
-
</div>`;
|
1042
|
+
placeholder=${this.#getInputPlaceholderString()}
|
1043
|
+
jslog=${VisualLogging.textField('query').track({ keydown: 'Enter' })}
|
1044
|
+
></textarea>
|
1045
|
+
${this.#renderChatInputButton()}
|
1046
|
+
</div>
|
1047
|
+
</form>`;
|
1032
1048
|
// clang-format on
|
1033
1049
|
};
|
1034
1050
|
|
1035
1051
|
#getDisclaimerText = (): Platform.UIString.LocalizedString => {
|
1036
|
-
if (this.#props.state === State.CONSENT_VIEW || !this.#props.agentType) {
|
1052
|
+
if (this.#props.state === State.CONSENT_VIEW || !this.#props.agentType || this.#props.isReadOnly) {
|
1037
1053
|
return i18nString(UIStrings.inputDisclaimerForEmptyState);
|
1038
1054
|
}
|
1039
1055
|
switch (this.#props.agentType) {
|
@@ -1062,14 +1078,13 @@ export class FreestylerChatUi extends HTMLElement {
|
|
1062
1078
|
|
1063
1079
|
#getStringForConsentView(): string {
|
1064
1080
|
const config = Common.Settings.Settings.instance().getHostConfig();
|
1065
|
-
if (config.devToolsAiAssistancePerformanceAgent?.enabled
|
1066
|
-
config.devToolsAiAssistancePerformanceAgentDogfood?.enabled) {
|
1081
|
+
if (config.devToolsAiAssistancePerformanceAgent?.enabled) {
|
1067
1082
|
return UIStrings.turnOnForStylesRequestsPerformanceAndFiles;
|
1068
1083
|
}
|
1069
|
-
if (config.devToolsAiAssistanceFileAgent?.enabled
|
1084
|
+
if (config.devToolsAiAssistanceFileAgent?.enabled) {
|
1070
1085
|
return UIStrings.turnOnForStylesRequestsAndFiles;
|
1071
1086
|
}
|
1072
|
-
if (config.devToolsAiAssistanceNetworkAgent?.enabled
|
1087
|
+
if (config.devToolsAiAssistanceNetworkAgent?.enabled) {
|
1073
1088
|
return UIStrings.turnOnForStylesAndRequests;
|
1074
1089
|
}
|
1075
1090
|
return UIStrings.turnOnForStyles;
|
@@ -1114,33 +1129,76 @@ export class FreestylerChatUi extends HTMLElement {
|
|
1114
1129
|
|
1115
1130
|
#renderNoAgentState(): LitHtml.TemplateResult {
|
1116
1131
|
const config = Common.Settings.Settings.instance().getHostConfig();
|
1132
|
+
const featureCards: {
|
1133
|
+
icon: string,
|
1134
|
+
heading: string,
|
1135
|
+
content: LitHtml.TemplateResult,
|
1136
|
+
}[] =
|
1137
|
+
[
|
1138
|
+
...(config.devToolsFreestyler?.enabled ? [{
|
1139
|
+
icon: 'brush-2',
|
1140
|
+
heading: 'CSS styles',
|
1141
|
+
content: html`Open <button class="link" role="link" jslog=${
|
1142
|
+
VisualLogging.link('open-elements-panel').track({click: true})} @click=${() => {
|
1143
|
+
void UI.ViewManager.ViewManager.instance().showView('elements');
|
1144
|
+
}}>Elements</button> to ask about CSS styles`,
|
1145
|
+
}] :
|
1146
|
+
[]),
|
1147
|
+
...(config.devToolsAiAssistanceNetworkAgent?.enabled) ? [{
|
1148
|
+
icon: 'arrow-up-down',
|
1149
|
+
heading: 'Network',
|
1150
|
+
content: html`Open <button class="link" role="link" jslog=${
|
1151
|
+
VisualLogging.link('open-network-panel').track({click: true})} @click=${() => {
|
1152
|
+
void UI.ViewManager.ViewManager.instance().showView('network');
|
1153
|
+
}}>Network</button> to ask about a request's details`,
|
1154
|
+
}] :
|
1155
|
+
[],
|
1156
|
+
...(config.devToolsAiAssistanceFileAgent?.enabled) ? [{
|
1157
|
+
icon: 'document',
|
1158
|
+
heading: 'Files',
|
1159
|
+
content: html`Open <button class="link" role="link" jslog=${
|
1160
|
+
VisualLogging.link('open-sources-panel').track({click: true})} @click=${() => {
|
1161
|
+
void UI.ViewManager.ViewManager.instance().showView('sources');
|
1162
|
+
}}>Sources</button> to ask about a file's content`,
|
1163
|
+
}] :
|
1164
|
+
[],
|
1165
|
+
...(config.devToolsAiAssistancePerformanceAgent?.enabled ? [{
|
1166
|
+
icon: 'performance',
|
1167
|
+
heading: 'Performance',
|
1168
|
+
content: html`Open <button class="link" role="link" jslog=${
|
1169
|
+
VisualLogging.link('open-performance-panel').track({click: true})} @click=${() => {
|
1170
|
+
void UI.ViewManager.ViewManager.instance().showView('timeline');
|
1171
|
+
}}>Performance</button> to ask about a trace item`,
|
1172
|
+
}] :
|
1173
|
+
[]),
|
1174
|
+
];
|
1117
1175
|
|
1118
1176
|
// clang-format off
|
1119
1177
|
return html`
|
1120
|
-
<div class="
|
1121
|
-
<
|
1122
|
-
<div class="
|
1123
|
-
<devtools-icon
|
1124
|
-
|
1125
|
-
|
1126
|
-
<div class="instructions">
|
1127
|
-
<p>${lockedString(UIStringsNotTranslate.getStarted)}</p>
|
1128
|
-
${config.devToolsFreestyler?.enabled ? html`
|
1129
|
-
<p><strong>${lockedString(UIStringsNotTranslate.cssHelp)}</strong> ${lockedString(UIStringsNotTranslate.cssHelpExplainer)}</p>
|
1130
|
-
` : LitHtml.nothing}
|
1131
|
-
${(config.devToolsAiAssistanceFileAgent?.enabled || config.devToolsAiAssistanceFileAgentDogfood?.enabled) ? html`
|
1132
|
-
<p><strong>${lockedString(UIStringsNotTranslate.fileHelp)}</strong> ${lockedString(UIStringsNotTranslate.fileHelpExplainer)}</p>
|
1133
|
-
` : LitHtml.nothing}
|
1134
|
-
${(config.devToolsAiAssistanceNetworkAgent?.enabled || config.devToolsExplainThisResourceDogfood?.enabled) ? html`
|
1135
|
-
<p><strong>${lockedString(UIStringsNotTranslate.networkHelp)}</strong> ${lockedString(UIStringsNotTranslate.networkHelpExplainer)}</p>
|
1136
|
-
` : LitHtml.nothing}
|
1137
|
-
${(config.devToolsAiAssistancePerformanceAgent?.enabled || config.devToolsAiAssistancePerformanceAgentDogfood?.enabled) ? html`
|
1138
|
-
<p><strong>${lockedString(UIStringsNotTranslate.performanceHelp)}</strong> ${lockedString(UIStringsNotTranslate.performanceHelpExplainer)}</p>
|
1139
|
-
` : LitHtml.nothing}
|
1178
|
+
<div class="empty-state-container">
|
1179
|
+
<div class="header">
|
1180
|
+
<div class="icon">
|
1181
|
+
<devtools-icon
|
1182
|
+
name="smart-assistant"
|
1183
|
+
></devtools-icon>
|
1140
1184
|
</div>
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1185
|
+
<h1>${lockedString(UIStringsNotTranslate.noAgentStateText)}</h1>
|
1186
|
+
<p>To chat about an item, right-click and select <strong>Ask AI</strong></p>
|
1187
|
+
</div>
|
1188
|
+
<div class="empty-state-content">
|
1189
|
+
${featureCards.map(featureCard => html`
|
1190
|
+
<div class="feature-card">
|
1191
|
+
<div class="feature-card-icon">
|
1192
|
+
<devtools-icon name=${featureCard.icon}></devtools-icon>
|
1193
|
+
</div>
|
1194
|
+
<div class="feature-card-content">
|
1195
|
+
<h3>${featureCard.heading}</h3>
|
1196
|
+
<p>${featureCard.content}</p>
|
1197
|
+
</div>
|
1198
|
+
</div>
|
1199
|
+
`)}
|
1200
|
+
</div>
|
1201
|
+
</div>`;
|
1144
1202
|
// clang-format on
|
1145
1203
|
}
|
1146
1204
|
|
@@ -1170,16 +1228,10 @@ export class FreestylerChatUi extends HTMLElement {
|
|
1170
1228
|
<div class="chat-ui">
|
1171
1229
|
<main @scroll=${this.#handleScroll}>
|
1172
1230
|
${this.#renderMainContents()}
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
${this.#renderSelection()}
|
1178
|
-
</div>
|
1179
|
-
</div>
|
1180
|
-
` : LitHtml.nothing}
|
1181
|
-
${this.#renderChatInput()}
|
1182
|
-
</form>
|
1231
|
+
${this.#props.isReadOnly ?
|
1232
|
+
this.#renderReadOnlySection() :
|
1233
|
+
this.#renderChatInput()
|
1234
|
+
}
|
1183
1235
|
</main>
|
1184
1236
|
<footer class="disclaimer">
|
1185
1237
|
<p class="disclaimer-text">
|