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
|
@@ -94,14 +94,55 @@
|
|
|
94
94
|
background-color: var(--sys-color-state-ripple-neutral-on-subtle);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
.
|
|
97
|
+
/* Queued and sent threads share a single scroll area below the toolbar. */
|
|
98
|
+
.comments-scroll-container {
|
|
99
|
+
/* Offset parent for the sections, so their offsetTop is their scroll position. */
|
|
100
|
+
position: relative;
|
|
98
101
|
flex: 1;
|
|
102
|
+
min-height: 0;
|
|
99
103
|
overflow-y: auto;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/*
|
|
107
|
+
* Only as tall as its content, so the footer follows the last queued row
|
|
108
|
+
* when the queue fits in the panel.
|
|
109
|
+
*/
|
|
110
|
+
.comments-queued-section {
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-direction: column;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.comments-list {
|
|
100
116
|
margin: 0;
|
|
101
117
|
padding: 0;
|
|
102
118
|
list-style: none;
|
|
103
119
|
}
|
|
104
120
|
|
|
121
|
+
/* Extra space between the Send to Agent footer and the sent comments separator. */
|
|
122
|
+
.comments-sent-section {
|
|
123
|
+
margin-top: var(--sys-size-11);
|
|
124
|
+
/*
|
|
125
|
+
* At least as tall as the panel, so the sent comments can always be
|
|
126
|
+
* scrolled to the top of the drawer, even when the content above and the
|
|
127
|
+
* sent list itself are short.
|
|
128
|
+
*/
|
|
129
|
+
min-height: 100%;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/*
|
|
133
|
+
* Looks like a pane header, but only visually separates the queued comments
|
|
134
|
+
* (with their footer) from the comments already sent to the agent.
|
|
135
|
+
*/
|
|
136
|
+
.comments-sent-separator {
|
|
137
|
+
padding: var(--sys-size-3) var(--sys-size-5);
|
|
138
|
+
border-top: var(--sys-size-1) solid var(--sys-color-divider);
|
|
139
|
+
border-bottom: var(--sys-size-1) solid var(--sys-color-divider);
|
|
140
|
+
background-color: var(--sys-color-surface1);
|
|
141
|
+
color: var(--sys-color-on-surface-subtle);
|
|
142
|
+
font-size: var(--sys-typescale-body4-size);
|
|
143
|
+
line-height: var(--sys-typescale-body4-line-height);
|
|
144
|
+
}
|
|
145
|
+
|
|
105
146
|
.comment-thread-item {
|
|
106
147
|
display: flex;
|
|
107
148
|
align-items: center;
|
|
@@ -194,7 +235,8 @@
|
|
|
194
235
|
text-overflow: ellipsis;
|
|
195
236
|
}
|
|
196
237
|
|
|
197
|
-
.thread-status-working
|
|
238
|
+
.thread-status-working,
|
|
239
|
+
.thread-status-sent {
|
|
198
240
|
display: flex;
|
|
199
241
|
align-items: center;
|
|
200
242
|
gap: var(--sys-size-4);
|
|
@@ -205,25 +247,71 @@
|
|
|
205
247
|
white-space: nowrap;
|
|
206
248
|
}
|
|
207
249
|
|
|
250
|
+
.thread-status-sent {
|
|
251
|
+
gap: var(--sys-size-2);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.check-icon {
|
|
255
|
+
width: var(--sys-size-8);
|
|
256
|
+
height: var(--sys-size-8);
|
|
257
|
+
color: var(--sys-color-on-surface-subtle);
|
|
258
|
+
}
|
|
259
|
+
|
|
208
260
|
.comments-empty-state {
|
|
209
261
|
display: flex;
|
|
210
262
|
flex-direction: column;
|
|
211
263
|
align-items: center;
|
|
212
264
|
justify-content: center;
|
|
213
|
-
|
|
265
|
+
/* Fills the panel when there are no comments at all. */
|
|
266
|
+
flex: 1;
|
|
267
|
+
padding: var(--sys-size-13) var(--sys-size-8);
|
|
268
|
+
text-align: center;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.comments-empty-state-title {
|
|
272
|
+
margin-bottom: var(--sys-size-4);
|
|
273
|
+
color: var(--sys-color-on-surface);
|
|
274
|
+
font-size: var(--sys-typescale-headline5-size);
|
|
275
|
+
line-height: var(--sys-typescale-headline5-line-height);
|
|
276
|
+
font-weight: var(--ref-typeface-weight-medium);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.comments-empty-state-description {
|
|
280
|
+
max-width: var(--sys-size-29);
|
|
214
281
|
color: var(--sys-color-on-surface-subtle);
|
|
215
282
|
font-size: var(--sys-typescale-body3-size);
|
|
216
|
-
|
|
217
|
-
text-
|
|
283
|
+
line-height: var(--sys-typescale-body3-line-height);
|
|
284
|
+
text-wrap: balance;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.comments-empty-state-icon {
|
|
288
|
+
width: var(--sys-size-8);
|
|
289
|
+
height: var(--sys-size-8);
|
|
290
|
+
vertical-align: text-bottom;
|
|
291
|
+
color: var(--sys-color-on-surface-subtle);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.comments-empty-state-link {
|
|
295
|
+
margin-top: var(--sys-size-3);
|
|
218
296
|
}
|
|
219
297
|
|
|
298
|
+
/*
|
|
299
|
+
* Sticks to the bottom of the panel while the queued rows overflow it, and
|
|
300
|
+
* scrolls up with the end of the queued section once the sent rows are reached.
|
|
301
|
+
*/
|
|
220
302
|
.comments-footer {
|
|
303
|
+
position: sticky;
|
|
304
|
+
bottom: 0;
|
|
305
|
+
z-index: 1;
|
|
221
306
|
display: flex;
|
|
222
307
|
align-items: center;
|
|
223
308
|
justify-content: flex-end;
|
|
224
309
|
gap: var(--sys-size-5);
|
|
310
|
+
/* Overlap the last queued row's bottom border so only a single divider is shown. */
|
|
311
|
+
margin-top: calc(-1 * var(--sys-size-1));
|
|
225
312
|
padding: var(--sys-size-5) var(--sys-size-8);
|
|
226
313
|
border-top: var(--sys-size-1) solid var(--sys-color-divider);
|
|
314
|
+
background-color: var(--sys-color-cdt-base-container);
|
|
227
315
|
flex-shrink: 0;
|
|
228
316
|
}
|
|
229
317
|
|
|
@@ -253,11 +341,4 @@
|
|
|
253
341
|
background-color: var(--sys-color-primary-bright);
|
|
254
342
|
box-shadow: var(--sys-elevation-level1);
|
|
255
343
|
}
|
|
256
|
-
|
|
257
|
-
.send-agent-button:disabled {
|
|
258
|
-
background-color: var(--sys-color-state-disabled-container);
|
|
259
|
-
color: var(--sys-color-state-disabled);
|
|
260
|
-
cursor: default;
|
|
261
|
-
box-shadow: none;
|
|
262
|
-
}
|
|
263
344
|
}
|
|
@@ -2,8 +2,10 @@
|
|
|
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
|
+
import '../../ui/components/spinners/spinners.js';
|
|
5
6
|
import '../../ui/components/tooltips/tooltips.js';
|
|
6
7
|
|
|
8
|
+
import * as Host from '../../core/host/host.js';
|
|
7
9
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
8
10
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
9
11
|
import type * as Protocol from '../../generated/protocol.js';
|
|
@@ -37,6 +39,11 @@ const UIStrings = {
|
|
|
37
39
|
* to the agent.
|
|
38
40
|
*/
|
|
39
41
|
sentCheckmark: 'Sent checkmark',
|
|
42
|
+
/**
|
|
43
|
+
* @description Text next to a spinner in the comment thread header indicating that the agent has picked up the
|
|
44
|
+
* comments and is working on them.
|
|
45
|
+
*/
|
|
46
|
+
working: 'Working',
|
|
40
47
|
/**
|
|
41
48
|
* @description Label for the agent response section in the comment thread.
|
|
42
49
|
*/
|
|
@@ -58,6 +65,17 @@ const UIStrings = {
|
|
|
58
65
|
* @description aria-label for the comment text area.
|
|
59
66
|
*/
|
|
60
67
|
commentInputAriaLabel: 'Comment input',
|
|
68
|
+
/**
|
|
69
|
+
* @description Placeholder text for the comment text area, explaining the keyboard shortcut that queues a comment
|
|
70
|
+
* (saves it locally so it is sent to the agent together with the next comment).
|
|
71
|
+
* @example {Ctrl} PH1
|
|
72
|
+
*/
|
|
73
|
+
queueCommentsPlaceholder: '{PH1} + \u21b5 to queue comments',
|
|
74
|
+
/**
|
|
75
|
+
* @description Banner text shown at the bottom of a comment thread when the element the comment was
|
|
76
|
+
* attached to has been removed and can no longer be found.
|
|
77
|
+
*/
|
|
78
|
+
elementNoLongerAvailable: 'The element is no longer available',
|
|
61
79
|
} as const;
|
|
62
80
|
|
|
63
81
|
const UIStringsNotTranslate = {
|
|
@@ -84,10 +102,16 @@ export interface ViewInput {
|
|
|
84
102
|
title: Title;
|
|
85
103
|
comments: CommentManager.CommentManager.Comment[];
|
|
86
104
|
commentText: string;
|
|
105
|
+
/** Placeholder for the comment text area, including the platform-specific queue shortcut. */
|
|
106
|
+
placeholder: string;
|
|
87
107
|
/** Whether Cmd (Mac) or Ctrl (other platforms) is currently held, switching submit to "queue". */
|
|
88
108
|
isQueueModifierPressed: boolean;
|
|
109
|
+
/** True when the element the thread is anchored to has been removed. */
|
|
110
|
+
elementRemoved: boolean;
|
|
89
111
|
textAreaRef: Lit.Directives.Ref<HTMLTextAreaElement>;
|
|
90
112
|
status: CommentManager.CommentManager.CommentThreadStatus;
|
|
113
|
+
/** Whether the thread has been taken by the agent. */
|
|
114
|
+
transmitted: boolean;
|
|
91
115
|
isEditing: boolean;
|
|
92
116
|
onAddComment: (text: string) => void;
|
|
93
117
|
onQueueComment: (text: string) => void;
|
|
@@ -133,6 +157,16 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: ViewOutput, target: HTML
|
|
|
133
157
|
|
|
134
158
|
switch (input.status) {
|
|
135
159
|
case 'SENT_TO_AGENT':
|
|
160
|
+
if (input.transmitted) {
|
|
161
|
+
// clang-format off
|
|
162
|
+
return html`
|
|
163
|
+
<div class="working-status">
|
|
164
|
+
<devtools-spinner></devtools-spinner>
|
|
165
|
+
<span>${i18nString(UIStrings.working)}</span>
|
|
166
|
+
</div>
|
|
167
|
+
`;
|
|
168
|
+
// clang-format on
|
|
169
|
+
}
|
|
136
170
|
// clang-format off
|
|
137
171
|
return html`
|
|
138
172
|
<div class="sent-status">
|
|
@@ -201,6 +235,7 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: ViewOutput, target: HTML
|
|
|
201
235
|
input.onQueueModifierChange(UI.KeyboardShortcut.KeyboardShortcut.eventHasCtrlEquivalentKey(event))}
|
|
202
236
|
@blur=${() => input.onQueueModifierChange(false)}
|
|
203
237
|
jslog=${VisualLogging.textField('comments-input').track({keydown: 'Enter'})}
|
|
238
|
+
placeholder=${input.placeholder}
|
|
204
239
|
></textarea>
|
|
205
240
|
<div class="footer">
|
|
206
241
|
<devtools-icon
|
|
@@ -250,6 +285,12 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: ViewOutput, target: HTML
|
|
|
250
285
|
</div>
|
|
251
286
|
`)}</div>
|
|
252
287
|
`}
|
|
288
|
+
|
|
289
|
+
${input.elementRemoved ? html`
|
|
290
|
+
<div class="element-removed-banner" role="status">
|
|
291
|
+
<span>${i18nString(UIStrings.elementNoLongerAvailable)}</span>
|
|
292
|
+
</div>
|
|
293
|
+
` : Lit.nothing}
|
|
253
294
|
</div>
|
|
254
295
|
`, target);
|
|
255
296
|
// clang-format on
|
|
@@ -262,7 +303,9 @@ export class CommentThreadWidget extends UI.Widget.Widget {
|
|
|
262
303
|
#comments: CommentManager.CommentManager.Comment[] = [];
|
|
263
304
|
#commentText = '';
|
|
264
305
|
#status: CommentManager.CommentManager.CommentThreadStatus = 'DRAFT';
|
|
306
|
+
#transmitted = false;
|
|
265
307
|
#isQueueModifierPressed = false;
|
|
308
|
+
#elementRemoved = false;
|
|
266
309
|
#textAreaRef = createRef<HTMLTextAreaElement>();
|
|
267
310
|
#view: View;
|
|
268
311
|
#isEditing: boolean = false;
|
|
@@ -300,6 +343,29 @@ export class CommentThreadWidget extends UI.Widget.Widget {
|
|
|
300
343
|
this.requestUpdate();
|
|
301
344
|
}
|
|
302
345
|
|
|
346
|
+
set transmitted(transmitted: boolean) {
|
|
347
|
+
if (this.#transmitted === transmitted) {
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
this.#transmitted = transmitted;
|
|
351
|
+
this.requestUpdate();
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* When true, shows a banner indicating that the element the thread is anchored to has been removed.
|
|
356
|
+
*/
|
|
357
|
+
set elementRemoved(elementRemoved: boolean) {
|
|
358
|
+
if (this.#elementRemoved === elementRemoved) {
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
this.#elementRemoved = elementRemoved;
|
|
362
|
+
this.requestUpdate();
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
get elementRemoved(): boolean {
|
|
366
|
+
return this.#elementRemoved;
|
|
367
|
+
}
|
|
368
|
+
|
|
303
369
|
#onSetEditMode = (value: boolean): void => {
|
|
304
370
|
const commentText = this.#comments.find(c => c.author === 'DEVELOPER')?.text;
|
|
305
371
|
|
|
@@ -358,9 +424,12 @@ export class CommentThreadWidget extends UI.Widget.Widget {
|
|
|
358
424
|
title: this.title,
|
|
359
425
|
comments: this.#comments,
|
|
360
426
|
commentText: this.#commentText,
|
|
427
|
+
placeholder: i18nString(UIStrings.queueCommentsPlaceholder, {PH1: Host.Platform.isMac() ? '⌘' : 'Ctrl'}),
|
|
361
428
|
isQueueModifierPressed: this.#isQueueModifierPressed,
|
|
429
|
+
elementRemoved: this.#elementRemoved,
|
|
362
430
|
textAreaRef: this.#textAreaRef,
|
|
363
431
|
status: this.#status,
|
|
432
|
+
transmitted: this.#transmitted,
|
|
364
433
|
onAddComment: this.#handleAddComment,
|
|
365
434
|
onQueueComment: this.#handleQueueComment,
|
|
366
435
|
onCommentTextChange: this.#handleCommentTextChange,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import type * as Common from '../../core/common/common.js';
|
|
6
|
+
import * as i18n from '../../core/i18n/i18n.js';
|
|
6
7
|
import * as Root from '../../core/root/root.js';
|
|
7
8
|
import * as CommentManager from '../../models/comment_manager/comment_manager.js';
|
|
8
9
|
import * as Comments from '../../ui/comments/comments.js';
|
|
@@ -12,6 +13,15 @@ import * as Lit from '../../ui/lit/lit.js';
|
|
|
12
13
|
import commentsOverlayStyles from './commentsOverlay.css.js';
|
|
13
14
|
import {CommentThreadWidget, computeCommentTitle, type Title} from './CommentThreadWidget.js';
|
|
14
15
|
|
|
16
|
+
const UIStrings = {
|
|
17
|
+
/**
|
|
18
|
+
* @description Context menu item that creates a comment anchored to the right-clicked part of the DevTools UI.
|
|
19
|
+
*/
|
|
20
|
+
addComment: 'Add comment',
|
|
21
|
+
} as const;
|
|
22
|
+
const str_ = i18n.i18n.registerUIStrings('panels/common/CommentsOverlayWidget.ts', UIStrings);
|
|
23
|
+
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
24
|
+
|
|
15
25
|
const {
|
|
16
26
|
html,
|
|
17
27
|
render,
|
|
@@ -122,11 +132,13 @@ const DEFAULT_VIEW: View = (input: ViewInput, _output: undefined, target: HTMLEl
|
|
|
122
132
|
title: input.title,
|
|
123
133
|
comments: [...item.thread.comments],
|
|
124
134
|
status: item.thread.status,
|
|
135
|
+
transmitted: item.thread.transmitted,
|
|
125
136
|
onAddComment: input.onAddComment,
|
|
126
137
|
onDeleteQueuedComment: input.onDeleteQueuedComment,
|
|
127
138
|
onQueueComment: input.onQueueComment,
|
|
128
139
|
onSaveEdit: input.onSaveEdit,
|
|
129
140
|
onStartEdit: input.onStartEdit,
|
|
141
|
+
elementRemoved: item.thread.isOrphaned,
|
|
130
142
|
})}
|
|
131
143
|
</div>
|
|
132
144
|
`;
|
|
@@ -169,7 +181,18 @@ export class CommentsOverlayWidget extends UI.Widget.Widget {
|
|
|
169
181
|
document.documentElement.removeEventListener('keydown', this.#onKeyDown);
|
|
170
182
|
document.documentElement.removeEventListener('click', this.#onClickOutside, {capture: true});
|
|
171
183
|
}
|
|
184
|
+
this.#markActiveThreadResponseSeen();
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* The open thread shows the agent response, so the developer has seen it.
|
|
190
|
+
*/
|
|
191
|
+
#markActiveThreadResponseSeen(): void {
|
|
192
|
+
if (!this.#activeThreadId) {
|
|
193
|
+
return;
|
|
172
194
|
}
|
|
195
|
+
this.#commentManager.getCommentThread(this.#activeThreadId)?.markResponseSeen();
|
|
173
196
|
}
|
|
174
197
|
|
|
175
198
|
constructor(
|
|
@@ -323,6 +346,8 @@ export class CommentsOverlayWidget extends UI.Widget.Widget {
|
|
|
323
346
|
|
|
324
347
|
#onStateChanged(): void {
|
|
325
348
|
this.#syncActiveThreadFromManager();
|
|
349
|
+
// The agent may respond while the thread is open.
|
|
350
|
+
this.#markActiveThreadResponseSeen();
|
|
326
351
|
this.requestUpdate();
|
|
327
352
|
}
|
|
328
353
|
|
|
@@ -509,6 +534,15 @@ export class CommentsOverlayWidget extends UI.Widget.Widget {
|
|
|
509
534
|
this.#fallbackPosition = fallbackPosition ?? null;
|
|
510
535
|
this.requestUpdate();
|
|
511
536
|
}
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* Opens a draft comment anchored to `element`. Comment mode must already be
|
|
540
|
+
* active.
|
|
541
|
+
* @returns whether a draft comment was created.
|
|
542
|
+
*/
|
|
543
|
+
addCommentAt(element: Element, coordinates?: {clientX: number, clientY: number}): boolean {
|
|
544
|
+
return this.#commentOverlayManager.handleElementClick(element, coordinates);
|
|
545
|
+
}
|
|
512
546
|
}
|
|
513
547
|
|
|
514
548
|
let widgetInstance: CommentsOverlayWidget|null = null;
|
|
@@ -546,6 +580,46 @@ export class ThreadRevealer implements Common.Revealer.Revealer<CommentManager.C
|
|
|
546
580
|
}
|
|
547
581
|
}
|
|
548
582
|
|
|
583
|
+
/**
|
|
584
|
+
* When entering comment mode with the drawer open, add the Comments tab to
|
|
585
|
+
* the drawer without selecting it or moving focus away from the page being
|
|
586
|
+
* commented on. When leaving comment mode, always open the drawer on the
|
|
587
|
+
* Comments tab, as checking the responses is the likely next step.
|
|
588
|
+
*/
|
|
589
|
+
function revealCommentsDrawerView(enteringCommentMode: boolean): void {
|
|
590
|
+
const viewManager = UI.ViewManager.ViewManager.instance();
|
|
591
|
+
if (!viewManager.hasView(COMMENTS_VIEW_ID)) {
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
if (enteringCommentMode) {
|
|
595
|
+
if (!UI.InspectorView.InspectorView.maybeGetInspectorViewInstance()?.drawerVisible()) {
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
void viewManager.resolveLocation(viewManager.locationNameForViewId(COMMENTS_VIEW_ID)).then(location => {
|
|
599
|
+
return location?.showView(viewManager.view(COMMENTS_VIEW_ID), undefined, false,
|
|
600
|
+
/* omitFocus */ true, /* shouldSelectTab */ false);
|
|
601
|
+
});
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
604
|
+
void viewManager.showView(COMMENTS_VIEW_ID, /* userGesture */ true);
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* Single entry point for comment mode changes requested by the user (toolbar
|
|
609
|
+
* toggle, shortcut, context menu): shows the overlay, updates the mode and
|
|
610
|
+
* reveals the Comments drawer tab. Changes not initiated by the user, such as
|
|
611
|
+
* the agent detaching, go directly through `CommentManager` and leave the
|
|
612
|
+
* drawer alone. The toggle button follows the mode in
|
|
613
|
+
* `CommentsOverlayWidget#onCommentModeChanged`.
|
|
614
|
+
*/
|
|
615
|
+
function setCommentModeByUser(commentManager: CommentManager.CommentManager.CommentManager, active: boolean): void {
|
|
616
|
+
getOrCreateOverlayWidget(commentManager);
|
|
617
|
+
if (commentManager.isCommentMode() !== active) {
|
|
618
|
+
commentManager.setCommentMode(active);
|
|
619
|
+
revealCommentsDrawerView(active);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
|
|
549
623
|
export class ActionDelegate implements UI.ActionRegistration.ActionDelegate {
|
|
550
624
|
readonly #commentManager: CommentManager.CommentManager.CommentManager;
|
|
551
625
|
|
|
@@ -561,40 +635,12 @@ export class ActionDelegate implements UI.ActionRegistration.ActionDelegate {
|
|
|
561
635
|
if (!this.#commentManager.isAgentAttached()) {
|
|
562
636
|
return false;
|
|
563
637
|
}
|
|
564
|
-
|
|
565
|
-
const enteringCommentMode = !this.#commentManager.isCommentMode();
|
|
566
|
-
this.#commentManager.setCommentMode(enteringCommentMode);
|
|
567
|
-
this.#revealCommentsView(enteringCommentMode);
|
|
638
|
+
setCommentModeByUser(this.#commentManager, !this.#commentManager.isCommentMode());
|
|
568
639
|
return true;
|
|
569
640
|
}
|
|
570
641
|
return false;
|
|
571
642
|
}
|
|
572
643
|
|
|
573
|
-
/**
|
|
574
|
-
* When entering comment mode with the drawer open, add the Comments tab to
|
|
575
|
-
* the drawer without selecting it or moving focus away from the page being
|
|
576
|
-
* commented on. When leaving comment mode, always open the drawer on the
|
|
577
|
-
* Comments tab, as checking the responses is the likely next step.
|
|
578
|
-
*/
|
|
579
|
-
#revealCommentsView(enteringCommentMode: boolean): void {
|
|
580
|
-
const viewManager = UI.ViewManager.ViewManager.instance();
|
|
581
|
-
if (!viewManager.hasView(COMMENTS_VIEW_ID)) {
|
|
582
|
-
return;
|
|
583
|
-
}
|
|
584
|
-
if (enteringCommentMode) {
|
|
585
|
-
if (!UI.InspectorView.InspectorView.maybeGetInspectorViewInstance()?.drawerVisible()) {
|
|
586
|
-
return;
|
|
587
|
-
}
|
|
588
|
-
void viewManager.resolveLocation(viewManager.locationNameForViewId(COMMENTS_VIEW_ID)).then(location => {
|
|
589
|
-
return location?.showView(viewManager.view(COMMENTS_VIEW_ID), /* insertBefore */ undefined,
|
|
590
|
-
/* userGesture */ false,
|
|
591
|
-
/* omitFocus */ true, /* shouldSelectTab */ false);
|
|
592
|
-
});
|
|
593
|
-
return;
|
|
594
|
-
}
|
|
595
|
-
void viewManager.showView(COMMENTS_VIEW_ID, /* userGesture */ true);
|
|
596
|
-
}
|
|
597
|
-
|
|
598
644
|
static resetForTest(): void {
|
|
599
645
|
if (widgetInstance) {
|
|
600
646
|
widgetInstance.detach();
|
|
@@ -603,6 +649,39 @@ export class ActionDelegate implements UI.ActionRegistration.ActionDelegate {
|
|
|
603
649
|
}
|
|
604
650
|
}
|
|
605
651
|
|
|
652
|
+
/**
|
|
653
|
+
* Menus that already have the "Add comment" item. A menu can have several
|
|
654
|
+
* `Node` targets, for example when a DataGrid row also appends its link
|
|
655
|
+
* element, and the provider is called once per target. The first target is
|
|
656
|
+
* the deepest element under the cursor, so only that one adds the item.
|
|
657
|
+
*/
|
|
658
|
+
const menusWithAddComment = new WeakSet<UI.ContextMenu.ContextMenu>();
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* Adds an "Add comment" item to the context menu of commentable regions while
|
|
662
|
+
* the comment mode toggle is available. Choosing it turns comment mode on and
|
|
663
|
+
* opens a draft comment on the right-clicked region.
|
|
664
|
+
*/
|
|
665
|
+
export class ContextMenuProvider implements UI.ContextMenu.Provider<Node> {
|
|
666
|
+
appendApplicableItems(event: Event, contextMenu: UI.ContextMenu.ContextMenu, target: Node): void {
|
|
667
|
+
if (menusWithAddComment.has(contextMenu) || !Root.Runtime.hostConfig.devToolsComments?.enabled ||
|
|
668
|
+
!(target instanceof HTMLElement) || !(event instanceof MouseEvent)) {
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
671
|
+
const commentManager = UI.Widget.lookupUniverseForElement(target)?.commentManager;
|
|
672
|
+
const coordinates = {clientX: event.clientX, clientY: event.clientY};
|
|
673
|
+
if (!commentManager?.isAgentAttached() ||
|
|
674
|
+
!Comments.CommentAnchorResolver.resolveCommentAnchorElement(target, coordinates)) {
|
|
675
|
+
return;
|
|
676
|
+
}
|
|
677
|
+
menusWithAddComment.add(contextMenu);
|
|
678
|
+
contextMenu.annotationSection().appendItem(i18nString(UIStrings.addComment), () => {
|
|
679
|
+
setCommentModeByUser(commentManager, true);
|
|
680
|
+
getOrCreateOverlayWidget(commentManager).addCommentAt(target, coordinates);
|
|
681
|
+
}, {jslogContext: 'add-comment'});
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
|
|
606
685
|
export class ButtonProvider implements UI.Toolbar.Provider {
|
|
607
686
|
readonly #button: UI.Toolbar.ToolbarButton;
|
|
608
687
|
readonly #commentManager: CommentManager.CommentManager.CommentManager;
|
|
@@ -10,10 +10,15 @@ import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
|
10
10
|
|
|
11
11
|
const UIStrings = {
|
|
12
12
|
/**
|
|
13
|
-
* @description Button text for the comments status bar pill
|
|
13
|
+
* @description Button text for the comments status bar pill. Clicking it opens the Comments panel.
|
|
14
|
+
*/
|
|
15
|
+
showComments: 'Show comments',
|
|
16
|
+
/**
|
|
17
|
+
* @description Button text for the comments status bar pill when the AI agent has responded to some
|
|
18
|
+
* comments and the user has not seen these responses yet. Clicking it opens the Comments panel.
|
|
14
19
|
* @example {2} PH1
|
|
15
20
|
*/
|
|
16
|
-
|
|
21
|
+
showCommentsWithCount: 'Show comments ({PH1})',
|
|
17
22
|
} as const;
|
|
18
23
|
const str_ = i18n.i18n.registerUIStrings('panels/common/CommentsStatusBarPill.ts', UIStrings);
|
|
19
24
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
@@ -22,6 +27,8 @@ const {html, render} = Lit;
|
|
|
22
27
|
|
|
23
28
|
export interface ViewInput {
|
|
24
29
|
threads: CommentManager.CommentManager.CommentThread[];
|
|
30
|
+
/** Number of threads with an agent response that the user has not seen yet. */
|
|
31
|
+
unseenResponseCount: number;
|
|
25
32
|
onPillClick: () => void;
|
|
26
33
|
disabled?: boolean;
|
|
27
34
|
}
|
|
@@ -39,7 +46,9 @@ export const DEFAULT_VIEW: View = (input: ViewInput, _output: undefined, target:
|
|
|
39
46
|
?disabled=${input.disabled}
|
|
40
47
|
@click=${input.onPillClick}
|
|
41
48
|
jslog=${VisualLogging.action('comments-status-bar-pill').track({click: true})}>
|
|
42
|
-
${
|
|
49
|
+
${input.unseenResponseCount > 0 ?
|
|
50
|
+
i18nString(UIStrings.showCommentsWithCount, {PH1: input.unseenResponseCount}) :
|
|
51
|
+
i18nString(UIStrings.showComments)}
|
|
43
52
|
</button>
|
|
44
53
|
`}
|
|
45
54
|
`, target);
|
|
@@ -97,10 +106,12 @@ export class CommentsStatusBarPill extends UI.Widget.Widget {
|
|
|
97
106
|
}
|
|
98
107
|
|
|
99
108
|
override performUpdate(): void {
|
|
109
|
+
const threads = this.#commentManager.isAgentAttached() ?
|
|
110
|
+
this.#commentManager.getCommentThreads().filter(thread => thread.status !== 'DRAFT') :
|
|
111
|
+
[];
|
|
100
112
|
const viewInput: ViewInput = {
|
|
101
|
-
threads
|
|
102
|
-
|
|
103
|
-
[],
|
|
113
|
+
threads,
|
|
114
|
+
unseenResponseCount: threads.filter(thread => thread.status === 'RESOLVED' && !thread.responseSeen).length,
|
|
104
115
|
onPillClick: this.#handlePillClick,
|
|
105
116
|
};
|
|
106
117
|
this.#view(viewInput, undefined, this.contentElement);
|
|
@@ -52,7 +52,7 @@ interface ViewInput {
|
|
|
52
52
|
onMouseLeave: () => void;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
export type View = (input: ViewInput, output:
|
|
55
|
+
export type View = (input: ViewInput, output: undefined, target: HTMLElement) => void;
|
|
56
56
|
|
|
57
57
|
const DEFAULT_VIEW: View = (input, _output, target: HTMLElement) => {
|
|
58
58
|
// clang-format off
|
|
@@ -139,7 +139,7 @@ export class DOMNodeLink extends UI.Widget.Widget {
|
|
|
139
139
|
ariaDescription: options.ariaDescription,
|
|
140
140
|
};
|
|
141
141
|
if (!this.#node) {
|
|
142
|
-
this.#view(viewInput,
|
|
142
|
+
this.#view(viewInput, undefined, this.contentElement);
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
145
|
|
|
@@ -154,13 +154,13 @@ export class DOMNodeLink extends UI.Widget.Widget {
|
|
|
154
154
|
// they always have the same ancestor. See crbug.com/340633630.
|
|
155
155
|
if (node.isViewTransitionPseudoNode()) {
|
|
156
156
|
viewInput.pseudo = `::${this.#node.pseudoType()}(${this.#node.pseudoIdentifier()})`;
|
|
157
|
-
this.#view(viewInput,
|
|
157
|
+
this.#view(viewInput, undefined, this.contentElement);
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
if (options.textContent) {
|
|
162
162
|
viewInput.tagName = options.textContent;
|
|
163
|
-
this.#view(viewInput,
|
|
163
|
+
this.#view(viewInput, undefined, this.contentElement);
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
166
|
|
|
@@ -193,16 +193,17 @@ export class DOMNodeLink extends UI.Widget.Widget {
|
|
|
193
193
|
}
|
|
194
194
|
viewInput.pseudo = pseudoText;
|
|
195
195
|
}
|
|
196
|
-
this.#view(viewInput,
|
|
196
|
+
this.#view(viewInput, undefined, this.contentElement);
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
interface DeferredViewInput {
|
|
201
201
|
preventKeyboardFocus?: boolean;
|
|
202
|
+
textContent?: string;
|
|
202
203
|
onClick: () => void;
|
|
203
204
|
}
|
|
204
205
|
|
|
205
|
-
type DeferredView = (input: DeferredViewInput, output:
|
|
206
|
+
type DeferredView = (input: DeferredViewInput, output: undefined, target: HTMLElement) => void;
|
|
206
207
|
|
|
207
208
|
const DEFERRED_DEFAULT_VIEW: DeferredView = (input, _output, target: HTMLElement) => {
|
|
208
209
|
// clang-format off
|
|
@@ -213,7 +214,7 @@ const DEFERRED_DEFAULT_VIEW: DeferredView = (input, _output, target: HTMLElement
|
|
|
213
214
|
tabindex=${input.preventKeyboardFocus ? -1 : 0}
|
|
214
215
|
@click=${input.onClick}
|
|
215
216
|
@mousedown=${(e: Event) => e.consume()}>
|
|
216
|
-
<slot
|
|
217
|
+
<slot>${input.textContent ?? nothing}</slot>
|
|
217
218
|
</button>`, target);
|
|
218
219
|
// clang-format on
|
|
219
220
|
};
|
|
@@ -224,9 +225,8 @@ export class DeferredDOMNodeLink extends UI.Widget.Widget {
|
|
|
224
225
|
#styleSheetId: Protocol.DOM.StyleSheetId|undefined = undefined;
|
|
225
226
|
#view: DeferredView;
|
|
226
227
|
|
|
227
|
-
constructor(
|
|
228
|
-
|
|
229
|
-
styleSheetId?: Protocol.DOM.StyleSheetId, view: DeferredView = DEFERRED_DEFAULT_VIEW) {
|
|
228
|
+
constructor(element?: HTMLElement, deferredNode?: SDK.DOMModel.DeferredDOMNode, options?: Options,
|
|
229
|
+
styleSheetId?: Protocol.DOM.StyleSheetId, view: DeferredView = DEFERRED_DEFAULT_VIEW) {
|
|
230
230
|
super(element, {useShadowDom: true});
|
|
231
231
|
this.element.classList.remove('vbox');
|
|
232
232
|
this.#deferredNode = deferredNode;
|
|
@@ -236,9 +236,34 @@ export class DeferredDOMNodeLink extends UI.Widget.Widget {
|
|
|
236
236
|
this.performUpdate();
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
+
set deferredNode(deferredNode: SDK.DOMModel.DeferredDOMNode|undefined) {
|
|
240
|
+
if (this.#deferredNode === deferredNode) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
this.#deferredNode = deferredNode;
|
|
244
|
+
this.requestUpdate();
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
set options(options: Options|undefined) {
|
|
248
|
+
if (this.#options === options) {
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
this.#options = options;
|
|
252
|
+
this.requestUpdate();
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
set styleSheetId(styleSheetId: Protocol.DOM.StyleSheetId|undefined) {
|
|
256
|
+
if (this.#styleSheetId === styleSheetId) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
this.#styleSheetId = styleSheetId;
|
|
260
|
+
this.requestUpdate();
|
|
261
|
+
}
|
|
262
|
+
|
|
239
263
|
override performUpdate(): void {
|
|
240
|
-
const viewInput = {
|
|
264
|
+
const viewInput: DeferredViewInput = {
|
|
241
265
|
preventKeyboardFocus: this.#options?.preventKeyboardFocus,
|
|
266
|
+
textContent: this.#options?.textContent,
|
|
242
267
|
onClick: () => {
|
|
243
268
|
this.#deferredNode?.resolve?.(node => {
|
|
244
269
|
if (node && this.#styleSheetId) {
|
|
@@ -255,7 +280,7 @@ export class DeferredDOMNodeLink extends UI.Widget.Widget {
|
|
|
255
280
|
});
|
|
256
281
|
},
|
|
257
282
|
};
|
|
258
|
-
this.#view(viewInput,
|
|
283
|
+
this.#view(viewInput, undefined, this.contentElement);
|
|
259
284
|
}
|
|
260
285
|
}
|
|
261
286
|
|