chrome-devtools-frontend 1.0.1726686 → 1.0.1730971
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/.agents/rules/tests/test-strict-assertions-and-literal-expectations.md +1 -1
- package/.agents/rules/tests/test-view-and-presenter-isolation.md +1 -1
- package/.agents/rules/ui-and-widgets/ui-accessibility-and-semantic-html.md +1 -1
- package/.agents/rules/ui-and-widgets/ui-css-scoping-and-flex-layout.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-declarative-child-widget-composition.md +5 -5
- package/.agents/rules/ui-and-widgets/ui-lit-declarative-templates-and-directives.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-localization-and-uistrings-hygiene.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-modern-component-and-encapsulation-standards.md +3 -3
- package/.agents/rules/ui-and-widgets/ui-pure-view-and-presenter-separation.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-reactive-widget-update-lifecycle.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-view-output-and-callback-contracts.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-widget-dom-and-listener-lifecycle.md +2 -2
- package/.agents/skills/code-review/SKILL.md +63 -12
- package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +38 -10
- package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +1 -0
- package/.agents/skills/ui-widgets/SKILL.md +8 -2
- package/.agents/skills/write-ai-eval-test/SKILL.md +106 -0
- package/AUTHORS +2 -0
- package/DIR_METADATA +1 -2
- package/README.md +48 -26
- package/config/typescript/tsconfig.base.json +1 -0
- package/config/typescript/tsconfig.eslint.json +1 -0
- package/docs/contributing/changes.md +25 -0
- package/docs/ui_engineering.md +13 -4
- package/eslint.config.mjs +323 -41
- package/front_end/core/common/Color.ts +7 -7
- package/front_end/core/common/ParsedURL.ts +3 -3
- package/front_end/core/common/ResolverBase.ts +3 -3
- package/front_end/core/common/SegmentedRange.ts +3 -3
- package/front_end/core/common/SimpleHistoryManager.ts +14 -14
- package/front_end/core/common/Trie.ts +3 -3
- package/front_end/core/common/VersionController.ts +7 -7
- package/front_end/core/host/InspectorFrontendHost.ts +2 -2
- package/front_end/core/host/InspectorFrontendHostAPI.ts +9 -1
- package/front_end/core/host/InspectorFrontendHostStub.ts +1 -1
- package/front_end/core/host/UserMetrics.ts +4 -0
- package/front_end/core/host/UserMetricsEnums.ts +2 -1
- package/front_end/core/platform/StringUtilities.ts +54 -13
- package/front_end/core/platform/node/HostRuntime.ts +13 -7
- package/front_end/core/protocol_client/DevToolsCDPConnection.ts +4 -5
- package/front_end/core/root/Runtime.ts +5 -0
- package/front_end/core/sdk/AccessibilityModel.ts +5 -5
- package/front_end/core/sdk/AnimationModel.ts +17 -19
- package/front_end/core/sdk/CPUProfilerModel.ts +3 -3
- package/front_end/core/sdk/CPUThrottlingManager.ts +7 -0
- package/front_end/core/sdk/CSSMatchedStyles.ts +73 -13
- package/front_end/core/sdk/CSSMetadata.ts +7 -7
- package/front_end/core/sdk/CSSModel.ts +33 -33
- package/front_end/core/sdk/CSSProperty.ts +5 -5
- package/front_end/core/sdk/CSSRule.ts +6 -6
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +4 -4
- package/front_end/core/sdk/Connections.ts +16 -16
- package/front_end/core/sdk/ConsoleModel.ts +44 -47
- package/front_end/core/sdk/CookieParser.ts +11 -11
- package/front_end/core/sdk/EmulationModel.ts +35 -36
- package/front_end/core/sdk/EventBreakpointsModel.ts +11 -11
- package/front_end/core/sdk/FrameManager.ts +16 -16
- package/front_end/core/sdk/IsolateManager.ts +2 -2
- package/front_end/core/sdk/IssuesModel.ts +2 -2
- package/front_end/core/sdk/OverlayModel.ts +19 -19
- package/front_end/core/sdk/PageResourceLoader.ts +14 -16
- package/front_end/core/sdk/RemoteObject.ts +9 -9
- package/front_end/core/sdk/Resource.ts +2 -2
- package/front_end/core/sdk/RuntimeModel.ts +7 -7
- package/front_end/core/sdk/Script.ts +6 -6
- package/front_end/core/sdk/ServiceWorkerManager.ts +36 -10
- package/front_end/core/sdk/SourceMap.ts +18 -20
- package/front_end/core/sdk/SourceMapManager.ts +2 -2
- package/front_end/core/sdk/TargetManager.ts +2 -2
- package/front_end/devtools_compatibility.js +7 -3
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +2 -2
- package/front_end/entrypoints/node_app/app/NodeConnectionsPanel.ts +203 -115
- package/front_end/generated/InspectorBackendCommands.ts +1 -1
- package/front_end/generated/SupportedCSSProperties.ts +1 -3
- package/front_end/generated/protocol.ts +1 -0
- package/front_end/models/ai_assistance/AiAgent2.ts +36 -12
- package/front_end/models/ai_assistance/AiConversation.ts +8 -2
- package/front_end/models/ai_assistance/agents/AiAgent.ts +137 -62
- package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +2 -2
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.snapshot.txt +149 -2
- package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.ts +269 -42
- package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +3 -0
- package/front_end/models/ai_assistance/tools/GetLighthouseAudits.ts +9 -0
- package/front_end/models/ai_assistance/tools/ResolveDevtoolsNodePath.ts +13 -2
- package/front_end/models/ai_assistance/tools/RunLighthouse.ts +23 -7
- package/front_end/models/ai_assistance/tools/Tool.ts +7 -5
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +22 -24
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +60 -60
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +24 -24
- package/front_end/models/bindings/DefaultScriptMapping.ts +8 -8
- package/front_end/models/bindings/FileUtils.ts +13 -13
- package/front_end/models/bindings/PresentationConsoleMessageHelper.ts +3 -3
- package/front_end/models/bindings/ResourceScriptMapping.ts +23 -23
- package/front_end/models/comment_manager/CommentManager.ts +3 -3
- package/front_end/models/comment_manager/CommentThread.ts +50 -5
- package/front_end/models/cpu_profile/CPUProfileDataModel.ts +14 -14
- package/front_end/models/cpu_profile/ProfileTreeModel.ts +4 -4
- package/front_end/models/elements/StyleChanges.ts +38 -0
- package/front_end/models/emulation/EmulatedDevices.ts +12 -12
- package/front_end/models/har/HARFormat.ts +4 -4
- package/front_end/models/javascript_metadata/NativeFunctions.ts +5 -1
- package/front_end/models/lighthouse/LighthouseReporterTypes.ts +57 -3
- package/front_end/models/lighthouse/RunTypes.ts +9 -1
- package/front_end/models/logs/LogManager.ts +2 -2
- package/front_end/models/persistence/AutomaticFileSystemManager.ts +3 -0
- package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +24 -24
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +6 -0
- package/front_end/models/persistence/NetworkPersistenceManager.ts +8 -3
- package/front_end/models/trace/LanternComputationData.ts +37 -11
- package/front_end/models/trace/Processor.ts +2 -1
- package/front_end/models/trace/extras/TraceTree.ts +36 -10
- package/front_end/models/trace/handlers/InitiatorsHandler.ts +27 -34
- package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +2 -6
- package/front_end/models/trace/handlers/SamplesHandler.ts +9 -6
- package/front_end/models/workspace/FileManager.ts +6 -0
- package/front_end/panels/accessibility/ARIAAttributesView.ts +4 -4
- package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +8 -1
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +15 -17
- package/front_end/panels/accessibility/AccessibilitySubPane.ts +1 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +5 -5
- package/front_end/panels/ai_assistance/ExternalHandler.ts +10 -1
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +27 -22
- package/front_end/panels/ai_assistance/components/DisabledWidget.ts +19 -23
- package/front_end/panels/ai_assistance/components/ExploreWidget.ts +2 -2
- package/front_end/panels/ai_assistance/components/PermissionPrompt.ts +23 -9
- package/front_end/panels/ai_assistance/components/chatInput.css +1 -1
- package/front_end/panels/animation/AnimationTimeline.ts +37 -17
- package/front_end/panels/animation/animationTimeline.css +19 -3
- package/front_end/panels/application/AppManifestView.ts +1 -2
- package/front_end/panels/application/ApplicationPanelSidebar.ts +143 -128
- package/front_end/panels/application/DOMStorageItemsView.ts +14 -14
- package/front_end/panels/application/DeviceBoundSessionsView.ts +10 -13
- package/front_end/panels/application/ExtensionStorageItemsView.ts +3 -4
- package/front_end/panels/application/IndexedDBViews.ts +8 -4
- package/front_end/panels/application/KeyValueStorageItemsView.ts +4 -5
- package/front_end/panels/application/PrivateVerificationTokensView.ts +53 -0
- package/front_end/panels/application/ServiceWorkerCacheViews.ts +12 -8
- package/front_end/panels/application/ServiceWorkersView.ts +1 -2
- package/front_end/panels/application/StorageItemsToolbar.ts +3 -3
- package/front_end/panels/application/StorageView.ts +2 -2
- package/front_end/panels/application/WebMCPView.ts +91 -109
- package/front_end/panels/application/application.ts +2 -0
- package/front_end/panels/application/components/StorageMetadataView.ts +6 -6
- package/front_end/panels/application/preloading/PreloadingView.ts +70 -37
- package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +2 -2
- package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +3 -3
- package/front_end/panels/application/preloading/components/PreloadingGrid.ts +12 -0
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +10 -11
- package/front_end/panels/application/privateVerificationTokensView.css +20 -0
- package/front_end/panels/application/serviceWorkersView.css +2 -2
- package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +24 -24
- package/front_end/panels/changes/ChangesSidebar.ts +5 -5
- package/front_end/panels/changes/ChangesView.ts +10 -11
- package/front_end/panels/comments/CommentsPane.ts +292 -102
- package/front_end/panels/comments/commentsPane.css +93 -12
- package/front_end/panels/common/CommentThreadWidget.ts +69 -0
- package/front_end/panels/common/CommentsOverlayWidget.ts +108 -29
- package/front_end/panels/common/CommentsStatusBarPill.ts +17 -6
- package/front_end/panels/common/DOMLinkifier.ts +37 -12
- package/front_end/panels/common/ExtensionPanel.ts +13 -4
- package/front_end/panels/common/ExtensionServer.ts +27 -3
- package/front_end/panels/common/PersistenceUtils.ts +3 -3
- package/front_end/panels/common/commentThreadWidget.css +25 -1
- package/front_end/panels/common/common-meta.ts +10 -0
- package/front_end/panels/console/ConsolePinPane.ts +13 -15
- package/front_end/panels/console/ConsolePrompt.ts +173 -95
- package/front_end/panels/console/ConsoleSidebar.ts +2 -2
- package/front_end/panels/console/ConsoleView.ts +75 -79
- package/front_end/panels/console/ConsoleViewMessage.ts +52 -4
- package/front_end/panels/console/SymbolizedErrorWidget.ts +8 -4
- package/front_end/panels/console/consolePrompt.css +1 -1
- package/front_end/panels/console/consoleView.css +1 -1
- package/front_end/panels/console_counters/WarningErrorCounter.ts +3 -4
- package/front_end/panels/coverage/CoverageListView.ts +2 -2
- package/front_end/panels/coverage/CoverageView.ts +20 -5
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +4 -3
- package/front_end/panels/css_overview/CSSOverviewPanel.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewStartView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewUnusedDeclarations.ts +8 -8
- package/front_end/panels/developer_resources/DeveloperResourcesListView.ts +2 -3
- package/front_end/panels/developer_resources/DeveloperResourcesView.ts +4 -5
- package/front_end/panels/elements/AccessibilityTreeUtils.ts +6 -7
- package/front_end/panels/elements/CSSValueTraceView.ts +3 -3
- package/front_end/panels/elements/ClassesPaneWidget.ts +1 -2
- package/front_end/panels/elements/ComputedStyleWidget.ts +15 -14
- package/front_end/panels/elements/DOMTreeElementWidget.ts +5 -4
- package/front_end/panels/elements/DOMTreeWidget.ts +2 -1
- package/front_end/panels/elements/ElementStatePaneWidget.ts +2 -2
- package/front_end/panels/elements/ElementsPanel.ts +1 -0
- package/front_end/panels/elements/EventListenersWidget.ts +2 -2
- package/front_end/panels/elements/LayoutPane.ts +2 -2
- package/front_end/panels/elements/PlatformFontsWidget.ts +3 -3
- package/front_end/panels/elements/PropertiesWidget.ts +9 -10
- package/front_end/panels/elements/PropertyRenderer.ts +72 -11
- package/front_end/panels/elements/StandaloneStylesContainer.ts +5 -10
- package/front_end/panels/elements/StyleEditorWidget.ts +30 -16
- package/front_end/panels/elements/StylePropertiesSection.ts +93 -44
- package/front_end/panels/elements/StylePropertyTreeElement.ts +230 -302
- package/front_end/panels/elements/StylesContainer.ts +2 -3
- package/front_end/panels/elements/StylesSidebarPane.ts +4 -13
- package/front_end/panels/elements/components/AccessibilityTreeNode.ts +66 -37
- package/front_end/panels/elements/components/CSSHintDetailsView.ts +51 -41
- package/front_end/panels/elements/components/CSSPropertyDocsView.ts +75 -65
- package/front_end/panels/elements/components/CSSQuery.ts +112 -74
- package/front_end/panels/elements/components/CSSVariableValueView.ts +109 -68
- package/front_end/panels/elements/components/ComputedStyleProperty.ts +64 -45
- package/front_end/panels/elements/components/ElementsTreeExpandButton.ts +35 -28
- package/front_end/panels/elements/components/QueryContainer.ts +104 -74
- package/front_end/panels/elements/components/accessibilityTreeNode.css +22 -20
- package/front_end/panels/elements/components/computedStyleProperty.css +2 -0
- package/front_end/panels/elements/components/cssHintDetailsView.css +23 -21
- package/front_end/panels/elements/components/cssPropertyDocsView.css +38 -36
- package/front_end/panels/elements/components/cssVariableValueView.css +42 -40
- package/front_end/panels/elements/components/elementsTreeExpandButton.css +5 -2
- package/front_end/panels/elements/components/queryContainer.css +23 -21
- package/front_end/panels/elements/stylesSidebarPane.css +3 -3
- package/front_end/panels/emulation/DeviceModeToolbar.ts +2 -2
- package/front_end/panels/emulation/InspectedPagePlaceholder.ts +2 -2
- package/front_end/panels/emulation/MediaQueryInspector.ts +9 -10
- package/front_end/panels/emulation/mediaQueryInspector.css +1 -1
- package/front_end/panels/event_listeners/EventListenersView.ts +2 -2
- package/front_end/panels/issues/AffectedCookiesView.ts +144 -101
- package/front_end/panels/issues/AffectedDescendantsWithinSelectElementView.ts +83 -31
- package/front_end/panels/issues/AffectedDirectivesView.ts +218 -135
- package/front_end/panels/issues/AffectedDocumentsInQuirksModeView.ts +84 -34
- package/front_end/panels/issues/AffectedElementsView.ts +86 -23
- package/front_end/panels/issues/AffectedLazyLoadImagesView.ts +2 -2
- package/front_end/panels/issues/AffectedMetadataAllowedSitesView.ts +2 -2
- package/front_end/panels/issues/AffectedPartitioningBlobURLView.ts +36 -11
- package/front_end/panels/issues/AffectedSharedArrayBufferIssueDetailsView.ts +135 -58
- package/front_end/panels/issues/AffectedSourcesView.ts +49 -28
- package/front_end/panels/issues/AffectedTrackingSitesView.ts +3 -4
- package/front_end/panels/issues/CorsIssueDetailsView.ts +490 -269
- package/front_end/panels/issues/GenericIssueDetailsView.ts +2 -2
- package/front_end/panels/issues/IssueKindView.ts +63 -48
- package/front_end/panels/issues/IssueView.ts +14 -18
- package/front_end/panels/issues/components/ElementsPanelLink.ts +70 -34
- package/front_end/panels/issues/components/HideIssuesMenu.ts +56 -32
- package/front_end/panels/issues/components/elementsPanelLink.css +10 -6
- package/front_end/panels/issues/components/hideIssuesMenu.css +16 -14
- package/front_end/panels/issues/issues.ts +2 -0
- package/front_end/panels/issues/issuesTree.css +4 -4
- package/front_end/panels/lighthouse/LighthouseController.ts +6 -6
- package/front_end/panels/lighthouse/LighthouseStatusView.ts +12 -13
- package/front_end/panels/lighthouse/lighthouseStartView.css +1 -1
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +159 -161
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorView.ts +228 -0
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +32 -41
- package/front_end/panels/linear_memory_inspector/components/linearMemoryHighlightChipList.css +2 -2
- package/front_end/panels/linear_memory_inspector/linear_memory_inspector.ts +2 -0
- package/front_end/panels/media/EventDisplayTable.ts +2 -2
- package/front_end/panels/media/MainView.ts +132 -66
- package/front_end/panels/media/PlayerDetailView.ts +32 -14
- package/front_end/panels/media/PlayerListView.ts +83 -23
- package/front_end/panels/media/PlayerPropertiesView.ts +2 -2
- package/front_end/panels/media/TickingFlameChart.ts +153 -63
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +2 -2
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +615 -464
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +43 -0
- package/front_end/panels/network/EventSourceMessagesView.ts +3 -3
- package/front_end/panels/network/NetworkConfigView.ts +6 -2
- package/front_end/panels/network/NetworkDataGridNode.ts +2 -1
- package/front_end/panels/network/NetworkItemView.ts +27 -26
- package/front_end/panels/network/NetworkManageCustomHeadersView.ts +236 -97
- package/front_end/panels/network/NetworkOverview.ts +8 -10
- package/front_end/panels/network/RequestConditionsDrawer.ts +8 -4
- package/front_end/panels/network/RequestDeviceBoundSessionsView.ts +2 -4
- package/front_end/panels/network/RequestHTMLView.ts +26 -7
- package/front_end/panels/network/RequestHeadersView.ts +2 -2
- package/front_end/panels/network/RequestInitiatorView.ts +21 -22
- package/front_end/panels/network/RequestPayloadView.ts +2 -16
- package/front_end/panels/network/RequestPreviewView.ts +5 -5
- package/front_end/panels/network/RequestTimingView.ts +6 -6
- package/front_end/panels/network/ResourceDirectSocketChunkView.ts +5 -6
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +4 -3
- package/front_end/panels/network/ShowMoreDetailsWidget.ts +11 -12
- package/front_end/panels/network/SignedExchangeInfoView.ts +2 -2
- package/front_end/panels/network/networkLogView.css +2 -2
- package/front_end/panels/network/networkManageCustomHeadersView.css +27 -6
- package/front_end/panels/network/requestConditionsDrawer.css +1 -1
- package/front_end/panels/network/requestInitiatorView.css +5 -3
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +2 -2
- package/front_end/panels/profiler/HeapDetachedElementsView.ts +1 -2
- package/front_end/panels/profiler/HeapTimelineOverview.ts +77 -15
- package/front_end/panels/profiler/IsolateSelector.ts +258 -187
- package/front_end/panels/profiler/ProfileLauncherView.ts +7 -29
- package/front_end/panels/profiler/profileLauncherView.css +6 -1
- package/front_end/panels/protocol_monitor/JSONEditor.ts +4 -5
- package/front_end/panels/recorder/ControlButton.ts +1 -1
- package/front_end/panels/recorder/RecordingListView.ts +2 -4
- package/front_end/panels/recorder/RecordingView.ts +1 -2
- package/front_end/panels/recorder/SelectorPicker.ts +2 -4
- package/front_end/panels/recorder/StepView.ts +24 -10
- package/front_end/panels/recorder/TimelineSection.ts +1 -1
- package/front_end/panels/recorder/recordingView.css +1 -1
- package/front_end/panels/screencast/ScreencastApp.ts +1 -1
- package/front_end/panels/search/SearchResultsPane.ts +11 -12
- package/front_end/panels/search/SearchView.ts +8 -10
- package/front_end/panels/security/SecurityPanel.ts +1 -8
- package/front_end/panels/security/SecurityPanelSidebar.ts +2 -2
- package/front_end/panels/security/mainView.css +1 -1
- package/front_end/panels/sensors/LocationsSettingsTab.ts +1 -2
- package/front_end/panels/settings/AISettingsTab.ts +1 -1
- package/front_end/panels/settings/BackendLinkingSettingsTab.ts +34 -20
- package/front_end/panels/settings/EditFileSystemView.ts +2 -2
- package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +375 -197
- package/front_end/panels/settings/KeybindsSettingsTab.ts +570 -414
- package/front_end/panels/settings/SettingsScreen.ts +312 -114
- package/front_end/panels/settings/WorkspaceSettingsTab.ts +2 -2
- package/front_end/panels/settings/aiSettingsTab.css +1 -4
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +924 -578
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +9 -2
- package/front_end/panels/settings/emulation/devicesSettingsTab.css +39 -0
- package/front_end/panels/settings/frameworkIgnoreListSettingsTab.css +37 -8
- package/front_end/panels/settings/settingsScreen.css +0 -24
- package/front_end/panels/sources/BreakpointEditDialog.ts +9 -6
- package/front_end/panels/sources/BreakpointsView.ts +25 -4
- package/front_end/panels/sources/CallStackSidebarPane.ts +7 -1
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -0
- package/front_end/panels/sources/GoToLineQuickOpen.ts +8 -8
- package/front_end/panels/sources/NavigatorView.ts +521 -439
- package/front_end/panels/sources/PersistenceActions.ts +11 -12
- package/front_end/panels/sources/ProfilePlugin.ts +28 -17
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +3 -4
- package/front_end/panels/sources/SourcesNavigator.ts +9 -9
- package/front_end/panels/sources/SourcesPanel.ts +2 -2
- package/front_end/panels/sources/SourcesView.ts +3 -3
- package/front_end/panels/sources/ThreadsSidebarPane.ts +2 -2
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +2 -2
- package/front_end/panels/sources/components/HeadersView.ts +1 -2
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +5 -6
- package/front_end/panels/timeline/EventsTimelineTreeView.ts +73 -34
- package/front_end/panels/timeline/IsolateSelector.ts +25 -37
- package/front_end/panels/timeline/StatusDialog.ts +5 -7
- package/front_end/panels/timeline/ThirdPartyTreeView.ts +10 -13
- package/front_end/panels/timeline/TimelineDetailsView.ts +40 -21
- package/front_end/panels/timeline/TimelineEventOverview.ts +130 -34
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +1 -1
- package/front_end/panels/timeline/TimelineMiniMap.ts +255 -103
- package/front_end/panels/timeline/TimelinePaintProfilerView.ts +19 -11
- package/front_end/panels/timeline/TimelinePanel.ts +1 -0
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +11 -12
- package/front_end/panels/timeline/TimelineTreeView.ts +240 -122
- package/front_end/panels/timeline/TimelineUIUtils.ts +12 -0
- package/front_end/panels/timeline/components/BreadcrumbsUI.ts +5 -4
- package/front_end/panels/timeline/components/DetailsView.ts +97 -65
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +2 -2
- package/front_end/panels/timeline/components/MetricCard.ts +2 -2
- package/front_end/panels/timeline/components/NetworkRequestDetails.ts +11 -12
- package/front_end/panels/timeline/components/NetworkTrackWidget.ts +57 -50
- package/front_end/panels/timeline/components/RelatedInsightChips.ts +2 -2
- package/front_end/panels/timeline/components/Sidebar.ts +161 -109
- package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +33 -12
- package/front_end/panels/timeline/components/SidebarInsightsTab.ts +3 -0
- package/front_end/panels/timeline/components/insights/LCPDiscovery.ts +11 -11
- package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +6 -7
- package/front_end/panels/timeline/components/networkTrackWidget.css +24 -22
- package/front_end/panels/timeline/components/sidebarInsightsTab.css +1 -1
- package/front_end/panels/timeline/overlays/components/TimespanBreakdownOverlay.ts +15 -10
- package/front_end/panels/timeline/overlays/components/entryLabelOverlay.css +1 -1
- package/front_end/panels/timeline/timelinePanel.css +5 -0
- package/front_end/panels/timeline/timelineStatusDialog.css +1 -1
- package/front_end/panels/web_audio/WebAudioView.ts +2 -2
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/legacy-javascript/README.chromium +2 -2
- package/front_end/third_party/legacy-javascript/lib/legacy-javascript.js +2 -2
- package/front_end/third_party/legacy-javascript/package.json +1 -1
- package/front_end/third_party/lighthouse/README.chromium +2 -2
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1983 -2022
- package/front_end/third_party/lighthouse/locales/ar-XB.json +157 -142
- package/front_end/third_party/lighthouse/locales/ar.json +157 -142
- package/front_end/third_party/lighthouse/locales/bg.json +154 -139
- package/front_end/third_party/lighthouse/locales/ca.json +157 -142
- package/front_end/third_party/lighthouse/locales/cs.json +148 -133
- package/front_end/third_party/lighthouse/locales/da.json +153 -138
- package/front_end/third_party/lighthouse/locales/de.json +152 -137
- package/front_end/third_party/lighthouse/locales/el.json +153 -138
- package/front_end/third_party/lighthouse/locales/en-GB.json +160 -145
- package/front_end/third_party/lighthouse/locales/en-US.json +239 -218
- package/front_end/third_party/lighthouse/locales/en-XL.json +239 -218
- package/front_end/third_party/lighthouse/locales/es-419.json +150 -135
- package/front_end/third_party/lighthouse/locales/es.json +149 -134
- package/front_end/third_party/lighthouse/locales/fi.json +151 -136
- package/front_end/third_party/lighthouse/locales/fil.json +154 -139
- package/front_end/third_party/lighthouse/locales/fr.json +150 -135
- package/front_end/third_party/lighthouse/locales/he.json +160 -145
- package/front_end/third_party/lighthouse/locales/hi.json +156 -141
- package/front_end/third_party/lighthouse/locales/hr.json +154 -139
- package/front_end/third_party/lighthouse/locales/hu.json +111 -96
- package/front_end/third_party/lighthouse/locales/id.json +153 -138
- package/front_end/third_party/lighthouse/locales/it.json +153 -138
- package/front_end/third_party/lighthouse/locales/ja.json +150 -135
- package/front_end/third_party/lighthouse/locales/ko.json +42 -27
- package/front_end/third_party/lighthouse/locales/lt.json +152 -137
- package/front_end/third_party/lighthouse/locales/lv.json +93 -78
- package/front_end/third_party/lighthouse/locales/nl.json +149 -134
- package/front_end/third_party/lighthouse/locales/no.json +152 -137
- package/front_end/third_party/lighthouse/locales/pl.json +153 -138
- package/front_end/third_party/lighthouse/locales/pt-PT.json +152 -137
- package/front_end/third_party/lighthouse/locales/pt.json +157 -142
- package/front_end/third_party/lighthouse/locales/ro.json +149 -134
- package/front_end/third_party/lighthouse/locales/ru.json +76 -61
- package/front_end/third_party/lighthouse/locales/sk.json +153 -138
- package/front_end/third_party/lighthouse/locales/sl.json +149 -134
- package/front_end/third_party/lighthouse/locales/sr-Latn.json +151 -136
- package/front_end/third_party/lighthouse/locales/sr.json +151 -136
- package/front_end/third_party/lighthouse/locales/sv.json +152 -137
- package/front_end/third_party/lighthouse/locales/ta.json +156 -141
- package/front_end/third_party/lighthouse/locales/te.json +157 -142
- package/front_end/third_party/lighthouse/locales/th.json +111 -96
- package/front_end/third_party/lighthouse/locales/tr.json +153 -138
- package/front_end/third_party/lighthouse/locales/uk.json +149 -134
- package/front_end/third_party/lighthouse/locales/vi.json +162 -147
- package/front_end/third_party/lighthouse/locales/zh-HK.json +150 -135
- package/front_end/third_party/lighthouse/locales/zh-TW.json +154 -139
- package/front_end/third_party/lighthouse/locales/zh.json +152 -137
- package/front_end/third_party/lighthouse/report/bundle.d.ts +9 -8
- package/front_end/third_party/lighthouse/report/bundle.js +10 -10
- package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +2 -7
- package/front_end/tsconfig.compatibility.json +1 -0
- package/front_end/tsconfig.json +3 -2
- package/front_end/ui/components/dialogs/TypeToAllowDialog.ts +0 -2
- package/front_end/ui/components/dialogs/typeToAllowDialog.css +0 -4
- package/front_end/ui/components/icon_button/fileSourceIcon.css +1 -1
- package/front_end/ui/components/input/textInput.css +1 -1
- package/front_end/ui/components/lists/List.ts +26 -14
- package/front_end/ui/components/menus/menus.ts +0 -2
- package/front_end/ui/components/suggestion_input/SuggestionInput.ts +351 -138
- package/front_end/ui/components/survey_link/surveyLink.css +3 -3
- package/front_end/ui/components/switch/switch.css +6 -6
- package/front_end/ui/components/text_editor/AiCodeCompletionTeaser.ts +2 -3
- package/front_end/ui/components/text_editor/TextEditor.ts +1 -1
- package/front_end/ui/components/tooltips/Tooltip.ts +53 -4
- package/front_end/ui/components/tree_outline/treeOutline.css +7 -7
- package/front_end/ui/helpers/OpenInNewTab.ts +8 -3
- package/front_end/ui/legacy/EmptyWidget.ts +4 -4
- package/front_end/ui/legacy/ForwardedInputEventHandler.ts +2 -2
- package/front_end/ui/legacy/GlassPane.ts +1 -1
- package/front_end/ui/legacy/KeyboardShortcut.ts +7 -7
- package/front_end/ui/legacy/RemoteDebuggingTerminatedScreen.ts +2 -2
- package/front_end/ui/legacy/TabbedPane.ts +198 -66
- package/front_end/ui/legacy/TargetCrashedScreen.ts +2 -2
- package/front_end/ui/legacy/UIUtils.ts +71 -68
- package/front_end/ui/legacy/View.ts +7 -4
- package/front_end/ui/legacy/ViewManager.ts +49 -37
- package/front_end/ui/legacy/Widget.ts +32 -12
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +2 -3
- package/front_end/ui/legacy/components/inline_editor/AnimationTimingUI.ts +8 -8
- package/front_end/ui/legacy/components/inline_editor/BezierUI.ts +8 -9
- package/front_end/ui/legacy/components/inline_editor/LinkSwatch.ts +2 -2
- package/front_end/ui/legacy/components/inline_editor/cssAngleEditor.css +1 -1
- package/front_end/ui/legacy/components/inline_editor/cssAngleSwatch.css +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +45 -11
- package/front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts +10 -12
- package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +102 -29
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +148 -122
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +20 -14
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +1 -1
- package/front_end/ui/legacy/components/source_frame/FontView.ts +29 -5
- package/front_end/ui/legacy/components/source_frame/ImageView.ts +79 -12
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +20 -2
- package/front_end/ui/legacy/components/source_frame/PreviewFactory.ts +2 -2
- package/front_end/ui/legacy/components/source_frame/StreamingContentHexView.ts +6 -10
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +11 -11
- package/front_end/ui/legacy/components/source_frame/fontView.css +7 -0
- package/front_end/ui/legacy/components/source_frame/imageView.css +7 -0
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +14 -3
- package/front_end/ui/legacy/components/utils/Linkifier.ts +126 -2
- package/front_end/ui/legacy/emptyWidget.css +2 -1
- package/front_end/ui/legacy/inspectorCommon.css +3 -3
- package/front_end/ui/legacy/smallBubble.css +1 -1
- package/front_end/ui/legacy/tabbedPane.css +6 -0
- package/front_end/ui/lit/Directives.ts +35 -18
- package/front_end/ui/lit/lit.ts +0 -2
- package/front_end/ui/lit/render.ts +0 -7
- package/front_end/ui/visual_logging/KnownContextValues.ts +5 -0
- package/package.json +1 -1
- package/vpython.toml +8 -0
- package/vpython.toml.uv.lock +3 -0
- package/.agents/skills/review-models-core/SKILL.md +0 -73
- package/.agents/skills/review-tests/SKILL.md +0 -67
- package/.agents/skills/review-ui-widgets/SKILL.md +0 -115
- package/front_end/generated/ARIAProperties.ts +0 -2686
- package/front_end/ui/components/menus/README.md +0 -119
- package/front_end/ui/components/menus/SelectMenu.ts +0 -473
- package/front_end/ui/components/menus/selectMenu.css +0 -54
- package/front_end/ui/components/menus/selectMenuButton.css +0 -108
|
@@ -1,16 +1,34 @@
|
|
|
1
1
|
// Copyright 2024 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
-
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
5
4
|
|
|
6
5
|
import * as Common from '../../../core/common/common.js';
|
|
6
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
7
7
|
import type * as Trace from '../../../models/trace/trace.js';
|
|
8
8
|
import * as UI from '../../../ui/legacy/legacy.js';
|
|
9
|
+
import {Directives, html, render} from '../../../ui/lit/lit.js';
|
|
9
10
|
|
|
10
11
|
import * as Insights from './insights/insights.js';
|
|
11
12
|
import {SidebarAnnotationsTab} from './SidebarAnnotationsTab.js';
|
|
12
13
|
import {SidebarInsightsTab} from './SidebarInsightsTab.js';
|
|
13
14
|
|
|
15
|
+
const {ifDefined} = Directives;
|
|
16
|
+
const {widget, widgetRef} = UI.Widget;
|
|
17
|
+
|
|
18
|
+
const UIStrings = {
|
|
19
|
+
/**
|
|
20
|
+
* @description Title of the Insights tab in the Performance panel sidebar.
|
|
21
|
+
*/
|
|
22
|
+
insights: 'Insights',
|
|
23
|
+
/**
|
|
24
|
+
* @description Title of the Annotations tab in the Performance panel sidebar.
|
|
25
|
+
*/
|
|
26
|
+
annotations: 'Annotations',
|
|
27
|
+
} as const;
|
|
28
|
+
|
|
29
|
+
const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/Sidebar.ts', UIStrings);
|
|
30
|
+
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
31
|
+
|
|
14
32
|
export interface ActiveInsight {
|
|
15
33
|
model: Trace.Insights.Types.InsightModel;
|
|
16
34
|
insightSetKey: string;
|
|
@@ -64,11 +82,88 @@ export const DEFAULT_SIDEBAR_TAB: SidebarTabs = SidebarTabs.INSIGHTS;
|
|
|
64
82
|
export const DEFAULT_SIDEBAR_WIDTH_PX = 240;
|
|
65
83
|
const MIN_SIDEBAR_WIDTH_PX = 170;
|
|
66
84
|
|
|
67
|
-
export
|
|
68
|
-
|
|
85
|
+
export interface ViewInput {
|
|
86
|
+
parsedTrace: Trace.TraceModel.ParsedTrace|null;
|
|
87
|
+
activeInsight: ActiveInsight|null;
|
|
88
|
+
annotations: Trace.Types.File.Annotation[];
|
|
89
|
+
annotationEntryToColorMap: Map<Trace.Types.Events.Event, string>;
|
|
90
|
+
annotationsBadge: string|null;
|
|
91
|
+
insightsTabEnabled: boolean;
|
|
92
|
+
selectedTabId: SidebarTabs;
|
|
93
|
+
onTabSelected: (tabId: SidebarTabs) => void;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface ViewOutput {
|
|
97
|
+
highlightActiveInsight?: () => void;
|
|
98
|
+
setActiveInsightSet?: (insightSetKey: string) => void;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export type View = (input: ViewInput, output: ViewOutput, target: HTMLElement) => void;
|
|
102
|
+
|
|
103
|
+
export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
104
|
+
// clang-format off
|
|
105
|
+
render(html`
|
|
106
|
+
<devtools-tabbed-pane
|
|
107
|
+
@select=${(event: CustomEvent<{tabId: string, isUserGesture?: boolean}>) => {
|
|
108
|
+
if (event.detail.isUserGesture) {
|
|
109
|
+
input.onTabSelected(event.detail.tabId as SidebarTabs);
|
|
110
|
+
}
|
|
111
|
+
}}>
|
|
112
|
+
<devtools-widget
|
|
113
|
+
id=${SidebarTabs.INSIGHTS}
|
|
114
|
+
label=${i18nString(UIStrings.insights)}
|
|
115
|
+
jslogcontext="timeline.insights-tab"
|
|
116
|
+
class="sidebar-insights"
|
|
117
|
+
?selected=${input.selectedTabId === SidebarTabs.INSIGHTS}
|
|
118
|
+
?disabled=${!input.insightsTabEnabled}
|
|
119
|
+
${widget(SidebarInsightsTab, {
|
|
120
|
+
parsedTrace: input.parsedTrace,
|
|
121
|
+
activeInsight: input.activeInsight,
|
|
122
|
+
})}
|
|
123
|
+
${widgetRef(SidebarInsightsTab, insightsTab => {
|
|
124
|
+
output.highlightActiveInsight = () => {
|
|
125
|
+
void insightsTab.updateComplete.then(() => {
|
|
126
|
+
insightsTab.highlightActiveInsight();
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
output.setActiveInsightSet = (insightSetKey: string) => {
|
|
130
|
+
insightsTab.setActiveInsightSet(insightSetKey);
|
|
131
|
+
};
|
|
132
|
+
})}>
|
|
133
|
+
</devtools-widget>
|
|
134
|
+
<devtools-widget
|
|
135
|
+
id=${SidebarTabs.ANNOTATIONS}
|
|
136
|
+
label=${i18nString(UIStrings.annotations)}
|
|
137
|
+
badge=${ifDefined(input.annotationsBadge ?? undefined)}
|
|
138
|
+
jslogcontext="timeline.annotations-tab"
|
|
139
|
+
class="sidebar-annotations"
|
|
140
|
+
?selected=${input.selectedTabId === SidebarTabs.ANNOTATIONS}
|
|
141
|
+
${widget(SidebarAnnotationsTab, {
|
|
142
|
+
annotations: input.annotations,
|
|
143
|
+
annotationEntryToColorMap: input.annotationEntryToColorMap,
|
|
144
|
+
})}>
|
|
145
|
+
</devtools-widget>
|
|
146
|
+
</devtools-tabbed-pane>
|
|
147
|
+
`, target);
|
|
148
|
+
// clang-format on
|
|
149
|
+
};
|
|
69
150
|
|
|
70
|
-
|
|
71
|
-
#
|
|
151
|
+
export class SidebarWidget extends UI.Widget.VBox {
|
|
152
|
+
readonly #view: View;
|
|
153
|
+
readonly #viewOutput: ViewOutput = {};
|
|
154
|
+
#parsedTrace: Trace.TraceModel.ParsedTrace|null = null;
|
|
155
|
+
#activeInsight: ActiveInsight|null = null;
|
|
156
|
+
#annotations: Trace.Types.File.Annotation[] = [];
|
|
157
|
+
#annotationEntryToColorMap = new Map<Trace.Types.Events.Event, string>();
|
|
158
|
+
#annotationsBadge: string|null = null;
|
|
159
|
+
#selectedTabId: SidebarTabs = DEFAULT_SIDEBAR_TAB;
|
|
160
|
+
readonly #onTabSelectedBound = (tabId: SidebarTabs): void => {
|
|
161
|
+
if (this.#selectedTabId === tabId) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
this.#selectedTabId = tabId;
|
|
165
|
+
this.requestUpdate();
|
|
166
|
+
};
|
|
72
167
|
/**
|
|
73
168
|
* If the user has an Insight open and then they collapse the sidebar, we
|
|
74
169
|
* deactivate that Insight to avoid it showing overlays etc - as the user has
|
|
@@ -85,26 +180,36 @@ export class SidebarWidget extends UI.Widget.VBox {
|
|
|
85
180
|
#hasOpenedOnce =
|
|
86
181
|
Common.Settings.Settings.instance().createSetting<boolean>('timeline-sidebar-opened-at-least-once', false);
|
|
87
182
|
|
|
88
|
-
constructor() {
|
|
183
|
+
constructor(view: View = DEFAULT_VIEW) {
|
|
89
184
|
super();
|
|
185
|
+
this.#view = view;
|
|
90
186
|
this.setMinimumSize(MIN_SIDEBAR_WIDTH_PX, 0);
|
|
91
|
-
|
|
92
|
-
SidebarTabs.INSIGHTS, 'Insights', this.#insightsView, undefined, undefined, false, false, 0,
|
|
93
|
-
'timeline.insights-tab');
|
|
94
|
-
this.#tabbedPane.appendTab(
|
|
95
|
-
SidebarTabs.ANNOTATIONS, 'Annotations', this.#annotationsView, undefined, undefined, false, false, 1,
|
|
96
|
-
'timeline.annotations-tab');
|
|
187
|
+
}
|
|
97
188
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
189
|
+
#hasInsights(): boolean {
|
|
190
|
+
return Boolean(this.#parsedTrace?.insights && this.#parsedTrace.insights.size > 0);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
override performUpdate(): void {
|
|
194
|
+
this.#view(
|
|
195
|
+
{
|
|
196
|
+
parsedTrace: this.#parsedTrace,
|
|
197
|
+
activeInsight: this.#activeInsight,
|
|
198
|
+
annotations: this.#annotations,
|
|
199
|
+
annotationEntryToColorMap: this.#annotationEntryToColorMap,
|
|
200
|
+
annotationsBadge: this.#annotationsBadge,
|
|
201
|
+
insightsTabEnabled: this.#hasInsights(),
|
|
202
|
+
selectedTabId: this.#selectedTabId,
|
|
203
|
+
onTabSelected: this.#onTabSelectedBound,
|
|
204
|
+
},
|
|
205
|
+
this.#viewOutput,
|
|
206
|
+
this.contentElement,
|
|
207
|
+
);
|
|
101
208
|
}
|
|
102
209
|
|
|
103
210
|
override wasShown(): void {
|
|
104
211
|
super.wasShown();
|
|
105
212
|
this.#hasOpenedOnce.set(true);
|
|
106
|
-
this.#tabbedPane.show(this.element);
|
|
107
|
-
this.#updateAnnotationsCountBadge();
|
|
108
213
|
|
|
109
214
|
if (this.#insightToRestoreOnOpen) {
|
|
110
215
|
this.element.dispatchEvent(new Insights.SidebarInsight.InsightActivated(
|
|
@@ -117,15 +222,15 @@ export class SidebarWidget extends UI.Widget.VBox {
|
|
|
117
222
|
// Swap to the Annotations tab if:
|
|
118
223
|
// 1. Insights is currently selected.
|
|
119
224
|
// 2. The Insights tab is disabled (which means we have no insights for this trace)
|
|
120
|
-
if (this.#
|
|
121
|
-
|
|
122
|
-
this.#tabbedPane.selectTab(SidebarTabs.ANNOTATIONS);
|
|
225
|
+
if (this.#selectedTabId === SidebarTabs.INSIGHTS && !this.#hasInsights()) {
|
|
226
|
+
this.#selectedTabId = SidebarTabs.ANNOTATIONS;
|
|
123
227
|
}
|
|
228
|
+
this.requestUpdate();
|
|
124
229
|
}
|
|
125
230
|
|
|
126
231
|
override willHide(): void {
|
|
127
232
|
super.willHide();
|
|
128
|
-
const currentlyActiveInsight = this.#
|
|
233
|
+
const currentlyActiveInsight = this.#activeInsight;
|
|
129
234
|
this.#insightToRestoreOnOpen = currentlyActiveInsight;
|
|
130
235
|
|
|
131
236
|
if (currentlyActiveInsight) {
|
|
@@ -133,42 +238,56 @@ export class SidebarWidget extends UI.Widget.VBox {
|
|
|
133
238
|
}
|
|
134
239
|
}
|
|
135
240
|
|
|
136
|
-
setAnnotations(
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
this
|
|
241
|
+
setAnnotations(updatedAnnotations: Trace.Types.File.Annotation[],
|
|
242
|
+
annotationEntryToColorMap: Map<Trace.Types.Events.Event, string>): void {
|
|
243
|
+
if (this.#annotations === updatedAnnotations && this.#annotationEntryToColorMap === annotationEntryToColorMap) {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
this.#annotations = updatedAnnotations;
|
|
247
|
+
this.#annotationEntryToColorMap = annotationEntryToColorMap;
|
|
248
|
+
const deduplicatedAnnotations = SidebarAnnotationsTab.processAnnotationsList(updatedAnnotations);
|
|
249
|
+
this.#annotationsBadge = deduplicatedAnnotations.length > 0 ? deduplicatedAnnotations.length.toString() : null;
|
|
250
|
+
this.requestUpdate();
|
|
146
251
|
}
|
|
147
252
|
|
|
148
253
|
setParsedTrace(parsedTrace: Trace.TraceModel.ParsedTrace|null): void {
|
|
149
|
-
this.#
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
);
|
|
254
|
+
if (this.#parsedTrace === parsedTrace) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
this.#parsedTrace = parsedTrace;
|
|
258
|
+
this.requestUpdate();
|
|
154
259
|
}
|
|
155
260
|
|
|
156
261
|
setActiveInsight(activeInsight: ActiveInsight|null, opts: {
|
|
157
262
|
highlight: boolean,
|
|
158
263
|
}): void {
|
|
159
|
-
this.#
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
264
|
+
const tabChanged = Boolean(activeInsight && this.#selectedTabId !== SidebarTabs.INSIGHTS);
|
|
265
|
+
if (this.#activeInsight !== activeInsight || tabChanged) {
|
|
266
|
+
this.#activeInsight = activeInsight;
|
|
267
|
+
if (activeInsight) {
|
|
268
|
+
this.#selectedTabId = SidebarTabs.INSIGHTS;
|
|
269
|
+
}
|
|
270
|
+
this.requestUpdate();
|
|
271
|
+
}
|
|
272
|
+
if (opts.highlight && activeInsight) {
|
|
273
|
+
void this.updateComplete.then(() => {
|
|
274
|
+
this.#viewOutput.highlightActiveInsight?.();
|
|
275
|
+
});
|
|
163
276
|
}
|
|
164
277
|
}
|
|
165
278
|
|
|
166
279
|
openInsightsTab(): void {
|
|
167
|
-
this.#
|
|
280
|
+
if (this.#selectedTabId === SidebarTabs.INSIGHTS) {
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
this.#selectedTabId = SidebarTabs.INSIGHTS;
|
|
284
|
+
this.requestUpdate();
|
|
168
285
|
}
|
|
169
286
|
|
|
170
287
|
setActiveInsightSet(insightSetKey: string): void {
|
|
171
|
-
this
|
|
288
|
+
void this.updateComplete.then(() => {
|
|
289
|
+
this.#viewOutput.setActiveInsightSet?.(insightSetKey);
|
|
290
|
+
});
|
|
172
291
|
}
|
|
173
292
|
|
|
174
293
|
/**
|
|
@@ -182,70 +301,3 @@ export class SidebarWidget extends UI.Widget.VBox {
|
|
|
182
301
|
return this.#hasOpenedOnce.get();
|
|
183
302
|
}
|
|
184
303
|
}
|
|
185
|
-
|
|
186
|
-
class InsightsView extends UI.Widget.VBox {
|
|
187
|
-
#component = SidebarInsightsTab.createWidgetElement();
|
|
188
|
-
|
|
189
|
-
constructor() {
|
|
190
|
-
super();
|
|
191
|
-
this.element.classList.add('sidebar-insights');
|
|
192
|
-
this.#getWidget().show(this.element);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
#getWidget(): SidebarInsightsTab {
|
|
196
|
-
return UI.Widget.Widget.get(this.#component) as SidebarInsightsTab;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
setParsedTrace(parsedTrace: Trace.TraceModel.ParsedTrace|null): void {
|
|
200
|
-
const widget = this.#getWidget();
|
|
201
|
-
widget.parsedTrace = parsedTrace;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
getActiveInsight(): ActiveInsight|null {
|
|
205
|
-
return this.#getWidget().activeInsight;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
setActiveInsight(active: ActiveInsight|null, opts: {highlight: boolean}): void {
|
|
209
|
-
const widget = this.#getWidget();
|
|
210
|
-
|
|
211
|
-
widget.activeInsight = active;
|
|
212
|
-
if (opts.highlight && active) {
|
|
213
|
-
// Wait for the rendering of the component to be done, otherwise we
|
|
214
|
-
// might highlight the wrong insight. The UI needs to be fully
|
|
215
|
-
// re-rendered before we can highlight the newly-expanded insight.
|
|
216
|
-
void widget.updateComplete.then(() => {
|
|
217
|
-
void widget.highlightActiveInsight();
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
setActiveInsightSet(insightSetKey: string): void {
|
|
223
|
-
this.#getWidget().setActiveInsightSet(insightSetKey);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
class AnnotationsView extends UI.Widget.VBox {
|
|
228
|
-
#component = new SidebarAnnotationsTab();
|
|
229
|
-
|
|
230
|
-
constructor() {
|
|
231
|
-
super();
|
|
232
|
-
this.element.classList.add('sidebar-annotations');
|
|
233
|
-
this.#component.show(this.element);
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
setAnnotations(
|
|
237
|
-
annotations: Trace.Types.File.Annotation[],
|
|
238
|
-
annotationEntryToColorMap: Map<Trace.Types.Events.Event, string>): void {
|
|
239
|
-
this.#component.setData({annotations, annotationEntryToColorMap});
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* The component "de-duplicates" annotations to ensure implementation details
|
|
244
|
-
* about how we create pending annotations don't leak into the UI. We expose
|
|
245
|
-
* these here because we use this count to show the number of annotations in
|
|
246
|
-
* the small adorner in the sidebar tab.
|
|
247
|
-
*/
|
|
248
|
-
deduplicatedAnnotations(): readonly Trace.Types.File.Annotation[] {
|
|
249
|
-
return this.#component.deduplicatedAnnotations();
|
|
250
|
-
}
|
|
251
|
-
}
|
|
@@ -101,9 +101,10 @@ export interface SidebarAnnotationsTabViewInput {
|
|
|
101
101
|
onAnnotationHoverOut: () => void;
|
|
102
102
|
onAnnotationDelete: (annotation: Trace.Types.File.Annotation) => void;
|
|
103
103
|
}
|
|
104
|
-
export type View = (input: SidebarAnnotationsTabViewInput, output:
|
|
104
|
+
export type View = (input: SidebarAnnotationsTabViewInput, output: undefined, target: HTMLElement) => void;
|
|
105
105
|
|
|
106
106
|
export class SidebarAnnotationsTab extends UI.Widget.Widget {
|
|
107
|
+
#rawAnnotations: Trace.Types.File.Annotation[] = [];
|
|
107
108
|
#annotations: Trace.Types.File.Annotation[] = [];
|
|
108
109
|
// A map with annotated entries and the colours that are used to display them in the FlameChart.
|
|
109
110
|
// We need this map to display the entries in the sidebar with the same colours.
|
|
@@ -112,9 +113,9 @@ export class SidebarAnnotationsTab extends UI.Widget.Widget {
|
|
|
112
113
|
readonly #annotationsHiddenSetting: Common.Settings.Setting<boolean>;
|
|
113
114
|
#view: View;
|
|
114
115
|
|
|
115
|
-
constructor(view: View = DEFAULT_VIEW) {
|
|
116
|
-
super();
|
|
117
|
-
this.#view = view;
|
|
116
|
+
constructor(element?: HTMLElement|View, view: View = DEFAULT_VIEW) {
|
|
117
|
+
super(element instanceof HTMLElement ? element : undefined);
|
|
118
|
+
this.#view = typeof element === 'function' ? element : view;
|
|
118
119
|
this.#annotationsHiddenSetting =
|
|
119
120
|
Common.Settings.Settings.instance().resolve(SettingsUI.TimelineSettings.annotationsHiddenSettingDescriptor);
|
|
120
121
|
}
|
|
@@ -123,16 +124,36 @@ export class SidebarAnnotationsTab extends UI.Widget.Widget {
|
|
|
123
124
|
return this.#annotations;
|
|
124
125
|
}
|
|
125
126
|
|
|
127
|
+
set annotations(annotations: Trace.Types.File.Annotation[]) {
|
|
128
|
+
if (this.#rawAnnotations === annotations) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
this.#rawAnnotations = annotations;
|
|
132
|
+
this.#annotations = SidebarAnnotationsTab.processAnnotationsList(annotations);
|
|
133
|
+
this.requestUpdate();
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
set annotationEntryToColorMap(
|
|
137
|
+
annotationEntryToColorMap: Map<Trace.Types.Events.Event|Trace.Types.Events.LegacyTimelineFrame, string>,
|
|
138
|
+
) {
|
|
139
|
+
if (this.#annotationEntryToColorMap === annotationEntryToColorMap) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
this.#annotationEntryToColorMap = annotationEntryToColorMap;
|
|
143
|
+
this.requestUpdate();
|
|
144
|
+
}
|
|
145
|
+
|
|
126
146
|
setData(data: {
|
|
127
147
|
annotations: Trace.Types.File.Annotation[],
|
|
128
148
|
annotationEntryToColorMap: Map<Trace.Types.Events.Event, string>,
|
|
129
149
|
}): void {
|
|
130
|
-
this.#
|
|
150
|
+
this.#rawAnnotations = data.annotations;
|
|
151
|
+
this.#annotations = SidebarAnnotationsTab.processAnnotationsList(data.annotations);
|
|
131
152
|
this.#annotationEntryToColorMap = data.annotationEntryToColorMap;
|
|
132
153
|
this.requestUpdate();
|
|
133
154
|
}
|
|
134
155
|
|
|
135
|
-
|
|
156
|
+
static processAnnotationsList(annotations: Trace.Types.File.Annotation[]): Trace.Types.File.Annotation[] {
|
|
136
157
|
// When an entry is double-clicked, we create two annotations (a label and an entries connection) for the user to choose from.
|
|
137
158
|
// The one not selected is deleted when the user makes their selection.
|
|
138
159
|
// To avoid excessive activity in the sidebar (adding and removing annotations), only show one 'not started' annotation associated with an entry.
|
|
@@ -142,7 +163,7 @@ export class SidebarAnnotationsTab extends UI.Widget.Widget {
|
|
|
142
163
|
const entriesWithNotStartedAnnotation = new Set();
|
|
143
164
|
|
|
144
165
|
const processedAnnotations = annotations.filter(annotation => {
|
|
145
|
-
if (
|
|
166
|
+
if (SidebarAnnotationsTab.#isAnnotationCreationStarted(annotation)) {
|
|
146
167
|
return true;
|
|
147
168
|
}
|
|
148
169
|
|
|
@@ -161,14 +182,14 @@ export class SidebarAnnotationsTab extends UI.Widget.Widget {
|
|
|
161
182
|
|
|
162
183
|
// Sort annotations by timestamp.
|
|
163
184
|
processedAnnotations.sort(
|
|
164
|
-
(firstAnnotation, secondAnnotation) =>
|
|
165
|
-
|
|
185
|
+
(firstAnnotation, secondAnnotation) => SidebarAnnotationsTab.#getAnnotationTimestamp(firstAnnotation) -
|
|
186
|
+
SidebarAnnotationsTab.#getAnnotationTimestamp(secondAnnotation),
|
|
166
187
|
);
|
|
167
188
|
|
|
168
189
|
return processedAnnotations;
|
|
169
190
|
}
|
|
170
191
|
|
|
171
|
-
#getAnnotationTimestamp(annotation: Trace.Types.File.Annotation): Trace.Types.Timing.Micro {
|
|
192
|
+
static #getAnnotationTimestamp(annotation: Trace.Types.File.Annotation): Trace.Types.Timing.Micro {
|
|
172
193
|
switch (annotation.type) {
|
|
173
194
|
case 'ENTRY_LABEL': {
|
|
174
195
|
return annotation.entry.ts;
|
|
@@ -185,7 +206,7 @@ export class SidebarAnnotationsTab extends UI.Widget.Widget {
|
|
|
185
206
|
}
|
|
186
207
|
}
|
|
187
208
|
|
|
188
|
-
#isAnnotationCreationStarted(annotation: Trace.Types.File.Annotation): boolean {
|
|
209
|
+
static #isAnnotationCreationStarted(annotation: Trace.Types.File.Annotation): boolean {
|
|
189
210
|
// Consider the annotation not started if:
|
|
190
211
|
// ENTRY_LABEL - label is empty
|
|
191
212
|
// ENTRIES_LINK - the connection annotation does not have the 'to' entry
|
|
@@ -221,7 +242,7 @@ export class SidebarAnnotationsTab extends UI.Widget.Widget {
|
|
|
221
242
|
this.contentElement.dispatchEvent(new RemoveAnnotation(annotation));
|
|
222
243
|
},
|
|
223
244
|
};
|
|
224
|
-
this.#view(input,
|
|
245
|
+
this.#view(input, undefined, this.contentElement);
|
|
225
246
|
}
|
|
226
247
|
}
|
|
227
248
|
|
|
@@ -202,6 +202,9 @@ export class SidebarInsightsTab extends UI.Widget.Widget {
|
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
setActiveInsightSet(insightSetKey: string): void {
|
|
205
|
+
if (this.#selectedInsightSet?.id === insightSetKey) {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
205
208
|
if (this.#parsedTrace?.insights) {
|
|
206
209
|
const insightSet = this.#parsedTrace.insights.get(insightSetKey);
|
|
207
210
|
if (insightSet) {
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import * as i18n from '../../../../core/i18n/i18n.js';
|
|
6
6
|
import * as Trace from '../../../../models/trace/trace.js';
|
|
7
|
-
import * as uiI18n from '../../../../ui/i18n/i18n.js';
|
|
8
7
|
import * as UI from '../../../../ui/legacy/legacy.js';
|
|
9
8
|
import * as Lit from '../../../../ui/lit/lit.js';
|
|
10
9
|
|
|
@@ -16,7 +15,7 @@ const {widget} = UI.Widget;
|
|
|
16
15
|
|
|
17
16
|
const {UIStrings, i18nString, getImageData} = Trace.Insights.Models.LCPDiscovery;
|
|
18
17
|
|
|
19
|
-
const {html} = Lit;
|
|
18
|
+
const {html, i18nTemplate} = Lit;
|
|
20
19
|
|
|
21
20
|
// eslint-disable-next-line @devtools/l10n-filename-matches
|
|
22
21
|
const str_ = i18n.i18n.registerUIStrings('models/trace/insights/LCPDiscovery.ts', UIStrings);
|
|
@@ -45,7 +44,10 @@ export class LCPDiscovery extends BaseInsightComponent<Trace.Insights.Models.LCP
|
|
|
45
44
|
|
|
46
45
|
const timespanOverlaySection = overlays.find(overlay => overlay.type === 'TIMESPAN_BREAKDOWN')?.sections[0];
|
|
47
46
|
if (timespanOverlaySection) {
|
|
48
|
-
|
|
47
|
+
const label = this.#renderDiscoveryDelay(imageResults.discoveryDelay);
|
|
48
|
+
if (label !== Lit.nothing) {
|
|
49
|
+
timespanOverlaySection.label = label;
|
|
50
|
+
}
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
return overlays;
|
|
@@ -59,14 +61,12 @@ export class LCPDiscovery extends BaseInsightComponent<Trace.Insights.Models.LCP
|
|
|
59
61
|
return getImageData(this.model)?.estimatedSavings ?? null;
|
|
60
62
|
}
|
|
61
63
|
|
|
62
|
-
#renderDiscoveryDelay(delay: Trace.Types.Timing.Micro):
|
|
63
|
-
//
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return uiI18n.getFormatLocalizedString(str_, UIStrings.lcpLoadDelay, {PH1: timeWrapper});
|
|
69
|
-
/* eslint-enable @devtools/no-imperative-dom-api */
|
|
64
|
+
#renderDiscoveryDelay(delay: Trace.Types.Timing.Micro): Lit.LitTemplate {
|
|
65
|
+
// clang-format off
|
|
66
|
+
const timeWrapper = html`<span class="discovery-time-ms">${
|
|
67
|
+
i18n.TimeUtilities.formatMicroSecondsAsMillisFixed(delay)}</span>`;
|
|
68
|
+
// clang-format on
|
|
69
|
+
return i18nTemplate(str_, UIStrings.lcpLoadDelay, {PH1: timeWrapper});
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
override renderContent(): Lit.LitTemplate {
|
|
@@ -30,7 +30,7 @@ export class SlowCSSSelector extends
|
|
|
30
30
|
return true;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
async #toSourceFileLocation(cssModel: SDK.CSSModel.CSSModel, selector: Trace.Types.Events.SelectorTiming):
|
|
34
34
|
Promise<Linkifier.Linkifier.LinkifierData[]|undefined> {
|
|
35
35
|
if (!cssModel) {
|
|
36
36
|
return undefined;
|
|
@@ -65,9 +65,8 @@ export class SlowCSSSelector extends
|
|
|
65
65
|
return locations;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
selector: Trace.Types.Events.SelectorTiming): Promise<Lit.LitTemplate> {
|
|
68
|
+
async #getSelectorLinks(cssModel: SDK.CSSModel.CSSModel|null|undefined,
|
|
69
|
+
selector: Trace.Types.Events.SelectorTiming): Promise<Lit.LitTemplate> {
|
|
71
70
|
if (!cssModel) {
|
|
72
71
|
return Lit.nothing;
|
|
73
72
|
}
|
|
@@ -76,7 +75,7 @@ export class SlowCSSSelector extends
|
|
|
76
75
|
return Lit.nothing;
|
|
77
76
|
}
|
|
78
77
|
|
|
79
|
-
const locations = await this
|
|
78
|
+
const locations = await this.#toSourceFileLocation(cssModel, selector);
|
|
80
79
|
if (!locations) {
|
|
81
80
|
return Lit.nothing;
|
|
82
81
|
}
|
|
@@ -131,7 +130,7 @@ export class SlowCSSSelector extends
|
|
|
131
130
|
insight: this,
|
|
132
131
|
headers: [`${i18nString(UIStrings.topSelectorElapsedTime)}: ${time(Trace.Types.Timing.Micro(selector['elapsed (us)']))}`],
|
|
133
132
|
rows: [{
|
|
134
|
-
values: [html`${selector.selector} ${Lit.Directives.until(this
|
|
133
|
+
values: [html`${selector.selector} ${Lit.Directives.until(this.#getSelectorLinks(cssModel, selector))}`]}],
|
|
135
134
|
}})}
|
|
136
135
|
</div>
|
|
137
136
|
`);
|
|
@@ -148,7 +147,7 @@ export class SlowCSSSelector extends
|
|
|
148
147
|
insight: this,
|
|
149
148
|
headers: [`${i18nString(UIStrings.topSelectorMatchAttempt)}: ${selector['match_attempts']}`],
|
|
150
149
|
rows: [{
|
|
151
|
-
values: [html`${selector.selector} ${Lit.Directives.until(this
|
|
150
|
+
values: [html`${selector.selector} ${Lit.Directives.until(this.#getSelectorLinks(cssModel, selector))}` as unknown as string],
|
|
152
151
|
}],
|
|
153
152
|
}})}
|
|
154
153
|
</div>
|
|
@@ -2,30 +2,32 @@
|
|
|
2
2
|
* Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
* found in the LICENSE file. */
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
@scope to (devtools-widget > *) {
|
|
6
|
+
:scope {
|
|
7
|
+
display: flex;
|
|
8
|
+
}
|
|
8
9
|
|
|
9
|
-
.container {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
10
|
+
.container {
|
|
11
|
+
display: flex;
|
|
12
|
+
width: 100%;
|
|
13
|
+
height: 150px;
|
|
14
|
+
background-color: var(--sys-color-cdt-base-container);
|
|
15
|
+
border-radius: var(--sys-shape-corner-small);
|
|
16
|
+
border: var(--sys-size-1) solid var(--sys-color-divider);
|
|
17
|
+
}
|
|
17
18
|
|
|
18
|
-
.container canvas {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
19
|
+
.container canvas {
|
|
20
|
+
/* stylelint-disable-next-line declaration-no-important */
|
|
21
|
+
pointer-events: none !important;
|
|
22
|
+
}
|
|
22
23
|
|
|
23
|
-
.flex-auto {
|
|
24
|
-
|
|
25
|
-
}
|
|
24
|
+
.flex-auto {
|
|
25
|
+
flex: auto;
|
|
26
|
+
}
|
|
26
27
|
|
|
27
|
-
.vbox {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
.vbox {
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
position: relative;
|
|
32
|
+
}
|
|
31
33
|
}
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
background-color: var(--sys-color-surface2);
|
|
30
30
|
border-bottom: var(--sys-size-1) solid var(--sys-color-divider);
|
|
31
31
|
overflow: hidden;
|
|
32
|
-
padding: var(--sys-size-2)
|
|
32
|
+
padding: var(--sys-size-2) var(--sys-size-3);
|
|
33
33
|
text-overflow: ellipsis;
|
|
34
34
|
white-space: nowrap;
|
|
35
35
|
font: var(--sys-typescale-body4-medium);
|
|
@@ -35,7 +35,7 @@ const renderSection =
|
|
|
35
35
|
const labelText = section.label instanceof HTMLElement ? (section.label.textContent || '') :
|
|
36
36
|
typeof section.label === 'string' ? section.label :
|
|
37
37
|
'';
|
|
38
|
-
const tooltip = durationText ? `${durationText} ${labelText}` : labelText;
|
|
38
|
+
const tooltip = labelText ? (durationText ? `${durationText} ${labelText}` : labelText) : '';
|
|
39
39
|
|
|
40
40
|
// clang-format off
|
|
41
41
|
return html`
|
|
@@ -151,6 +151,20 @@ export class TimespanBreakdownOverlay extends UI.Widget.Widget {
|
|
|
151
151
|
return;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
+
for (const section of sections) {
|
|
155
|
+
const label = section.querySelector<HTMLElement>('.timespan-breakdown-overlay-label');
|
|
156
|
+
if (!label) {
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
if (!section.title) {
|
|
160
|
+
const durationText = label.querySelector('.duration-text')?.textContent ?? '';
|
|
161
|
+
const labelText = label.querySelector('.section-label-text')?.textContent ?? '';
|
|
162
|
+
section.title = durationText && labelText ? `${durationText} ${labelText}` : durationText || labelText;
|
|
163
|
+
}
|
|
164
|
+
label.classList.remove('labelHidden', 'labelTruncated', 'offScreenLeft', 'offScreenRight');
|
|
165
|
+
label.style.marginLeft = '';
|
|
166
|
+
}
|
|
167
|
+
|
|
154
168
|
if (!this.#canvasRect) {
|
|
155
169
|
return;
|
|
156
170
|
}
|
|
@@ -161,15 +175,6 @@ export class TimespanBreakdownOverlay extends UI.Widget.Widget {
|
|
|
161
175
|
// consistent on both edges of the UI.
|
|
162
176
|
const paddingForScrollbar = 9;
|
|
163
177
|
|
|
164
|
-
for (const section of sections) {
|
|
165
|
-
const label = section.querySelector<HTMLElement>('.timespan-breakdown-overlay-label');
|
|
166
|
-
if (!label) {
|
|
167
|
-
continue;
|
|
168
|
-
}
|
|
169
|
-
label.classList.remove('labelHidden', 'labelTruncated', 'offScreenLeft', 'offScreenRight');
|
|
170
|
-
label.style.marginLeft = '';
|
|
171
|
-
}
|
|
172
|
-
|
|
173
178
|
// Fetch the rects for each section and label now, rather than in the loop,
|
|
174
179
|
// to avoid causing a bunch of recalcStyles
|
|
175
180
|
const sectionLayoutData = new Map<HTMLElement, {sectionRect: DOMRect, labelRect: DOMRect, label: HTMLElement}>();
|