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
|
@@ -7,13 +7,15 @@ import * as Host from '../../../core/host/host.js';
|
|
|
7
7
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
8
8
|
import * as Root from '../../../core/root/root.js';
|
|
9
9
|
import * as AiCodeGeneration from '../../../models/ai_code_generation/ai_code_generation.js';
|
|
10
|
-
import * as PanelCommon from '../../../panels/common/common.js';
|
|
11
10
|
import * as CodeMirror from '../../../third_party/codemirror.next/codemirror.next.js';
|
|
12
11
|
import * as UI from '../../../ui/legacy/legacy.js';
|
|
13
12
|
import * as VisualLogging from '../../visual_logging/visual_logging.js';
|
|
14
13
|
|
|
15
14
|
import {AccessiblePlaceholder} from './AccessiblePlaceholder.js';
|
|
15
|
+
import type {DisclaimerTextVariant} from './AiCodeCompletionDisclaimer.js';
|
|
16
16
|
import {AiCodeGenerationParser} from './AiCodeGenerationParser.js';
|
|
17
|
+
import {AiCodeGenerationTeaser, AiCodeGenerationTeaserDisplayState, PROMOTION_ID} from './AiCodeGenerationTeaser.js';
|
|
18
|
+
import {AiCodeGenerationUpgradeDialog} from './AiCodeGenerationUpgradeDialog.js';
|
|
17
19
|
import {
|
|
18
20
|
acceptAiAutoCompleteSuggestion,
|
|
19
21
|
aiAutoCompleteSuggestion,
|
|
@@ -47,7 +49,7 @@ export interface AiCodeGenerationConfig {
|
|
|
47
49
|
onRequestTriggered: () => void;
|
|
48
50
|
onResponseReceived: () => void;
|
|
49
51
|
disclaimerTooltipId: string;
|
|
50
|
-
disclaimerTextVariant:
|
|
52
|
+
disclaimerTextVariant: DisclaimerTextVariant;
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
export class AiCodeGenerationProvider {
|
|
@@ -60,7 +62,7 @@ export class AiCodeGenerationProvider {
|
|
|
60
62
|
Common.Settings.Settings.instance().createSetting('ai-code-generation-onboarding-completed', false);
|
|
61
63
|
#aiCodeGenerationUsedSetting = Common.Settings.Settings.instance().createSetting('ai-code-generation-used', false);
|
|
62
64
|
#generationTeaserCompartment = new CodeMirror.Compartment();
|
|
63
|
-
#generationTeaser:
|
|
65
|
+
#generationTeaser: AiCodeGenerationTeaser;
|
|
64
66
|
#editor?: TextEditor;
|
|
65
67
|
#aiCodeGenerationConfig: AiCodeGenerationConfig;
|
|
66
68
|
#aiCodeGeneration?: AiCodeGeneration.AiCodeGeneration.AiCodeGeneration;
|
|
@@ -83,7 +85,7 @@ export class AiCodeGenerationProvider {
|
|
|
83
85
|
if (!AiCodeGeneration.AiCodeGeneration.AiCodeGeneration.isAiCodeGenerationAvailable()) {
|
|
84
86
|
throw new Error('AI code generation feature is not available.');
|
|
85
87
|
}
|
|
86
|
-
this.#generationTeaser = new
|
|
88
|
+
this.#generationTeaser = new AiCodeGenerationTeaser();
|
|
87
89
|
this.#generationTeaser.disclaimerTooltipId = aiCodeGenerationConfig.disclaimerTooltipId;
|
|
88
90
|
this.#generationTeaser.disclaimerTextVariant = aiCodeGenerationConfig.disclaimerTextVariant;
|
|
89
91
|
this.#aiCodeGenerationConfig = aiCodeGenerationConfig;
|
|
@@ -186,8 +188,8 @@ export class AiCodeGenerationProvider {
|
|
|
186
188
|
this.#dismissTeaserAndSuggestion();
|
|
187
189
|
return true;
|
|
188
190
|
}
|
|
189
|
-
const generationTeaserIsLoading =
|
|
190
|
-
|
|
191
|
+
const generationTeaserIsLoading =
|
|
192
|
+
this.#generationTeaser.displayState === AiCodeGenerationTeaserDisplayState.LOADING;
|
|
191
193
|
if (this.#generationTeaser.isShowing() && generationTeaserIsLoading) {
|
|
192
194
|
this.#controller.abort();
|
|
193
195
|
this.#controller = new AbortController();
|
|
@@ -248,13 +250,13 @@ export class AiCodeGenerationProvider {
|
|
|
248
250
|
|
|
249
251
|
const noLogging = Root.Runtime.hostConfig.aidaAvailability?.enterprisePolicyValue ===
|
|
250
252
|
Root.Runtime.GenAiEnterprisePolicyValue.ALLOW_WITHOUT_LOGGING;
|
|
251
|
-
const resolved = await
|
|
253
|
+
const resolved = await AiCodeGenerationUpgradeDialog.show({noLogging});
|
|
252
254
|
this.#aiCodeGenerationOnboardingCompletedSetting.set(resolved);
|
|
253
255
|
return resolved;
|
|
254
256
|
}
|
|
255
257
|
|
|
256
258
|
#dismissTeaserAndSuggestion(): void {
|
|
257
|
-
this.#generationTeaser.displayState =
|
|
259
|
+
this.#generationTeaser.displayState = AiCodeGenerationTeaserDisplayState.TRIGGER;
|
|
258
260
|
this.#editor?.dispatch({
|
|
259
261
|
effects: [
|
|
260
262
|
setAiCodeGenerationTeaserMode.of(AiCodeGenerationTeaserMode.DISMISSED),
|
|
@@ -305,18 +307,15 @@ export class AiCodeGenerationProvider {
|
|
|
305
307
|
if (currentTeaserMode === AiCodeGenerationTeaserMode.DISMISSED) {
|
|
306
308
|
return;
|
|
307
309
|
}
|
|
308
|
-
if (this.#generationTeaser.displayState ===
|
|
309
|
-
PanelCommon.AiCodeGenerationTeaser.AiCodeGenerationTeaserDisplayState.LOADING) {
|
|
310
|
+
if (this.#generationTeaser.displayState === AiCodeGenerationTeaserDisplayState.LOADING) {
|
|
310
311
|
this.#controller.abort();
|
|
311
312
|
this.#controller = new AbortController();
|
|
312
313
|
this.#dismissTeaserAndSuggestion();
|
|
313
314
|
return;
|
|
314
315
|
}
|
|
315
|
-
if (this.#generationTeaser.displayState ===
|
|
316
|
-
PanelCommon.AiCodeGenerationTeaser.AiCodeGenerationTeaserDisplayState.GENERATED) {
|
|
316
|
+
if (this.#generationTeaser.displayState === AiCodeGenerationTeaserDisplayState.GENERATED) {
|
|
317
317
|
update.view.dispatch({effects: setAiAutoCompleteSuggestion.of(null)});
|
|
318
|
-
this.#generationTeaser.displayState =
|
|
319
|
-
PanelCommon.AiCodeGenerationTeaser.AiCodeGenerationTeaserDisplayState.DISCOVERY;
|
|
318
|
+
this.#generationTeaser.displayState = AiCodeGenerationTeaserDisplayState.DISCOVERY;
|
|
320
319
|
return;
|
|
321
320
|
}
|
|
322
321
|
}
|
|
@@ -342,7 +341,7 @@ export class AiCodeGenerationProvider {
|
|
|
342
341
|
return;
|
|
343
342
|
}
|
|
344
343
|
|
|
345
|
-
this.#generationTeaser.displayState =
|
|
344
|
+
this.#generationTeaser.displayState = AiCodeGenerationTeaserDisplayState.LOADING;
|
|
346
345
|
try {
|
|
347
346
|
const startTime = performance.now();
|
|
348
347
|
this.#aiCodeGenerationConfig.onRequestTriggered();
|
|
@@ -386,8 +385,7 @@ export class AiCodeGenerationProvider {
|
|
|
386
385
|
setAiCodeGenerationTeaserMode.of(AiCodeGenerationTeaserMode.ACTIVE),
|
|
387
386
|
],
|
|
388
387
|
});
|
|
389
|
-
this.#generationTeaser.displayState =
|
|
390
|
-
PanelCommon.AiCodeGenerationTeaser.AiCodeGenerationTeaserDisplayState.GENERATED;
|
|
388
|
+
this.#generationTeaser.displayState = AiCodeGenerationTeaserDisplayState.GENERATED;
|
|
391
389
|
|
|
392
390
|
AiCodeGeneration.debugLog('Suggestion dispatched to the editor', suggestionText);
|
|
393
391
|
const citations = topSample.attributionMetadata?.citations ?? [];
|
|
@@ -409,8 +407,7 @@ export class AiCodeGenerationProvider {
|
|
|
409
407
|
}
|
|
410
408
|
}
|
|
411
409
|
|
|
412
|
-
function aiCodeGenerationTeaserExtension(teaser:
|
|
413
|
-
CodeMirror.Extension {
|
|
410
|
+
function aiCodeGenerationTeaserExtension(teaser: AiCodeGenerationTeaser): CodeMirror.Extension {
|
|
414
411
|
return CodeMirror.ViewPlugin.fromClass(class {
|
|
415
412
|
#view: CodeMirror.EditorView;
|
|
416
413
|
|
|
@@ -436,8 +433,7 @@ function aiCodeGenerationTeaserExtension(teaser: PanelCommon.AiCodeGenerationTea
|
|
|
436
433
|
const line = this.#view.state.doc.lineAt(cursorPosition);
|
|
437
434
|
|
|
438
435
|
const isEmptyLine = line.length === 0;
|
|
439
|
-
const canShowDiscoveryState =
|
|
440
|
-
UI.UIUtils.PromotionManager.instance().canShowPromotion(PanelCommon.AiCodeGenerationTeaser.PROMOTION_ID);
|
|
436
|
+
const canShowDiscoveryState = UI.UIUtils.PromotionManager.instance().canShowPromotion(PROMOTION_ID);
|
|
441
437
|
|
|
442
438
|
if ((isEmptyLine && canShowDiscoveryState)) {
|
|
443
439
|
return CodeMirror.Decoration.set([
|
|
@@ -461,17 +457,17 @@ function aiCodeGenerationTeaserExtension(teaser: PanelCommon.AiCodeGenerationTea
|
|
|
461
457
|
#updateTeaserState(state: CodeMirror.EditorState): void {
|
|
462
458
|
// Only handle non loading and non generated states, as updates during and after generation are handled by
|
|
463
459
|
// #abortOrDismissGenerationDuringUpdate in AiCodeGenerationProvider
|
|
464
|
-
if (teaser.displayState ===
|
|
465
|
-
teaser.displayState ===
|
|
460
|
+
if (teaser.displayState === AiCodeGenerationTeaserDisplayState.LOADING ||
|
|
461
|
+
teaser.displayState === AiCodeGenerationTeaserDisplayState.GENERATED) {
|
|
466
462
|
return;
|
|
467
463
|
}
|
|
468
464
|
const cursorPosition = state.selection.main.head;
|
|
469
465
|
const line = state.doc.lineAt(cursorPosition);
|
|
470
466
|
const isEmptyLine = line.length === 0;
|
|
471
467
|
if (isEmptyLine) {
|
|
472
|
-
teaser.displayState =
|
|
468
|
+
teaser.displayState = AiCodeGenerationTeaserDisplayState.DISCOVERY;
|
|
473
469
|
} else {
|
|
474
|
-
teaser.displayState =
|
|
470
|
+
teaser.displayState = AiCodeGenerationTeaserDisplayState.TRIGGER;
|
|
475
471
|
}
|
|
476
472
|
}
|
|
477
473
|
}, {
|
|
@@ -497,7 +493,7 @@ function aiCodeGenerationTeaserExtension(teaser: PanelCommon.AiCodeGenerationTea
|
|
|
497
493
|
},
|
|
498
494
|
keydown(event: KeyboardEvent): boolean {
|
|
499
495
|
if (!UI.KeyboardShortcut.KeyboardShortcut.eventHasCtrlEquivalentKey(event) ||
|
|
500
|
-
teaser.displayState !==
|
|
496
|
+
teaser.displayState !== AiCodeGenerationTeaserDisplayState.TRIGGER) {
|
|
501
497
|
return false;
|
|
502
498
|
}
|
|
503
499
|
if (event.key === '.') {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// Copyright 2025 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
-
import '
|
|
5
|
-
|
|
6
|
-
import * as Common from '
|
|
7
|
-
import * as Host from '
|
|
8
|
-
import * as i18n from '
|
|
9
|
-
import * as Root from '
|
|
10
|
-
import * as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import * as
|
|
4
|
+
import '../tooltips/tooltips.js';
|
|
5
|
+
|
|
6
|
+
import * as Common from '../../../core/common/common.js';
|
|
7
|
+
import * as Host from '../../../core/host/host.js';
|
|
8
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
9
|
+
import * as Root from '../../../core/root/root.js';
|
|
10
|
+
import * as UI from '../../legacy/legacy.js';
|
|
11
|
+
import {Directives, html, nothing, render} from '../../lit/lit.js';
|
|
12
|
+
import * as VisualLogging from '../../visual_logging/visual_logging.js';
|
|
13
|
+
import * as Buttons from '../buttons/buttons.js';
|
|
14
14
|
|
|
15
15
|
import type {DisclaimerTextVariant} from './AiCodeCompletionDisclaimer.js';
|
|
16
16
|
import styles from './aiCodeGenerationTeaser.css.js';
|
package/front_end/{panels/common → ui/components/text_editor}/AiCodeGenerationUpgradeDialog.ts
RENAMED
|
@@ -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 Host from '
|
|
7
|
-
import * as i18n from '
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
10
|
-
import * as
|
|
6
|
+
import * as Host from '../../../core/host/host.js';
|
|
7
|
+
import * as i18n from '../../../core/i18n/i18n.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 './aiCodeGenerationUpgradeDialog.css.js';
|
|
13
13
|
|
|
@@ -3,9 +3,13 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
export * as AccessiblePlaceholder from './AccessiblePlaceholder.js';
|
|
6
|
+
export * as AiCodeCompletionDisclaimer from './AiCodeCompletionDisclaimer.js';
|
|
6
7
|
export * as AiCodeCompletionProvider from './AiCodeCompletionProvider.js';
|
|
8
|
+
export * as AiCodeCompletionTeaser from './AiCodeCompletionTeaser.js';
|
|
7
9
|
export * as AiCodeGenerationParser from './AiCodeGenerationParser.js';
|
|
8
10
|
export * as AiCodeGenerationProvider from './AiCodeGenerationProvider.js';
|
|
11
|
+
export * as AiCodeGenerationTeaser from './AiCodeGenerationTeaser.js';
|
|
12
|
+
export * as AiCodeGenerationUpgradeDialog from './AiCodeGenerationUpgradeDialog.js';
|
|
9
13
|
export * as AutocompleteHistory from './AutocompleteHistory.js';
|
|
10
14
|
export * as Config from './config.js';
|
|
11
15
|
export * as ExecutionPositionHighlighter from './ExecutionPositionHighlighter.js';
|
|
@@ -1431,7 +1431,7 @@ export class ToolbarSettingCheckbox extends ToolbarCheckbox {
|
|
|
1431
1431
|
setting: Common.Settings.Setting<boolean>, tooltip?: Common.UIString.LocalizedString,
|
|
1432
1432
|
alternateTitle?: Common.UIString.LocalizedString) {
|
|
1433
1433
|
const uiDescriptor = SettingUIRegistration.SettingUIRegistration.maybeResolve(setting.descriptor());
|
|
1434
|
-
const title = alternateTitle
|
|
1434
|
+
const title = alternateTitle ?? uiDescriptor?.title ?? ('' as Common.UIString.LocalizedString);
|
|
1435
1435
|
super(title, tooltip, undefined, setting.name);
|
|
1436
1436
|
bindCheckbox(this.element as CheckboxLabel, setting);
|
|
1437
1437
|
}
|
|
@@ -8,13 +8,14 @@ import * as i18n from '../../../../core/i18n/i18n.js';
|
|
|
8
8
|
import type * as SDK from '../../../../core/sdk/sdk.js';
|
|
9
9
|
import type * as Protocol from '../../../../generated/protocol.js';
|
|
10
10
|
import {createIcon, type Icon} from '../../../kit/kit.js';
|
|
11
|
+
import {render} from '../../../lit/lit.js';
|
|
11
12
|
import * as UI from '../../legacy.js';
|
|
12
13
|
|
|
13
14
|
import {sanitizeStyle} from './CSSStyleSanitizer.js';
|
|
14
15
|
import customPreviewComponentStyles from './customPreviewComponent.css.js';
|
|
15
16
|
import {
|
|
17
|
+
defaultObjectPresentation as defaultObjectPresentationTemplate,
|
|
16
18
|
ObjectPropertiesMode,
|
|
17
|
-
ObjectPropertiesSection,
|
|
18
19
|
ObjectPropertiesSectionsTreeOutline,
|
|
19
20
|
ObjectPropertyTreeElement,
|
|
20
21
|
ObjectTree,
|
|
@@ -129,7 +130,7 @@ export class CustomPreviewSection {
|
|
|
129
130
|
return (new CustomPreviewSection(remoteObject)).element();
|
|
130
131
|
}
|
|
131
132
|
|
|
132
|
-
const sectionElement =
|
|
133
|
+
const sectionElement = defaultObjectPresentation(remoteObject);
|
|
133
134
|
sectionElement.classList.toggle('custom-expandable-section-standard-section', remoteObject.hasChildren);
|
|
134
135
|
return sectionElement;
|
|
135
136
|
}
|
|
@@ -239,7 +240,14 @@ export class CustomPreviewComponent {
|
|
|
239
240
|
if (this.element.shadowRoot) {
|
|
240
241
|
this.element.shadowRoot.textContent = '';
|
|
241
242
|
this.customPreviewSection = null;
|
|
242
|
-
this.element.shadowRoot.appendChild(
|
|
243
|
+
this.element.shadowRoot.appendChild(defaultObjectPresentation(this.object));
|
|
243
244
|
}
|
|
244
245
|
}
|
|
245
246
|
}
|
|
247
|
+
|
|
248
|
+
function defaultObjectPresentation(object: SDK.RemoteObject.RemoteObject): Element {
|
|
249
|
+
const element = document.createElement('span');
|
|
250
|
+
// eslint-disable-next-line @devtools/no-lit-render-outside-of-view
|
|
251
|
+
render(defaultObjectPresentationTemplate(object), element);
|
|
252
|
+
return element;
|
|
253
|
+
}
|