chrome-devtools-frontend 1.0.1675430 → 1.0.1676824
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/WATCHLISTS +0 -4
- package/front_end/core/common/Settings.ts +0 -66
- package/front_end/core/root/Runtime.ts +0 -5
- package/front_end/core/sdk/CSSMetadata.ts +5 -9
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +8 -28
- package/front_end/core/sdk/DebuggerModel.ts +50 -30
- package/front_end/core/sdk/ResourceTreeModel.ts +20 -1
- package/front_end/core/sdk/Script.ts +9 -53
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +213 -23
- package/front_end/entrypoints/main/MainImpl.ts +31 -0
- package/front_end/generated/InspectorBackendCommands.ts +3 -1
- package/front_end/generated/SupportedCSSProperties.ts +21 -4
- package/front_end/generated/protocol-mapping.d.ts +14 -0
- package/front_end/generated/protocol-proxy-api.d.ts +10 -0
- package/front_end/generated/protocol.ts +35 -0
- package/front_end/models/ai_assistance/AiAgent2.ts +11 -0
- package/front_end/models/ai_assistance/AiConversation.ts +22 -5
- package/front_end/models/ai_assistance/README.md +52 -26
- package/front_end/models/ai_assistance/agents/AiAgent.ts +54 -8
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +1 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +7 -194
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +8 -87
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -1
- package/front_end/models/ai_assistance/ai_assistance.ts +16 -0
- package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +124 -0
- package/front_end/models/ai_assistance/contexts/StorageContext.ts +111 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +69 -1
- package/front_end/models/ai_assistance/skills/README.md +63 -1
- package/front_end/models/ai_assistance/skills/Skill.ts +1 -1
- package/front_end/models/ai_assistance/skills/SkillRegistry.ts +4 -0
- package/front_end/models/ai_assistance/skills/performance.md +8 -0
- package/front_end/models/ai_assistance/skills/sources.md +16 -0
- package/front_end/models/ai_assistance/skills/storage.md +31 -0
- package/front_end/models/ai_assistance/tools/GetSourceContent.ts +101 -0
- package/front_end/models/ai_assistance/tools/GetTraceEventByKey.ts +83 -0
- package/front_end/models/ai_assistance/tools/GetTraceMainThreadSummary.ts +106 -0
- package/front_end/models/ai_assistance/tools/GetTraceNetworkSummary.ts +104 -0
- package/front_end/models/ai_assistance/tools/ListPageOrigins.ts +81 -0
- package/front_end/models/ai_assistance/tools/ListSources.ts +116 -0
- package/front_end/models/ai_assistance/tools/SelectTraceEventByKey.ts +90 -0
- package/front_end/models/ai_assistance/tools/Tool.ts +22 -1
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +14 -0
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +4 -0
- package/front_end/models/bindings/CompilerScriptMapping.ts +4 -0
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +8 -0
- package/front_end/models/bindings/ResourceScriptMapping.ts +3 -201
- package/front_end/models/bindings/SASSSourceMapping.ts +6 -0
- package/front_end/models/breakpoints/BreakpointManager.ts +2 -49
- package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +27 -0
- package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +10 -2
- package/front_end/models/issues_manager/descriptions/connectionAllowlistEmbeddingRequirementNotSatisfied.md +26 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistIFrameAttributeLoosensEmbeddingRequirement.md +19 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistInvalidAllowConnectionAllowlistFrom.md +21 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +1 -1
- package/front_end/models/persistence/IsolatedFileSystem.ts +7 -8
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +2 -2
- package/front_end/models/persistence/PlatformFileSystem.ts +1 -1
- package/front_end/models/persistence/persistence-meta.ts +9 -9
- package/front_end/models/trace/types/TraceEvents.ts +36 -0
- package/front_end/panels/accessibility/ARIAAttributesView.ts +3 -3
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +36 -36
- package/front_end/panels/accessibility/AccessibilityStrings.ts +168 -168
- package/front_end/panels/accessibility/SourceOrderView.ts +7 -7
- package/front_end/panels/accessibility/accessibility-meta.ts +2 -2
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +5 -5
- package/front_end/panels/ai_assistance/components/AIv2MarkdownRenderer.ts +2 -3
- package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -2
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +27 -2
- package/front_end/panels/application/IndexedDBViews.ts +65 -63
- package/front_end/panels/application/WebMCPView.ts +16 -7
- package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +5 -5
- package/front_end/panels/common/BadgeNotification.ts +8 -8
- package/front_end/panels/common/ExtensionServer.ts +21 -1
- package/front_end/panels/common/GdpSignUpDialog.ts +16 -16
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +5 -6
- package/front_end/panels/common/PersistenceUtils.ts +2 -2
- package/front_end/panels/common/common.ts +0 -97
- package/front_end/panels/console/ConsoleInsightTeaser.ts +2 -2
- package/front_end/panels/console/ConsolePinPane.ts +2 -2
- package/front_end/panels/console/ConsoleView.ts +20 -19
- package/front_end/panels/elements/LayoutPane.ts +2 -8
- package/front_end/panels/event_listeners/EventListenersView.ts +8 -4
- package/front_end/panels/issues/AffectedTrackingSitesView.ts +25 -14
- package/front_end/panels/media/PlayerMessagesView.ts +149 -68
- package/front_end/panels/network/NetworkPanel.ts +1 -1
- package/front_end/panels/network/RequestPayloadView.ts +1 -0
- package/front_end/panels/profiler/HeapSnapshotView.ts +0 -2
- package/front_end/panels/profiler/heapProfiler.css +0 -9
- package/front_end/panels/recorder/RecorderPanel.ts +2 -3
- package/front_end/panels/screencast/ScreencastView.ts +148 -138
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +2 -2
- package/front_end/panels/sources/DebuggerPlugin.ts +9 -58
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +1 -1
- package/front_end/panels/sources/UISourceCodeFrame.ts +3 -8
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +4 -2
- package/front_end/panels/timeline/TimelineController.ts +36 -64
- package/front_end/panels/timeline/TimelinePanel.ts +11 -8
- package/front_end/panels/timeline/TimelineUIUtils.ts +5 -2
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +2 -2
- package/front_end/panels/timeline/timelinePanel.css +0 -10
- package/front_end/panels/utils/utils.ts +7 -7
- package/front_end/services/tracing/PerformanceTracing.ts +5 -17
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
- package/front_end/third_party/codemirror.next/package.json +2 -2
- package/front_end/third_party/codemirror.next/rebuild.sh +4 -1
- package/front_end/ui/comments/CommentAnchorResolver.ts +436 -10
- package/front_end/ui/comments/CommentManager.ts +640 -0
- package/front_end/ui/comments/CommentsOverlayWidget.ts +121 -0
- package/front_end/ui/comments/comments.ts +4 -0
- package/front_end/ui/comments/commentsOverlay.css +49 -0
- package/front_end/{panels/common → ui/components/dialogs}/FreDialog.ts +6 -6
- package/front_end/ui/components/dialogs/TypeToAllowDialog.ts +96 -0
- package/front_end/ui/components/dialogs/dialogs.ts +4 -0
- package/front_end/ui/components/settings/SettingCheckbox.ts +3 -3
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeCompletionDisclaimer.ts +13 -13
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +7 -6
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeCompletionTeaser.ts +43 -46
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +22 -26
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeGenerationTeaser.ts +10 -10
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeGenerationUpgradeDialog.ts +5 -5
- package/front_end/ui/components/text_editor/text_editor.ts +4 -0
- package/front_end/ui/legacy/Toolbar.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +11 -3
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +270 -162
- package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +5 -0
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +11 -16
- package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +5 -12
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +8 -1
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +2 -2
- package/front_end/ui/settings/SettingUIRegistration.ts +55 -6
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/mcp/mcp.ts +6 -1
- package/package.json +1 -1
- package/front_end/Images/toolbarResizerVertical.png +0 -0
- package/front_end/emulated_devices/MotoG4-landscape.svg +0 -155
- package/front_end/emulated_devices/MotoG4-portrait.svg +0 -155
- package/front_end/emulated_devices/Nexus5X-landscape.svg +0 -19
- package/front_end/emulated_devices/Nexus5X-portrait.svg +0 -19
- package/front_end/emulated_devices/Nexus6P-landscape.svg +0 -50
- package/front_end/emulated_devices/Nexus6P-portrait.svg +0 -54
- package/front_end/emulated_devices/google-nest-hub-horizontal.png +0 -0
- package/front_end/emulated_devices/google-nest-hub-max-horizontal.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-navigation-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-navigation-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-navigation-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-navigation-2x.png +0 -0
- package/front_end/emulated_devices/iPad-landscape.svg +0 -73
- package/front_end/emulated_devices/iPad-portrait.svg +0 -76
- package/front_end/emulated_devices/iPhone5-landscape.svg +0 -99
- package/front_end/emulated_devices/iPhone5-portrait.svg +0 -83
- package/front_end/emulated_devices/iPhone6-landscape.svg +0 -111
- package/front_end/emulated_devices/iPhone6-portrait.svg +0 -116
- package/front_end/emulated_devices/iPhone6Plus-landscape.svg +0 -118
- package/front_end/emulated_devices/iPhone6Plus-portrait.svg +0 -116
- package/front_end/emulated_devices/optimized/MotoG4-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/MotoG4-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus5X-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus5X-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus6P-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus6P-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/README.md +0 -9
- package/front_end/emulated_devices/optimized/google-nest-hub-horizontal.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nest-hub-max-horizontal.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/iPad-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPad-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone5-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone5-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6Plus-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6Plus-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/optimized_images.gni +0 -53
- package/front_end/models/ai_assistance/agents/README.md +0 -136
- /package/front_end/{panels/common → ui/components/dialogs}/freDialog.css +0 -0
- /package/front_end/{panels/common/common.css → ui/components/dialogs/typeToAllowDialog.css} +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeCompletionDisclaimer.css +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeCompletionTeaser.css +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeGenerationTeaser.css +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeGenerationUpgradeDialog.css +0 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// Copyright 2026 The Chromium Authors
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import * as UI from '../../ui/legacy/legacy.js';
|
|
6
|
+
import * as Lit from '../../ui/lit/lit.js';
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
type CommentManager,
|
|
10
|
+
Events as CommentManagerEvents,
|
|
11
|
+
type HighlightRectData,
|
|
12
|
+
type HoverHighlightData,
|
|
13
|
+
type PinPositionData,
|
|
14
|
+
} from './CommentManager.js';
|
|
15
|
+
import commentsOverlayStyles from './commentsOverlay.css.js';
|
|
16
|
+
|
|
17
|
+
const {html, render, nothing, Directives: {styleMap}} = Lit;
|
|
18
|
+
|
|
19
|
+
export interface ViewInput {
|
|
20
|
+
pins: PinPositionData[];
|
|
21
|
+
highlights: HighlightRectData[];
|
|
22
|
+
hoverHighlight: HoverHighlightData|null;
|
|
23
|
+
commentMode: boolean;
|
|
24
|
+
onPinClick: (threadId: string) => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type View = (input: ViewInput, output: undefined, target: HTMLElement) => void;
|
|
28
|
+
|
|
29
|
+
// clang-format off
|
|
30
|
+
const DEFAULT_VIEW: View = (input: ViewInput, _output: undefined, target: HTMLElement): void => {
|
|
31
|
+
render(html`
|
|
32
|
+
<style>${commentsOverlayStyles}</style>
|
|
33
|
+
<div class="comments-overlay-container">
|
|
34
|
+
${input.hoverHighlight && input.hoverHighlight.visible ? html`
|
|
35
|
+
<div
|
|
36
|
+
class="comment-hover-highlight"
|
|
37
|
+
style=${styleMap({
|
|
38
|
+
top: `${input.hoverHighlight.top}px`,
|
|
39
|
+
left: `${input.hoverHighlight.left}px`,
|
|
40
|
+
width: `${input.hoverHighlight.width}px`,
|
|
41
|
+
height: `${input.hoverHighlight.height}px`,
|
|
42
|
+
})}>
|
|
43
|
+
</div>
|
|
44
|
+
` : nothing}
|
|
45
|
+
${input.highlights.map(h => h.visible ? html`
|
|
46
|
+
<div
|
|
47
|
+
class="comment-anchor-highlight"
|
|
48
|
+
data-comment-id=${h.id}
|
|
49
|
+
style=${styleMap({
|
|
50
|
+
top: `${h.top}px`,
|
|
51
|
+
left: `${h.left}px`,
|
|
52
|
+
width: `${h.width}px`,
|
|
53
|
+
height: `${h.height}px`,
|
|
54
|
+
})}>
|
|
55
|
+
</div>
|
|
56
|
+
` : nothing)}
|
|
57
|
+
${input.pins.map(p => p.visible ? html`
|
|
58
|
+
<div
|
|
59
|
+
class="comment-pin"
|
|
60
|
+
data-comment-id=${p.id}
|
|
61
|
+
style=${styleMap({
|
|
62
|
+
top: `${p.top}px`,
|
|
63
|
+
left: `${p.left}px`,
|
|
64
|
+
})}
|
|
65
|
+
@click=${() => input.onPinClick(p.id)}>
|
|
66
|
+
💬
|
|
67
|
+
</div>
|
|
68
|
+
` : nothing)}
|
|
69
|
+
</div>
|
|
70
|
+
`, target);
|
|
71
|
+
};
|
|
72
|
+
// clang-format on
|
|
73
|
+
|
|
74
|
+
export class CommentsOverlayWidget extends UI.Widget.Widget {
|
|
75
|
+
readonly #view: View;
|
|
76
|
+
readonly #commentManager: CommentManager;
|
|
77
|
+
|
|
78
|
+
constructor(
|
|
79
|
+
commentManager: CommentManager,
|
|
80
|
+
element?: HTMLElement,
|
|
81
|
+
view: View = DEFAULT_VIEW,
|
|
82
|
+
) {
|
|
83
|
+
super(element);
|
|
84
|
+
this.#view = view;
|
|
85
|
+
this.#commentManager = commentManager;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
override wasShown(): void {
|
|
89
|
+
super.wasShown();
|
|
90
|
+
this.#commentManager.addEventListener(CommentManagerEvents.POSITIONS_UPDATED, this.#onStateChanged, this);
|
|
91
|
+
this.#commentManager.addEventListener(CommentManagerEvents.COMMENT_THREADS_CHANGED, this.#onStateChanged, this);
|
|
92
|
+
this.#commentManager.addEventListener(CommentManagerEvents.COMMENT_MODE_CHANGED, this.#onStateChanged, this);
|
|
93
|
+
this.#commentManager.addEventListener(CommentManagerEvents.HOVER_HIGHLIGHT_CHANGED, this.#onStateChanged, this);
|
|
94
|
+
this.requestUpdate();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
override willHide(): void {
|
|
98
|
+
this.#commentManager.removeEventListener(CommentManagerEvents.POSITIONS_UPDATED, this.#onStateChanged, this);
|
|
99
|
+
this.#commentManager.removeEventListener(CommentManagerEvents.COMMENT_THREADS_CHANGED, this.#onStateChanged, this);
|
|
100
|
+
this.#commentManager.removeEventListener(CommentManagerEvents.COMMENT_MODE_CHANGED, this.#onStateChanged, this);
|
|
101
|
+
this.#commentManager.removeEventListener(CommentManagerEvents.HOVER_HIGHLIGHT_CHANGED, this.#onStateChanged, this);
|
|
102
|
+
super.willHide();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
#onStateChanged(): void {
|
|
106
|
+
this.requestUpdate();
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
#handlePinClick = (_threadId: string): void => {};
|
|
110
|
+
|
|
111
|
+
override performUpdate(): void {
|
|
112
|
+
const viewInput: ViewInput = {
|
|
113
|
+
pins: this.#commentManager.getPinPositions(),
|
|
114
|
+
highlights: this.#commentManager.getHighlightRects(),
|
|
115
|
+
hoverHighlight: this.#commentManager.getHoverHighlight(),
|
|
116
|
+
commentMode: this.#commentManager.isCommentMode(),
|
|
117
|
+
onPinClick: this.#handlePinClick,
|
|
118
|
+
};
|
|
119
|
+
this.#view(viewInput, undefined, this.contentElement);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as CommentAnchorResolver from './CommentAnchorResolver.js';
|
|
6
|
+
import * as CommentManager from './CommentManager.js';
|
|
7
|
+
import * as CommentsOverlayWidget from './CommentsOverlayWidget.js';
|
|
6
8
|
|
|
7
9
|
export {
|
|
8
10
|
CommentAnchorResolver,
|
|
11
|
+
CommentManager,
|
|
12
|
+
CommentsOverlayWidget,
|
|
9
13
|
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 The Chromium Authors
|
|
3
|
+
* Use of this source code is governed by a BSD-style license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
@scope to (devtools-widget > *) {
|
|
8
|
+
:scope,
|
|
9
|
+
.comments-overlay-container {
|
|
10
|
+
position: fixed;
|
|
11
|
+
inset: 0;
|
|
12
|
+
pointer-events: none;
|
|
13
|
+
z-index: 999990;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
width: 100vw;
|
|
16
|
+
height: 100vh;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.comment-pin {
|
|
20
|
+
position: absolute;
|
|
21
|
+
pointer-events: auto;
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
font-size: 24px;
|
|
24
|
+
line-height: 24px;
|
|
25
|
+
filter: drop-shadow(0 2px 5px rgb(0 0 0 / 35%));
|
|
26
|
+
user-select: none;
|
|
27
|
+
transition: transform 0.1s ease;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.comment-pin:hover {
|
|
31
|
+
transform: scale(1.15);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.comment-anchor-highlight {
|
|
35
|
+
position: absolute;
|
|
36
|
+
pointer-events: none;
|
|
37
|
+
border: 2px dashed var(--sys-color-primary);
|
|
38
|
+
background-color: color-mix(in srgb, var(--sys-color-primary), transparent 90%);
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.comment-hover-highlight {
|
|
43
|
+
position: absolute;
|
|
44
|
+
pointer-events: none;
|
|
45
|
+
border: 2px solid var(--sys-color-primary);
|
|
46
|
+
background-color: color-mix(in srgb, var(--sys-color-primary), transparent 85%);
|
|
47
|
+
box-sizing: border-box;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
/* eslint-disable @devtools/no-lit-render-outside-of-view */
|
|
5
5
|
|
|
6
|
-
import * as i18n from '
|
|
7
|
-
import type * as Platform from '
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
10
|
-
import * as
|
|
6
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
7
|
+
import type * as Platform from '../../../core/platform/platform.js';
|
|
8
|
+
import * as UI from '../../legacy/legacy.js';
|
|
9
|
+
import * as Lit from '../../lit/lit.js';
|
|
10
|
+
import * as Buttons from '../buttons/buttons.js';
|
|
11
11
|
|
|
12
12
|
import styles from './freDialog.css.js';
|
|
13
13
|
|
|
@@ -32,7 +32,7 @@ const UIStrings = {
|
|
|
32
32
|
gotIt: 'Got it',
|
|
33
33
|
} as const;
|
|
34
34
|
|
|
35
|
-
const str_ = i18n.i18n.registerUIStrings('
|
|
35
|
+
const str_ = i18n.i18n.registerUIStrings('ui/components/dialogs/FreDialog.ts', UIStrings);
|
|
36
36
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
37
37
|
|
|
38
38
|
export class FreDialog {
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Copyright 2026 The Chromium Authors
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
6
|
+
|
|
7
|
+
import * as Host from '../../../core/host/host.js';
|
|
8
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
9
|
+
import type * as Platform from '../../../core/platform/platform.js';
|
|
10
|
+
import * as Geometry from '../../../models/geometry/geometry.js';
|
|
11
|
+
import * as Buttons from '../../../ui/components/buttons/buttons.js';
|
|
12
|
+
import * as UI from '../../../ui/legacy/legacy.js';
|
|
13
|
+
|
|
14
|
+
import typeToAllowDialogStyles from './typeToAllowDialog.css.js';
|
|
15
|
+
|
|
16
|
+
const UIStrings = {
|
|
17
|
+
/**
|
|
18
|
+
* @description Text for the cancel button in the dialog.
|
|
19
|
+
*/
|
|
20
|
+
cancel: 'Cancel',
|
|
21
|
+
/**
|
|
22
|
+
* @description Text for the allow button in the "type to allow" dialog.
|
|
23
|
+
*/
|
|
24
|
+
allow: 'Allow',
|
|
25
|
+
} as const;
|
|
26
|
+
|
|
27
|
+
const str_ = i18n.i18n.registerUIStrings('ui/components/dialogs/TypeToAllowDialog.ts', UIStrings);
|
|
28
|
+
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
29
|
+
|
|
30
|
+
export class TypeToAllowDialog {
|
|
31
|
+
static async show(options: {
|
|
32
|
+
jslogContext: {
|
|
33
|
+
dialog: string,
|
|
34
|
+
input: string,
|
|
35
|
+
},
|
|
36
|
+
header: Platform.UIString.LocalizedString,
|
|
37
|
+
message: Platform.UIString.LocalizedString,
|
|
38
|
+
typePhrase: Platform.UIString.LocalizedString,
|
|
39
|
+
inputPlaceholder: Platform.UIString.LocalizedString,
|
|
40
|
+
}): Promise<boolean> {
|
|
41
|
+
const dialog = new UI.Dialog.Dialog(options.jslogContext.dialog);
|
|
42
|
+
dialog.setMaxContentSize(new Geometry.Size(504, 340));
|
|
43
|
+
dialog.setSizeBehavior(UI.GlassPane.SizeBehavior.SET_EXACT_WIDTH_MAX_HEIGHT);
|
|
44
|
+
dialog.setDimmed(true);
|
|
45
|
+
const shadowRoot =
|
|
46
|
+
UI.UIUtils.createShadowRootWithCoreStyles(dialog.contentElement, {cssFile: typeToAllowDialogStyles});
|
|
47
|
+
const content = shadowRoot.createChild('div', 'type-to-allow-dialog');
|
|
48
|
+
|
|
49
|
+
const result = await new Promise<boolean>(resolve => {
|
|
50
|
+
const header = content.createChild('div', 'header');
|
|
51
|
+
header.createChild('div', 'title').textContent = options.header;
|
|
52
|
+
|
|
53
|
+
const closeButton = header.createChild('dt-close-button', 'dialog-close-button');
|
|
54
|
+
closeButton.setTabbable(true);
|
|
55
|
+
self.onInvokeElement(closeButton, event => {
|
|
56
|
+
dialog.hide();
|
|
57
|
+
event.consume(true);
|
|
58
|
+
resolve(false);
|
|
59
|
+
});
|
|
60
|
+
closeButton.setSize(Buttons.Button.Size.SMALL);
|
|
61
|
+
|
|
62
|
+
content.createChild('div', 'message').textContent = options.message;
|
|
63
|
+
|
|
64
|
+
const input = UI.UIUtils.createInput('text-input', 'text', options.jslogContext.input);
|
|
65
|
+
input.placeholder = options.inputPlaceholder;
|
|
66
|
+
content.appendChild(input);
|
|
67
|
+
|
|
68
|
+
const buttonsBar = content.createChild('div', 'button');
|
|
69
|
+
const cancelButton =
|
|
70
|
+
UI.UIUtils.createTextButton(i18nString(UIStrings.cancel), () => resolve(false), {jslogContext: 'cancel'});
|
|
71
|
+
|
|
72
|
+
const allowButton = UI.UIUtils.createTextButton(i18nString(UIStrings.allow), () => {
|
|
73
|
+
resolve(input.value === options.typePhrase || input.value === `'${options.typePhrase}'`);
|
|
74
|
+
}, {jslogContext: 'confirm', variant: Buttons.Button.Variant.PRIMARY});
|
|
75
|
+
allowButton.disabled = true;
|
|
76
|
+
|
|
77
|
+
buttonsBar.appendChild(allowButton);
|
|
78
|
+
buttonsBar.appendChild(cancelButton);
|
|
79
|
+
|
|
80
|
+
input.addEventListener('input', () => {
|
|
81
|
+
allowButton.disabled = !Boolean(input.value);
|
|
82
|
+
}, false);
|
|
83
|
+
input.addEventListener('paste', e => e.preventDefault());
|
|
84
|
+
input.addEventListener('drop', e => e.preventDefault());
|
|
85
|
+
|
|
86
|
+
dialog.setOutsideClickCallback(event => {
|
|
87
|
+
event.consume();
|
|
88
|
+
resolve(false);
|
|
89
|
+
});
|
|
90
|
+
dialog.show();
|
|
91
|
+
Host.userMetrics.actionTaken(Host.UserMetrics.Action.SelfXssWarningDialogShown);
|
|
92
|
+
});
|
|
93
|
+
dialog.hide();
|
|
94
|
+
return result;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -4,10 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import * as ButtonDialog from './ButtonDialog.js';
|
|
6
6
|
import * as Dialog from './Dialog.js';
|
|
7
|
+
import * as FreDialog from './FreDialog.js';
|
|
7
8
|
import * as ShortcutDialog from './ShortcutDialog.js';
|
|
9
|
+
import * as TypeToAllowDialog from './TypeToAllowDialog.js';
|
|
8
10
|
|
|
9
11
|
export {
|
|
10
12
|
ButtonDialog,
|
|
11
13
|
Dialog,
|
|
14
|
+
FreDialog,
|
|
12
15
|
ShortcutDialog,
|
|
16
|
+
TypeToAllowDialog,
|
|
13
17
|
};
|
|
@@ -66,7 +66,7 @@ export class SettingCheckbox extends HTMLElement {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
const uiDescriptor = SettingUIRegistration.SettingUIRegistration.maybeResolve(this.#setting.descriptor());
|
|
69
|
-
const learnMore = uiDescriptor?.learnMore
|
|
69
|
+
const learnMore = uiDescriptor?.learnMore;
|
|
70
70
|
if (learnMore) {
|
|
71
71
|
const jsLogContext = `${this.#setting.name}-documentation`;
|
|
72
72
|
const data: Buttons.Button.ButtonData = {
|
|
@@ -136,8 +136,8 @@ export class SettingCheckbox extends HTMLElement {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
const uiDescriptor = SettingUIRegistration.SettingUIRegistration.maybeResolve(this.#setting.descriptor());
|
|
139
|
-
const learnMore = uiDescriptor?.learnMore
|
|
140
|
-
const titleText = uiDescriptor?.title
|
|
139
|
+
const learnMore = uiDescriptor?.learnMore;
|
|
140
|
+
const titleText = uiDescriptor?.title ?? '';
|
|
141
141
|
|
|
142
142
|
const icon = this.icon();
|
|
143
143
|
const title = learnMore?.tooltip?.() ?? '';
|
|
@@ -2,16 +2,16 @@
|
|
|
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 '
|
|
6
|
-
import '
|
|
5
|
+
import '../spinners/spinners.js';
|
|
6
|
+
import '../tooltips/tooltips.js';
|
|
7
7
|
|
|
8
|
-
import type * as Common from '
|
|
9
|
-
import * as Host from '
|
|
10
|
-
import * as i18n from '
|
|
11
|
-
import * as Root from '
|
|
12
|
-
import * as UI from '../../
|
|
13
|
-
import {Directives, html, nothing, render} from '../../
|
|
14
|
-
import * as VisualLogging from '../../
|
|
8
|
+
import type * as Common from '../../../core/common/common.js';
|
|
9
|
+
import * as Host from '../../../core/host/host.js';
|
|
10
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
11
|
+
import * as Root from '../../../core/root/root.js';
|
|
12
|
+
import * as UI from '../../legacy/legacy.js';
|
|
13
|
+
import {Directives, html, nothing, render} from '../../lit/lit.js';
|
|
14
|
+
import * as VisualLogging from '../../visual_logging/visual_logging.js';
|
|
15
15
|
|
|
16
16
|
import styles from './aiCodeCompletionDisclaimer.css.js';
|
|
17
17
|
|
|
@@ -293,8 +293,8 @@ export class AiCodeCompletionDisclaimer extends UI.Widget.Widget {
|
|
|
293
293
|
|
|
294
294
|
override wasShown(): void {
|
|
295
295
|
super.wasShown();
|
|
296
|
-
Host.AidaClient.HostConfigTracker.instance().addEventListener(
|
|
297
|
-
|
|
296
|
+
Host.AidaClient.HostConfigTracker.instance().addEventListener(Host.AidaClient.Events.AIDA_AVAILABILITY_CHANGED,
|
|
297
|
+
this.#boundOnAidaAvailabilityChange);
|
|
298
298
|
const initialAvailability = Host.AidaClient.HostConfigTracker.instance().aidaAvailability;
|
|
299
299
|
if (initialAvailability !== undefined) {
|
|
300
300
|
this.#updateAidaAvailability(initialAvailability);
|
|
@@ -303,7 +303,7 @@ export class AiCodeCompletionDisclaimer extends UI.Widget.Widget {
|
|
|
303
303
|
|
|
304
304
|
override willHide(): void {
|
|
305
305
|
super.willHide();
|
|
306
|
-
Host.AidaClient.HostConfigTracker.instance().removeEventListener(
|
|
307
|
-
|
|
306
|
+
Host.AidaClient.HostConfigTracker.instance().removeEventListener(Host.AidaClient.Events.AIDA_AVAILABILITY_CHANGED,
|
|
307
|
+
this.#boundOnAidaAvailabilityChange);
|
|
308
308
|
}
|
|
309
309
|
}
|
|
@@ -8,12 +8,13 @@ import * as i18n from '../../../core/i18n/i18n.js';
|
|
|
8
8
|
import * as Root from '../../../core/root/root.js';
|
|
9
9
|
import * as AiCodeCompletion from '../../../models/ai_code_completion/ai_code_completion.js';
|
|
10
10
|
import * as AiCodeGeneration from '../../../models/ai_code_generation/ai_code_generation.js';
|
|
11
|
-
import * as PanelCommon from '../../../panels/common/common.js';
|
|
12
11
|
import * as CodeMirror from '../../../third_party/codemirror.next/codemirror.next.js';
|
|
13
12
|
import * as UI from '../../legacy/legacy.js';
|
|
14
13
|
import * as VisualLogging from '../../visual_logging/visual_logging.js';
|
|
15
14
|
|
|
16
15
|
import {AccessiblePlaceholder} from './AccessiblePlaceholder.js';
|
|
16
|
+
import type {DisclaimerTextVariant} from './AiCodeCompletionDisclaimer.js';
|
|
17
|
+
import {AiCodeCompletionTeaser} from './AiCodeCompletionTeaser.js';
|
|
17
18
|
import {type AiCodeGenerationConfig, AiCodeGenerationProvider} from './AiCodeGenerationProvider.js';
|
|
18
19
|
import {
|
|
19
20
|
acceptAiAutoCompleteSuggestion,
|
|
@@ -57,7 +58,7 @@ export interface AiCodeCompletionConfig {
|
|
|
57
58
|
onRequestTriggered: () => void;
|
|
58
59
|
onResponseReceived: () => void;
|
|
59
60
|
disclaimerTooltipId: string;
|
|
60
|
-
disclaimerTextVariant:
|
|
61
|
+
disclaimerTextVariant: DisclaimerTextVariant;
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
export const DELAY_BEFORE_SHOWING_RESPONSE_MS = 500;
|
|
@@ -71,7 +72,7 @@ export class AiCodeCompletionProvider {
|
|
|
71
72
|
#aiCodeCompletionTeaserDismissedSetting =
|
|
72
73
|
Common.Settings.Settings.instance().createSetting('ai-code-completion-teaser-dismissed', false);
|
|
73
74
|
#teaserCompartment = new CodeMirror.Compartment();
|
|
74
|
-
#teaser?:
|
|
75
|
+
#teaser?: AiCodeCompletionTeaser;
|
|
75
76
|
#suggestionRenderingTimeout?: number;
|
|
76
77
|
#editor?: TextEditor;
|
|
77
78
|
#aiCodeCompletionCitations: Host.AidaClient.Citation[] = [];
|
|
@@ -143,7 +144,7 @@ export class AiCodeCompletionProvider {
|
|
|
143
144
|
editorInitialized(editor: TextEditor): void {
|
|
144
145
|
this.#editor = editor;
|
|
145
146
|
if (!this.#aiCodeCompletionSetting.get() && !this.#aiCodeCompletionTeaserDismissedSetting.get()) {
|
|
146
|
-
this.#teaser = new
|
|
147
|
+
this.#teaser = new AiCodeCompletionTeaser({
|
|
147
148
|
onDetach: () => this.#detachTeaser.bind(this),
|
|
148
149
|
disclaimerTextVariant: this.#aiCodeCompletionConfig?.disclaimerTextVariant,
|
|
149
150
|
});
|
|
@@ -486,9 +487,9 @@ export class AiCodeCompletionProvider {
|
|
|
486
487
|
}
|
|
487
488
|
}
|
|
488
489
|
|
|
489
|
-
function aiCodeCompletionTeaserExtension(teaser:
|
|
490
|
+
function aiCodeCompletionTeaserExtension(teaser: AiCodeCompletionTeaser): CodeMirror.Extension {
|
|
490
491
|
return CodeMirror.ViewPlugin.fromClass(class {
|
|
491
|
-
teaser:
|
|
492
|
+
teaser: AiCodeCompletionTeaser;
|
|
492
493
|
#teaserDecoration: CodeMirror.DecorationSet = CodeMirror.Decoration.none;
|
|
493
494
|
#teaserMode: AiCodeCompletionTeaserMode;
|
|
494
495
|
#teaserDisplayTimeout?: number;
|
|
@@ -2,22 +2,22 @@
|
|
|
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 '../../
|
|
5
|
+
import '../../kit/kit.js';
|
|
6
6
|
|
|
7
|
-
import * as Common from '
|
|
8
|
-
import * as Host from '
|
|
9
|
-
import * as i18n from '
|
|
10
|
-
import * as Root from '
|
|
11
|
-
import * as AIAssistance from '
|
|
12
|
-
import * as AiCodeGeneration from '
|
|
13
|
-
import * as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import * as
|
|
7
|
+
import * as Common from '../../../core/common/common.js';
|
|
8
|
+
import * as Host from '../../../core/host/host.js';
|
|
9
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
10
|
+
import * as Root from '../../../core/root/root.js';
|
|
11
|
+
import * as AIAssistance from '../../../models/ai_assistance/ai_assistance.js';
|
|
12
|
+
import * as AiCodeGeneration from '../../../models/ai_code_generation/ai_code_generation.js';
|
|
13
|
+
import * as UI from '../../legacy/legacy.js';
|
|
14
|
+
import {html, type LitTemplate, nothing, render} from '../../lit/lit.js';
|
|
15
|
+
import * as VisualLogging from '../../visual_logging/visual_logging.js';
|
|
16
|
+
import * as Dialogs from '../dialogs/dialogs.js';
|
|
17
|
+
import * as Snackbars from '../snackbars/snackbars.js';
|
|
17
18
|
|
|
18
19
|
import type {DisclaimerTextVariant} from './AiCodeCompletionDisclaimer.js';
|
|
19
20
|
import styles from './aiCodeCompletionTeaser.css.js';
|
|
20
|
-
import {FreDialog} from './FreDialog.js';
|
|
21
21
|
|
|
22
22
|
const UIStringsNotTranslate = {
|
|
23
23
|
/**
|
|
@@ -243,35 +243,33 @@ export class AiCodeCompletionTeaser extends UI.Widget.Widget {
|
|
|
243
243
|
|
|
244
244
|
const devtoolsLocale = i18n.DevToolsLocale.DevToolsLocale.instance();
|
|
245
245
|
if (AiCodeGeneration.AiCodeGeneration.AiCodeGeneration.isAiCodeGenerationEnabled(devtoolsLocale.locale)) {
|
|
246
|
-
reminderItems.push(
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
});
|
|
246
|
+
reminderItems.push({
|
|
247
|
+
iconName: 'code',
|
|
248
|
+
content: lockedString(UIStringsNotTranslate.freDisclaimerTextAsYouType),
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
iconName: 'text-analysis',
|
|
252
|
+
content: Host.Platform.isMac() ?
|
|
253
|
+
lockedString(UIStringsNotTranslate.freDisclaimerDescribeCodeInCommentForMacOs) :
|
|
254
|
+
lockedString(UIStringsNotTranslate.freDisclaimerDescribeCodeInComment),
|
|
255
|
+
});
|
|
257
256
|
}
|
|
258
257
|
|
|
259
|
-
reminderItems.push(
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
// clang-format off
|
|
258
|
+
reminderItems.push({
|
|
259
|
+
iconName: 'google',
|
|
260
|
+
content: this.#noLogging ? lockedString(UIStringsNotTranslate.freDisclaimerTextPrivacyNoLogging) :
|
|
261
|
+
lockedString(UIStringsNotTranslate.freDisclaimerTextPrivacy),
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
iconName: 'warning',
|
|
265
|
+
// clang-format off
|
|
268
266
|
content: html`<devtools-link
|
|
269
267
|
href=${CODE_SNIPPET_WARNING_URL}
|
|
270
268
|
class="link devtools-link"
|
|
271
269
|
jslogcontext="code-snippets-explainer.ai-code-completion-teaser"
|
|
272
270
|
>${lockedString(UIStringsNotTranslate.freDisclaimerTextUseWithCaution)}</devtools-link>`,
|
|
273
|
-
|
|
274
|
-
|
|
271
|
+
// clang-format on
|
|
272
|
+
});
|
|
275
273
|
return reminderItems;
|
|
276
274
|
}
|
|
277
275
|
|
|
@@ -279,7 +277,7 @@ export class AiCodeCompletionTeaser extends UI.Widget.Widget {
|
|
|
279
277
|
event.preventDefault();
|
|
280
278
|
|
|
281
279
|
const iconName = AIAssistance.AiUtils.getIconName();
|
|
282
|
-
const result = await FreDialog.show({
|
|
280
|
+
const result = await Dialogs.FreDialog.FreDialog.show({
|
|
283
281
|
header: {iconName, text: lockedString(UIStringsNotTranslate.freDisclaimerHeader)},
|
|
284
282
|
reminderItems: this.#createReminderItems(),
|
|
285
283
|
onLearnMoreClick: () => {
|
|
@@ -311,19 +309,18 @@ export class AiCodeCompletionTeaser extends UI.Widget.Widget {
|
|
|
311
309
|
|
|
312
310
|
override performUpdate(): void {
|
|
313
311
|
const output = {};
|
|
314
|
-
this.#view(
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
output, this.contentElement);
|
|
312
|
+
this.#view({
|
|
313
|
+
aidaAvailability: this.#aidaAvailability,
|
|
314
|
+
onAction: this.onAction,
|
|
315
|
+
onDismiss: this.onDismiss,
|
|
316
|
+
},
|
|
317
|
+
output, this.contentElement);
|
|
321
318
|
}
|
|
322
319
|
|
|
323
320
|
override wasShown(): void {
|
|
324
321
|
super.wasShown();
|
|
325
|
-
Host.AidaClient.HostConfigTracker.instance().addEventListener(
|
|
326
|
-
|
|
322
|
+
Host.AidaClient.HostConfigTracker.instance().addEventListener(Host.AidaClient.Events.AIDA_AVAILABILITY_CHANGED,
|
|
323
|
+
this.#boundOnAidaAvailabilityChange);
|
|
327
324
|
this.#aiCodeCompletionFreCompletedSetting.addChangeListener(this.#boundOnAiCodeCompletionSettingChanged);
|
|
328
325
|
this.#aiCodeCompletionTeaserDismissedSetting.addChangeListener(this.#boundOnAiCodeCompletionSettingChanged);
|
|
329
326
|
const initialAvailability = Host.AidaClient.HostConfigTracker.instance().aidaAvailability;
|
|
@@ -334,8 +331,8 @@ export class AiCodeCompletionTeaser extends UI.Widget.Widget {
|
|
|
334
331
|
|
|
335
332
|
override willHide(): void {
|
|
336
333
|
super.willHide();
|
|
337
|
-
Host.AidaClient.HostConfigTracker.instance().removeEventListener(
|
|
338
|
-
|
|
334
|
+
Host.AidaClient.HostConfigTracker.instance().removeEventListener(Host.AidaClient.Events.AIDA_AVAILABILITY_CHANGED,
|
|
335
|
+
this.#boundOnAidaAvailabilityChange);
|
|
339
336
|
this.#aiCodeCompletionFreCompletedSetting.removeChangeListener(this.#boundOnAiCodeCompletionSettingChanged);
|
|
340
337
|
this.#aiCodeCompletionTeaserDismissedSetting.removeChangeListener(this.#boundOnAiCodeCompletionSettingChanged);
|
|
341
338
|
}
|