chrome-devtools-frontend 1.0.1667564 → 1.0.1669021
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/skills/devtools-ci/SKILL.md +65 -0
- package/.agents/skills/devtools-setting-migration/SKILL.md +290 -0
- package/.agents/skills/gerrit-cli/SKILL.md +59 -0
- package/.agents/skills/gerrit-cli/references/commands.md +93 -0
- package/.agents/skills/gerrit-cli/references/workflows.md +56 -0
- package/.agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py +47 -0
- package/.agents/skills/gerrit-cli/scripts/import_upstream.py +230 -0
- package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +11 -4
- package/.agents/skills/ui-widgets/SKILL.md +25 -1
- package/docs/contributing/infrastructure.md +7 -1
- package/docs/ui_engineering.md +44 -1
- package/front_end/core/common/Settings.ts +11 -4
- package/front_end/core/host/AidaClient.ts +66 -47
- package/front_end/core/host/GcaClient.ts +4 -6
- package/front_end/core/host/ResourceLoader.ts +4 -2
- package/front_end/core/root/Runtime.ts +5 -5
- package/front_end/core/sdk/CSSModel.test.api.ts +102 -0
- package/front_end/core/sdk/CSSModel.ts +3 -2
- package/front_end/core/sdk/ConsoleModel.ts +3 -2
- package/front_end/core/sdk/DebuggerModel.ts +16 -7
- package/front_end/core/sdk/SDKSettings.ts +38 -0
- package/front_end/core/sdk/sdk-meta.ts +0 -120
- package/front_end/core/sdk/sdk.ts +2 -0
- package/front_end/entrypoints/main/MainImpl.ts +10 -3
- package/front_end/foundation/Universe.ts +7 -0
- package/front_end/generated/InspectorBackendCommands.ts +2 -2
- package/front_end/generated/protocol.ts +11 -3
- package/front_end/models/ai_assistance/AiAgent2.ts +1 -1
- package/front_end/models/ai_assistance/AiUtils.ts +67 -4
- package/front_end/models/ai_assistance/BuiltInAi.ts +11 -6
- package/front_end/models/ai_assistance/ChangeManager.ts +17 -1
- package/front_end/models/ai_assistance/StorageItem.ts +26 -5
- package/front_end/models/ai_code_completion/AiCodeCompletion.ts +2 -19
- package/front_end/models/ai_code_generation/AiCodeGeneration.ts +2 -3
- package/front_end/models/javascript_metadata/NativeFunctions.js +22 -9
- package/front_end/models/source_map_scopes/NamesResolver.ts +23 -17
- package/front_end/models/trace/handlers/RendererHandler.ts +20 -4
- package/front_end/models/trace/types/File.ts +1 -0
- package/front_end/models/workspace/UISourceCode.ts +0 -10
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +61 -182
- package/front_end/panels/ai_assistance/components/ChatInput.ts +25 -8
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +13 -69
- package/front_end/panels/ai_assistance/components/ChatView.ts +14 -8
- package/front_end/panels/ai_assistance/components/chatMessage.css +2 -20
- package/front_end/panels/application/ApplicationPanelSidebar.ts +2 -2
- package/front_end/panels/application/ApplicationPanelTreeElement.ts +41 -3
- package/front_end/panels/application/ServiceWorkerUpdateCycleView.ts +131 -134
- package/front_end/panels/application/ServiceWorkersView.ts +8 -8
- package/front_end/panels/application/application.ts +2 -0
- package/front_end/panels/application/components/AdsView.ts +10 -6
- package/front_end/panels/application/preloading/PreloadingView.ts +53 -45
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +111 -119
- package/front_end/panels/application/preloading/components/preloadingDetailsReportView.css +22 -24
- package/front_end/panels/application/serviceWorkerUpdateCycleView.css +105 -102
- package/front_end/panels/common/AiCodeCompletionDisclaimer.ts +107 -96
- package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +17 -19
- package/front_end/panels/common/AiCodeCompletionTeaser.ts +6 -6
- package/front_end/panels/common/AiCodeGenerationTeaser.ts +28 -26
- package/front_end/panels/common/common.ts +1 -1
- package/front_end/panels/console/ConsoleInsightTeaser.ts +6 -8
- package/front_end/panels/console/ConsoleView.ts +6 -4
- package/front_end/panels/console/ConsoleViewMessage.ts +1 -1
- package/front_end/panels/console/console-meta.ts +28 -0
- package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +1 -1
- package/front_end/panels/elements/StylesSidebarPane.ts +3 -2
- package/front_end/panels/emulation/DeviceModeToolbar.ts +2 -2
- package/front_end/panels/emulation/DeviceModeView.ts +63 -104
- package/front_end/panels/emulation/DeviceModeWrapper.ts +18 -4
- package/front_end/panels/explain/components/ConsoleInsight.ts +4 -6
- package/front_end/panels/explain/explain-meta.ts +7 -49
- package/front_end/panels/network/NetworkDataGridNode.ts +1 -1
- package/front_end/panels/network/NetworkLogView.ts +1 -0
- package/front_end/panels/network/OriginalResourceChunkView.ts +340 -0
- package/front_end/panels/network/ResourceChunkView.ts +72 -46
- package/front_end/panels/network/ResourceDirectSocketChunkView.ts +3 -2
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +3 -3
- package/front_end/panels/network/originalResourceChunkView.css +49 -0
- package/front_end/panels/screencast/ScreencastView.ts +401 -260
- package/front_end/panels/screencast/screencastView.css +113 -100
- package/front_end/panels/sensors/LocationsSettingsTab.ts +329 -135
- package/front_end/panels/sensors/locationsSettingsTab.css +78 -4
- package/front_end/panels/settings/AISettingsTab.ts +17 -100
- package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +2 -2
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +4 -4
- package/front_end/panels/sources/AddSourceMapURLDialog.ts +3 -3
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +4 -3
- package/front_end/panels/sources/BreakpointEditDialog.ts +14 -14
- package/front_end/panels/sources/BreakpointsView.ts +14 -14
- package/front_end/panels/sources/CallStackSidebarPane.ts +6 -6
- package/front_end/panels/sources/CategorizedBreakpointL10n.ts +18 -18
- package/front_end/panels/sources/CoveragePlugin.ts +7 -7
- package/front_end/panels/sources/DebuggerPausedMessage.ts +23 -23
- package/front_end/panels/sources/DebuggerPlugin.ts +31 -31
- package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +2 -2
- package/front_end/panels/sources/GoToLineQuickOpen.ts +10 -10
- package/front_end/panels/sources/NavigatorView.ts +34 -27
- package/front_end/panels/sources/OutlineQuickOpen.ts +3 -3
- package/front_end/panels/sources/PersistenceActions.ts +9 -9
- package/front_end/panels/sources/ProfilePlugin.ts +1 -1
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +5 -5
- package/front_end/panels/sources/SnippetsPlugin.ts +2 -2
- package/front_end/panels/sources/SourcesNavigator.ts +20 -18
- package/front_end/panels/sources/SourcesPanel.ts +26 -25
- package/front_end/panels/sources/SourcesView.ts +5 -6
- package/front_end/panels/sources/TabbedEditorContainer.ts +3 -3
- package/front_end/panels/sources/ThreadsSidebarPane.ts +1 -1
- package/front_end/panels/sources/UISourceCodeFrame.ts +0 -2
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +7 -7
- package/front_end/panels/sources/components/HeadersView.ts +2 -2
- package/front_end/panels/sources/sources-meta.ts +164 -71
- package/front_end/panels/sources/sources.ts +0 -2
- package/front_end/panels/timeline/TimelineHistoryManager.ts +14 -3
- package/front_end/panels/timeline/TimelineLoader.ts +72 -42
- package/front_end/panels/timeline/TimelinePanel.ts +29 -4
- package/front_end/panels/timeline/timelineHistoryManager.css +4 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +187 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +91 -38
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts +145 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js +0 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.d.ts +0 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js +0 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Dialog.d.ts +3 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Dialog.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Dialog.js +8 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Dialog.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/JSHandle.d.ts +0 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/JSHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/JSHandle.js +0 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts +1 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js +0 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.d.ts +0 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.js +0 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.d.ts +5 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.js +12 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js +4 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts +5 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js +49 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.d.ts +0 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.js +0 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/util.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.d.ts +0 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.js +0 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/disposable.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/disposable.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +187 -1
- package/front_end/third_party/puppeteer/package/package.json +5 -5
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +155 -2
- package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +0 -2
- package/front_end/third_party/puppeteer/package/src/api/Dialog.ts +10 -2
- package/front_end/third_party/puppeteer/package/src/api/JSHandle.ts +0 -2
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +1 -3
- package/front_end/third_party/puppeteer/package/src/api/Realm.ts +0 -1
- package/front_end/third_party/puppeteer/package/src/bidi/BidiOverCdp.ts +4 -2
- package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +17 -0
- package/front_end/third_party/puppeteer/package/src/bidi/HTTPResponse.ts +5 -4
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +66 -0
- package/front_end/third_party/puppeteer/package/src/common/EventEmitter.ts +0 -6
- package/front_end/third_party/puppeteer/package/src/generated/injected.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/injected/util.ts +4 -1
- package/front_end/third_party/puppeteer/package/src/node/ScreenRecorder.ts +0 -3
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/disposable.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +9 -7
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +7 -8
- package/front_end/ui/legacy/Dialog.ts +103 -4
- package/front_end/ui/legacy/InspectorView.ts +1 -5
- package/front_end/ui/legacy/PopoverHelper.ts +5 -5
- package/front_end/ui/legacy/TabbedPane.ts +7 -2
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +40 -24
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -0
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +8 -4
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +14 -7
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +11 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
- package/package.json +1 -1
- package/front_end/panels/sources/AiWarningInfobarPlugin.ts +0 -78
|
@@ -9,7 +9,6 @@ import type * as Common from '../../core/common/common.js';
|
|
|
9
9
|
import * as Host from '../../core/host/host.js';
|
|
10
10
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
11
11
|
import * as Root from '../../core/root/root.js';
|
|
12
|
-
import * as AiCodeCompletion from '../../models/ai_code_completion/ai_code_completion.js';
|
|
13
12
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
14
13
|
import {Directives, html, nothing, render} from '../../ui/lit/lit.js';
|
|
15
14
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
@@ -71,17 +70,19 @@ const UIStringsNotTranslate = {
|
|
|
71
70
|
|
|
72
71
|
const lockedString = i18n.i18n.lockedString;
|
|
73
72
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
export type DisclaimerTextVariant = 'console'|'sources'|'styles';
|
|
74
|
+
|
|
75
|
+
function getTooltipDisclaimerText(noLogging: boolean, disclaimerTextVariant: DisclaimerTextVariant): string {
|
|
76
|
+
switch (disclaimerTextVariant) {
|
|
77
|
+
case 'console':
|
|
77
78
|
return noLogging ?
|
|
78
79
|
lockedString(UIStringsNotTranslate.tooltipDisclaimerTextForAiCodeCompletionNoLoggingInConsole) :
|
|
79
80
|
lockedString(UIStringsNotTranslate.tooltipDisclaimerTextForAiCodeCompletionInConsole);
|
|
80
|
-
case
|
|
81
|
+
case 'sources':
|
|
81
82
|
return noLogging ?
|
|
82
83
|
lockedString(UIStringsNotTranslate.tooltipDisclaimerTextForAiCodeCompletionNoLoggingInSources) :
|
|
83
84
|
lockedString(UIStringsNotTranslate.tooltipDisclaimerTextForAiCodeCompletionInSources);
|
|
84
|
-
case
|
|
85
|
+
case 'styles':
|
|
85
86
|
return noLogging ? lockedString(UIStringsNotTranslate.tooltipDisclaimerTextForAiCodeCompletionNoLoggingInStyles) :
|
|
86
87
|
lockedString(UIStringsNotTranslate.tooltipDisclaimerTextForAiCodeCompletionInStyles);
|
|
87
88
|
}
|
|
@@ -93,8 +94,7 @@ export interface ViewInput {
|
|
|
93
94
|
noLogging: boolean;
|
|
94
95
|
aidaAvailability?: Host.AidaClient.AidaAccessPreconditions;
|
|
95
96
|
onManageInSettingsTooltipClick: () => void;
|
|
96
|
-
|
|
97
|
-
panel?: AiCodeCompletion.AiCodeCompletion.ContextFlavor;
|
|
97
|
+
disclaimerTextVariant?: DisclaimerTextVariant;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
export interface ViewOutput {
|
|
@@ -104,83 +104,95 @@ export interface ViewOutput {
|
|
|
104
104
|
|
|
105
105
|
export type View = (input: ViewInput, output: ViewOutput, target: HTMLElement) => void;
|
|
106
106
|
|
|
107
|
-
export const DEFAULT_SUMMARY_TOOLBAR_VIEW: View =
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
107
|
+
export const DEFAULT_SUMMARY_TOOLBAR_VIEW: View = (input, output, target) => {
|
|
108
|
+
if (input.aidaAvailability !== Host.AidaClient.AidaAccessPreconditions.AVAILABLE || !input.disclaimerTooltipId ||
|
|
109
|
+
!input.spinnerTooltipId || !input.disclaimerTextVariant) {
|
|
110
|
+
render(nothing, target);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const tooltipDisclaimerText = getTooltipDisclaimerText(input.noLogging, input.disclaimerTextVariant);
|
|
114
|
+
// clang-format off
|
|
115
|
+
render(html`
|
|
116
|
+
<style>${styles}</style>
|
|
117
|
+
<div class="ai-code-completion-disclaimer">
|
|
118
|
+
<devtools-spinner
|
|
119
|
+
.active=${false}
|
|
120
|
+
${Directives.ref(el => {
|
|
121
|
+
if (el instanceof HTMLElement) {
|
|
122
|
+
output.setLoading = (isLoading: boolean) => {
|
|
123
|
+
el.toggleAttribute('active', isLoading);
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
})}
|
|
127
|
+
aria-details=${input.spinnerTooltipId}
|
|
128
|
+
aria-describedby=${input.spinnerTooltipId}>
|
|
129
|
+
</devtools-spinner>
|
|
130
|
+
<devtools-tooltip
|
|
131
|
+
id=${input.spinnerTooltipId}
|
|
132
|
+
variant="rich"
|
|
133
|
+
jslogContext="ai-code-completion-spinner-tooltip"
|
|
134
|
+
>
|
|
135
|
+
<div class="disclaimer-tooltip-container">
|
|
136
|
+
<div class="tooltip-text">
|
|
135
137
|
${lockedString(UIStringsNotTranslate.tooltipTextForSpinner)}
|
|
136
|
-
</div></div></devtools-tooltip>
|
|
137
|
-
<span
|
|
138
|
-
tabIndex="0"
|
|
139
|
-
class="link"
|
|
140
|
-
role="link"
|
|
141
|
-
jslog=${VisualLogging.link('open-ai-settings').track({
|
|
142
|
-
click: true,
|
|
143
|
-
})}
|
|
144
|
-
aria-details=${input.disclaimerTooltipId}
|
|
145
|
-
aria-describedby=${input.disclaimerTooltipId}
|
|
146
|
-
@click=${() => {
|
|
147
|
-
void UI.ViewManager.ViewManager.instance().showView('chrome-ai');
|
|
148
|
-
}}
|
|
149
|
-
>${lockedString(UIStringsNotTranslate.relevantData)}</span>${lockedString(UIStringsNotTranslate.isSentToGoogle)}
|
|
150
|
-
<devtools-tooltip
|
|
151
|
-
id=${input.disclaimerTooltipId}
|
|
152
|
-
variant="rich"
|
|
153
|
-
jslogContext="ai-code-completion-disclaimer"
|
|
154
|
-
${Directives.ref(el => {
|
|
155
|
-
if (el instanceof HTMLElement) {
|
|
156
|
-
output.hideTooltip = () => {
|
|
157
|
-
el.hidePopover();
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
})}>
|
|
161
|
-
<div class="disclaimer-tooltip-container"><div class="tooltip-text">
|
|
162
|
-
${tooltipDisclaimerText}
|
|
163
|
-
</div>
|
|
164
|
-
<span
|
|
165
|
-
tabIndex="0"
|
|
166
|
-
class="link"
|
|
167
|
-
role="link"
|
|
168
|
-
jslog=${VisualLogging.link('open-ai-settings').track({
|
|
169
|
-
click: true,
|
|
170
|
-
keydown: 'Enter',
|
|
171
|
-
})}
|
|
172
|
-
@click=${input.onManageInSettingsTooltipClick}
|
|
173
|
-
@keydown=${(e: KeyboardEvent) => {
|
|
174
|
-
if (e.key === 'Enter') {
|
|
175
|
-
e.consume(true);
|
|
176
|
-
input.onManageInSettingsTooltipClick();
|
|
177
|
-
}
|
|
178
|
-
}}
|
|
179
|
-
>${lockedString(UIStringsNotTranslate.manageInSettings)}</span></div></devtools-tooltip>
|
|
180
138
|
</div>
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
139
|
+
</div>
|
|
140
|
+
</devtools-tooltip>
|
|
141
|
+
<span
|
|
142
|
+
tabIndex="0"
|
|
143
|
+
class="link"
|
|
144
|
+
role="link"
|
|
145
|
+
jslog=${VisualLogging.link('open-ai-settings').track({
|
|
146
|
+
click: true,
|
|
147
|
+
})}
|
|
148
|
+
aria-details=${input.disclaimerTooltipId}
|
|
149
|
+
aria-describedby=${input.disclaimerTooltipId}
|
|
150
|
+
@click=${() => {
|
|
151
|
+
void UI.ViewManager.ViewManager.instance().showView('chrome-ai');
|
|
152
|
+
}}
|
|
153
|
+
>
|
|
154
|
+
${lockedString(UIStringsNotTranslate.relevantData)}
|
|
155
|
+
</span>
|
|
156
|
+
${lockedString(UIStringsNotTranslate.isSentToGoogle)}
|
|
157
|
+
<devtools-tooltip
|
|
158
|
+
id=${input.disclaimerTooltipId}
|
|
159
|
+
variant="rich"
|
|
160
|
+
jslogContext="ai-code-completion-disclaimer"
|
|
161
|
+
${Directives.ref(el => {
|
|
162
|
+
if (el instanceof HTMLElement) {
|
|
163
|
+
output.hideTooltip = () => {
|
|
164
|
+
el.hidePopover();
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
})}
|
|
168
|
+
>
|
|
169
|
+
<div class="disclaimer-tooltip-container">
|
|
170
|
+
<div class="tooltip-text">
|
|
171
|
+
${tooltipDisclaimerText}
|
|
172
|
+
</div>
|
|
173
|
+
<span
|
|
174
|
+
tabIndex="0"
|
|
175
|
+
class="link"
|
|
176
|
+
role="link"
|
|
177
|
+
jslog=${VisualLogging.link('open-ai-settings').track({
|
|
178
|
+
click: true,
|
|
179
|
+
keydown: 'Enter',
|
|
180
|
+
})}
|
|
181
|
+
@click=${input.onManageInSettingsTooltipClick}
|
|
182
|
+
@keydown=${(e: KeyboardEvent) => {
|
|
183
|
+
if (e.key === 'Enter') {
|
|
184
|
+
e.consume(true);
|
|
185
|
+
input.onManageInSettingsTooltipClick();
|
|
186
|
+
}
|
|
187
|
+
}}
|
|
188
|
+
>
|
|
189
|
+
${lockedString(UIStringsNotTranslate.manageInSettings)}
|
|
190
|
+
</span>
|
|
191
|
+
</div>
|
|
192
|
+
</devtools-tooltip>
|
|
193
|
+
</div>`, target);
|
|
194
|
+
// clang-format on
|
|
195
|
+
};
|
|
184
196
|
|
|
185
197
|
const MINIMUM_LOADING_STATE_TIMEOUT = 1000;
|
|
186
198
|
|
|
@@ -194,7 +206,7 @@ export class AiCodeCompletionDisclaimer extends UI.Widget.Widget {
|
|
|
194
206
|
#loading = false;
|
|
195
207
|
#loadingStartTime = 0;
|
|
196
208
|
#spinnerLoadingTimeout: number|undefined;
|
|
197
|
-
#
|
|
209
|
+
#disclaimerTextVariant?: DisclaimerTextVariant;
|
|
198
210
|
|
|
199
211
|
#aidaAvailability?: Host.AidaClient.AidaAccessPreconditions;
|
|
200
212
|
#boundOnAidaAvailabilityChange:
|
|
@@ -246,8 +258,8 @@ export class AiCodeCompletionDisclaimer extends UI.Widget.Widget {
|
|
|
246
258
|
}
|
|
247
259
|
}
|
|
248
260
|
|
|
249
|
-
set
|
|
250
|
-
this.#
|
|
261
|
+
set disclaimerTextVariant(disclaimerTextVariant: DisclaimerTextVariant|undefined) {
|
|
262
|
+
this.#disclaimerTextVariant = disclaimerTextVariant;
|
|
251
263
|
this.requestUpdate();
|
|
252
264
|
}
|
|
253
265
|
|
|
@@ -268,16 +280,15 @@ export class AiCodeCompletionDisclaimer extends UI.Widget.Widget {
|
|
|
268
280
|
}
|
|
269
281
|
|
|
270
282
|
override performUpdate(): void {
|
|
271
|
-
this.#view(
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
this.#viewOutput, this.contentElement);
|
|
283
|
+
this.#view({
|
|
284
|
+
disclaimerTooltipId: this.#disclaimerTooltipId,
|
|
285
|
+
spinnerTooltipId: this.#spinnerTooltipId,
|
|
286
|
+
noLogging: this.#noLogging,
|
|
287
|
+
aidaAvailability: this.#aidaAvailability,
|
|
288
|
+
onManageInSettingsTooltipClick: this.#onManageInSettingsTooltipClick.bind(this),
|
|
289
|
+
disclaimerTextVariant: this.#disclaimerTextVariant,
|
|
290
|
+
},
|
|
291
|
+
this.#viewOutput, this.contentElement);
|
|
281
292
|
}
|
|
282
293
|
|
|
283
294
|
override wasShown(): void {
|
|
@@ -9,11 +9,10 @@ import '../../ui/kit/kit.js';
|
|
|
9
9
|
import type * as Common from '../../core/common/common.js';
|
|
10
10
|
import * as Host from '../../core/host/host.js';
|
|
11
11
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
12
|
-
import type * as AiCodeCompletion from '../../models/ai_code_completion/ai_code_completion.js';
|
|
13
12
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
14
13
|
import {Directives, html, nothing, render} from '../../ui/lit/lit.js';
|
|
15
14
|
|
|
16
|
-
import {AiCodeCompletionDisclaimer} from './AiCodeCompletionDisclaimer.js';
|
|
15
|
+
import {AiCodeCompletionDisclaimer, type DisclaimerTextVariant} from './AiCodeCompletionDisclaimer.js';
|
|
17
16
|
import styles from './aiCodeCompletionSummaryToolbar.css.js';
|
|
18
17
|
|
|
19
18
|
const UIStringsNotTranslate = {
|
|
@@ -35,7 +34,7 @@ export interface AiCodeCompletionSummaryToolbarProps {
|
|
|
35
34
|
disclaimerTooltipId?: string;
|
|
36
35
|
spinnerTooltipId?: string;
|
|
37
36
|
hasTopBorder?: boolean;
|
|
38
|
-
|
|
37
|
+
disclaimerTextVariant?: DisclaimerTextVariant;
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
export interface ViewInput {
|
|
@@ -46,7 +45,7 @@ export interface ViewInput {
|
|
|
46
45
|
loading: boolean;
|
|
47
46
|
hasTopBorder: boolean;
|
|
48
47
|
aidaAvailability?: Host.AidaClient.AidaAccessPreconditions;
|
|
49
|
-
|
|
48
|
+
disclaimerTextVariant?: DisclaimerTextVariant;
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
export type View = (input: ViewInput, output: undefined, target: HTMLElement) => void;
|
|
@@ -70,7 +69,7 @@ export const DEFAULT_SUMMARY_TOOLBAR_VIEW: View = (input, _output, target) => {
|
|
|
70
69
|
disclaimerTooltipId: input.disclaimerTooltipId,
|
|
71
70
|
spinnerTooltipId: input.spinnerTooltipId,
|
|
72
71
|
loading: input.loading,
|
|
73
|
-
|
|
72
|
+
disclaimerTextVariant: input.disclaimerTextVariant,
|
|
74
73
|
})} class="disclaimer-widget"></devtools-widget>` : nothing;
|
|
75
74
|
|
|
76
75
|
const recitationNotice = input.citations && input.citations.size > 0 ?
|
|
@@ -114,7 +113,7 @@ export class AiCodeCompletionSummaryToolbar extends UI.Widget.Widget {
|
|
|
114
113
|
#citations = new Set<string>();
|
|
115
114
|
#loading = false;
|
|
116
115
|
#hasTopBorder = false;
|
|
117
|
-
#
|
|
116
|
+
#disclaimerTextVariant?: DisclaimerTextVariant;
|
|
118
117
|
|
|
119
118
|
#aidaAvailability?: Host.AidaClient.AidaAccessPreconditions;
|
|
120
119
|
#boundOnAidaAvailabilityChange:
|
|
@@ -126,7 +125,7 @@ export class AiCodeCompletionSummaryToolbar extends UI.Widget.Widget {
|
|
|
126
125
|
this.#spinnerTooltipId = props.spinnerTooltipId;
|
|
127
126
|
this.#citationsTooltipId = props.citationsTooltipId;
|
|
128
127
|
this.#hasTopBorder = props.hasTopBorder ?? false;
|
|
129
|
-
this.#
|
|
128
|
+
this.#disclaimerTextVariant = props.disclaimerTextVariant;
|
|
130
129
|
this.#boundOnAidaAvailabilityChange = this.#onAidaAvailabilityChange.bind(this);
|
|
131
130
|
this.#view = view ?? DEFAULT_SUMMARY_TOOLBAR_VIEW;
|
|
132
131
|
this.requestUpdate();
|
|
@@ -159,18 +158,17 @@ export class AiCodeCompletionSummaryToolbar extends UI.Widget.Widget {
|
|
|
159
158
|
}
|
|
160
159
|
|
|
161
160
|
override performUpdate(): void {
|
|
162
|
-
this.#view(
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
undefined, this.contentElement);
|
|
161
|
+
this.#view({
|
|
162
|
+
disclaimerTooltipId: this.#disclaimerTooltipId,
|
|
163
|
+
spinnerTooltipId: this.#spinnerTooltipId,
|
|
164
|
+
citations: this.#citations,
|
|
165
|
+
citationsTooltipId: this.#citationsTooltipId,
|
|
166
|
+
loading: this.#loading,
|
|
167
|
+
hasTopBorder: this.#hasTopBorder,
|
|
168
|
+
aidaAvailability: this.#aidaAvailability,
|
|
169
|
+
disclaimerTextVariant: this.#disclaimerTextVariant,
|
|
170
|
+
},
|
|
171
|
+
undefined, this.contentElement);
|
|
174
172
|
}
|
|
175
173
|
|
|
176
174
|
override wasShown(): void {
|
|
@@ -9,13 +9,13 @@ import * as Host from '../../core/host/host.js';
|
|
|
9
9
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
10
10
|
import * as Root from '../../core/root/root.js';
|
|
11
11
|
import * as AIAssistance from '../../models/ai_assistance/ai_assistance.js';
|
|
12
|
-
import * as AiCodeCompletion from '../../models/ai_code_completion/ai_code_completion.js';
|
|
13
12
|
import * as AiCodeGeneration from '../../models/ai_code_generation/ai_code_generation.js';
|
|
14
13
|
import * as Snackbars from '../../ui/components/snackbars/snackbars.js';
|
|
15
14
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
16
15
|
import {html, type LitTemplate, nothing, render} from '../../ui/lit/lit.js';
|
|
17
16
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
18
17
|
|
|
18
|
+
import type {DisclaimerTextVariant} from './AiCodeCompletionDisclaimer.js';
|
|
19
19
|
import styles from './aiCodeCompletionTeaser.css.js';
|
|
20
20
|
import {FreDialog} from './FreDialog.js';
|
|
21
21
|
|
|
@@ -164,7 +164,7 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
164
164
|
|
|
165
165
|
interface AiCodeCompletionTeaserConfig {
|
|
166
166
|
onDetach: () => void;
|
|
167
|
-
|
|
167
|
+
disclaimerTextVariant?: DisclaimerTextVariant;
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
export class AiCodeCompletionTeaser extends UI.Widget.Widget {
|
|
@@ -175,7 +175,7 @@ export class AiCodeCompletionTeaser extends UI.Widget.Widget {
|
|
|
175
175
|
(ev: Common.EventTarget.EventTargetEvent<Host.AidaClient.AidaAccessPreconditions>) => void;
|
|
176
176
|
#boundOnAiCodeCompletionSettingChanged: () => void;
|
|
177
177
|
#onDetach: () => void;
|
|
178
|
-
#
|
|
178
|
+
#disclaimerTextVariant?: DisclaimerTextVariant;
|
|
179
179
|
|
|
180
180
|
// Whether the user completed first run experience dialog or not.
|
|
181
181
|
#aiCodeCompletionFreCompletedSetting =
|
|
@@ -190,7 +190,7 @@ export class AiCodeCompletionTeaser extends UI.Widget.Widget {
|
|
|
190
190
|
super();
|
|
191
191
|
this.markAsExternallyManaged();
|
|
192
192
|
this.#onDetach = config.onDetach;
|
|
193
|
-
this.#
|
|
193
|
+
this.#disclaimerTextVariant = config.disclaimerTextVariant;
|
|
194
194
|
this.#view = view ?? DEFAULT_VIEW;
|
|
195
195
|
this.#boundOnAidaAvailabilityChange = this.#onAidaAvailabilityChange.bind(this);
|
|
196
196
|
this.#boundOnAiCodeCompletionSettingChanged = this.#onAiCodeCompletionSettingChanged.bind(this);
|
|
@@ -291,9 +291,9 @@ export class AiCodeCompletionTeaser extends UI.Widget.Widget {
|
|
|
291
291
|
|
|
292
292
|
if (result) {
|
|
293
293
|
this.#aiCodeCompletionFreCompletedSetting.set(true);
|
|
294
|
-
if (this.#
|
|
294
|
+
if (this.#disclaimerTextVariant === 'console') {
|
|
295
295
|
Host.userMetrics.actionTaken(Host.UserMetrics.Action.AiCodeCompletionFreCompletedFromConsole);
|
|
296
|
-
} else if (this.#
|
|
296
|
+
} else if (this.#disclaimerTextVariant === 'sources') {
|
|
297
297
|
Host.userMetrics.actionTaken(Host.UserMetrics.Action.AiCodeCompletionFreCompletedFromSources);
|
|
298
298
|
}
|
|
299
299
|
this.detach();
|
|
@@ -7,12 +7,12 @@ import * as Common from '../../core/common/common.js';
|
|
|
7
7
|
import * as Host from '../../core/host/host.js';
|
|
8
8
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
9
9
|
import * as Root from '../../core/root/root.js';
|
|
10
|
-
import * as AiCodeCompletion from '../../models/ai_code_completion/ai_code_completion.js';
|
|
11
10
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
12
11
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
13
12
|
import {Directives, html, nothing, render} from '../../ui/lit/lit.js';
|
|
14
13
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
15
14
|
|
|
15
|
+
import type {DisclaimerTextVariant} from './AiCodeCompletionDisclaimer.js';
|
|
16
16
|
import styles from './aiCodeGenerationTeaser.css.js';
|
|
17
17
|
|
|
18
18
|
const UIStringsNotTranslate = {
|
|
@@ -137,17 +137,17 @@ export enum AiCodeGenerationTeaserDisplayState {
|
|
|
137
137
|
GENERATED = 'generated',
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
function getTooltipDisclaimerText(noLogging: boolean,
|
|
141
|
-
switch (
|
|
142
|
-
case
|
|
140
|
+
function getTooltipDisclaimerText(noLogging: boolean, disclaimerTextVariant: DisclaimerTextVariant): string {
|
|
141
|
+
switch (disclaimerTextVariant) {
|
|
142
|
+
case 'console':
|
|
143
143
|
return noLogging ?
|
|
144
144
|
lockedString(UIStringsNotTranslate.tooltipDisclaimerTextForAiCodeGenerationNoLoggingInConsole) :
|
|
145
145
|
lockedString(UIStringsNotTranslate.tooltipDisclaimerTextForAiCodeGenerationInConsole);
|
|
146
|
-
case
|
|
146
|
+
case 'sources':
|
|
147
147
|
return noLogging ?
|
|
148
148
|
lockedString(UIStringsNotTranslate.tooltipDisclaimerTextForAiCodeGenerationNoLoggingInSources) :
|
|
149
149
|
lockedString(UIStringsNotTranslate.tooltipDisclaimerTextForAiCodeGenerationInSources);
|
|
150
|
-
case
|
|
150
|
+
case 'styles':
|
|
151
151
|
// TODO(476101019): update with string for styles pane
|
|
152
152
|
return '';
|
|
153
153
|
}
|
|
@@ -160,8 +160,7 @@ export interface ViewInput {
|
|
|
160
160
|
onManageInSettingsTooltipClick: (event: Event) => void;
|
|
161
161
|
showDataUsageTeaser: boolean;
|
|
162
162
|
showDiscoveryTeaser: boolean;
|
|
163
|
-
|
|
164
|
-
panel?: AiCodeCompletion.AiCodeCompletion.ContextFlavor;
|
|
163
|
+
disclaimerTextVariant?: DisclaimerTextVariant;
|
|
165
164
|
}
|
|
166
165
|
|
|
167
166
|
export interface ViewOutput {
|
|
@@ -173,7 +172,7 @@ export interface ViewOutput {
|
|
|
173
172
|
export type View = (input: ViewInput, output: ViewOutput, target: HTMLElement) => void;
|
|
174
173
|
|
|
175
174
|
export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
176
|
-
if (!input.
|
|
175
|
+
if (!input.disclaimerTextVariant) {
|
|
177
176
|
render(nothing, target);
|
|
178
177
|
return;
|
|
179
178
|
}
|
|
@@ -207,7 +206,7 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
207
206
|
html`${toGenerateCode}. ${toLearnHowYourDataIsBeingUsedVisible}` :
|
|
208
207
|
toGenerateCode;
|
|
209
208
|
|
|
210
|
-
const tooltipDisclaimerText = getTooltipDisclaimerText(input.noLogging, input.
|
|
209
|
+
const tooltipDisclaimerText = getTooltipDisclaimerText(input.noLogging, input.disclaimerTextVariant);
|
|
211
210
|
|
|
212
211
|
// clang-format off
|
|
213
212
|
teaserLabel = html`<div class="ai-code-generation-teaser-trigger">
|
|
@@ -265,7 +264,7 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
265
264
|
break;
|
|
266
265
|
}
|
|
267
266
|
const newBadge = UI.UIUtils.maybeCreateNewBadge(PROMOTION_ID);
|
|
268
|
-
const teaserText = input.
|
|
267
|
+
const teaserText = input.disclaimerTextVariant === 'console' ?
|
|
269
268
|
lockedString(UIStringsNotTranslate.writeACommentToGenerateCodeInConsole) :
|
|
270
269
|
lockedString(UIStringsNotTranslate.writeACommentToGenerateCode);
|
|
271
270
|
teaserLabel = newBadge ? html`${teaserText} ${newBadge}` : nothing;
|
|
@@ -326,7 +325,7 @@ export class AiCodeGenerationTeaser extends UI.Widget.Widget {
|
|
|
326
325
|
#displayState = AiCodeGenerationTeaserDisplayState.DISCOVERY;
|
|
327
326
|
#disclaimerTooltipId?: string;
|
|
328
327
|
#noLogging: boolean; // Whether the enterprise setting is `ALLOW_WITHOUT_LOGGING` or not.
|
|
329
|
-
#
|
|
328
|
+
#disclaimerTextVariant?: DisclaimerTextVariant;
|
|
330
329
|
#timerIntervalId?: number;
|
|
331
330
|
#loadStartTime?: number;
|
|
332
331
|
#aiCodeGenerationUsedSetting = Common.Settings.Settings.instance().createSetting('ai-code-generation-used', false);
|
|
@@ -343,18 +342,17 @@ export class AiCodeGenerationTeaser extends UI.Widget.Widget {
|
|
|
343
342
|
}
|
|
344
343
|
|
|
345
344
|
override performUpdate(): void {
|
|
346
|
-
this.#view(
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
this.#viewOutput, this.contentElement);
|
|
345
|
+
this.#view({
|
|
346
|
+
displayState: this.#displayState,
|
|
347
|
+
onManageInSettingsTooltipClick: this.#onManageInSettingsTooltipClick.bind(this),
|
|
348
|
+
disclaimerTooltipId: this.#disclaimerTooltipId,
|
|
349
|
+
noLogging: this.#noLogging,
|
|
350
|
+
showDataUsageTeaser: AiCodeGenerationTeaser.#showDataUsageTeaser,
|
|
351
|
+
showDiscoveryTeaser:
|
|
352
|
+
!this.#aiCodeGenerationUsedSetting.get() && !AiCodeGenerationTeaser.#discoveryTeaserShownInSession,
|
|
353
|
+
disclaimerTextVariant: this.#disclaimerTextVariant,
|
|
354
|
+
},
|
|
355
|
+
this.#viewOutput, this.contentElement);
|
|
358
356
|
}
|
|
359
357
|
|
|
360
358
|
override willHide(): void {
|
|
@@ -415,8 +413,8 @@ export class AiCodeGenerationTeaser extends UI.Widget.Widget {
|
|
|
415
413
|
this.requestUpdate();
|
|
416
414
|
}
|
|
417
415
|
|
|
418
|
-
set
|
|
419
|
-
this.#
|
|
416
|
+
set disclaimerTextVariant(disclaimerTextVariant: DisclaimerTextVariant) {
|
|
417
|
+
this.#disclaimerTextVariant = disclaimerTextVariant;
|
|
420
418
|
this.requestUpdate();
|
|
421
419
|
}
|
|
422
420
|
|
|
@@ -434,4 +432,8 @@ export class AiCodeGenerationTeaser extends UI.Widget.Widget {
|
|
|
434
432
|
static setDiscoveryTeaserShownInSessionForTest(value: boolean): void {
|
|
435
433
|
AiCodeGenerationTeaser.#discoveryTeaserShownInSession = value;
|
|
436
434
|
}
|
|
435
|
+
|
|
436
|
+
static setShowDataUsageTeaserForTest(value: boolean): void {
|
|
437
|
+
AiCodeGenerationTeaser.#showDataUsageTeaser = value;
|
|
438
|
+
}
|
|
437
439
|
}
|
|
@@ -100,7 +100,7 @@ export {AiCodeGenerationUpgradeDialog} from './AiCodeGenerationUpgradeDialog.js'
|
|
|
100
100
|
export {FreDialog} from './FreDialog.js';
|
|
101
101
|
export {GdpSignUpDialog} from './GdpSignUpDialog.js';
|
|
102
102
|
export {GeminiRebrandPromoDialog} from './GeminiRebrandPromoDialog.js';
|
|
103
|
-
export {AiCodeCompletionDisclaimer} from './AiCodeCompletionDisclaimer.js';
|
|
103
|
+
export {AiCodeCompletionDisclaimer, type DisclaimerTextVariant} from './AiCodeCompletionDisclaimer.js';
|
|
104
104
|
export * as AiCodeCompletionSummaryToolbar from './AiCodeCompletionSummaryToolbar.js';
|
|
105
105
|
export * from './BadgeNotification.js';
|
|
106
106
|
export * as CPUThrottlingOption from './CPUThrottlingOption.js';
|
|
@@ -420,7 +420,8 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
|
|
|
420
420
|
#callShowTooltip = false;
|
|
421
421
|
#startTime = 0;
|
|
422
422
|
|
|
423
|
-
constructor(uuid: string, consoleViewMessage: ConsoleViewMessage, element?: HTMLElement, view?: View
|
|
423
|
+
constructor(uuid: string, consoleViewMessage: ConsoleViewMessage, element?: HTMLElement, view?: View,
|
|
424
|
+
builtInAi: AiAssistanceModel.BuiltInAi.BuiltInAi = AiAssistanceModel.BuiltInAi.BuiltInAi.instance()) {
|
|
424
425
|
super(element);
|
|
425
426
|
this.#view = view ?? DEFAULT_VIEW;
|
|
426
427
|
this.#uuid = uuid;
|
|
@@ -430,19 +431,16 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
|
|
|
430
431
|
this.#boundOnAidaAvailabilityChange = this.#onAidaAvailabilityChange.bind(this);
|
|
431
432
|
this.#boundOnDownloadProgressChange = this.#onDownloadProgressChange.bind(this);
|
|
432
433
|
this.#boundOnSessionCreation = this.#onSessionCreation.bind(this);
|
|
433
|
-
this.#builtInAi =
|
|
434
|
+
this.#builtInAi = builtInAi;
|
|
434
435
|
this.#state = this.#builtInAi.hasSession() ? State.READY : State.NO_MODEL;
|
|
435
436
|
this.#callShowTooltip = true;
|
|
436
437
|
this.requestUpdate();
|
|
437
438
|
}
|
|
438
439
|
|
|
439
440
|
#getConsoleInsightsEnabledSetting(): Common.Settings.Setting<boolean>|undefined {
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
} catch {
|
|
444
|
-
return;
|
|
445
|
-
}
|
|
441
|
+
const result = Common.Settings.Settings.instance().maybeResolve(
|
|
442
|
+
AiAssistanceModel.AiUtils.consoleInsightsEnabledSettingDescriptor);
|
|
443
|
+
return 'setting' in result ? (result.setting as Common.Settings.Setting<boolean>) : undefined;
|
|
446
444
|
}
|
|
447
445
|
|
|
448
446
|
#getOnboardingCompletedSetting(): Common.Settings.Setting<boolean> {
|
|
@@ -492,7 +492,8 @@ export class ConsoleView extends UI.Widget.VBox implements
|
|
|
492
492
|
UI.ARIAUtils.markAsGroup(settingsPane);
|
|
493
493
|
|
|
494
494
|
const consoleEagerEvalSetting = Common.Settings.Settings.instance().moduleSetting('console-eager-eval');
|
|
495
|
-
const preserveConsoleLogSetting =
|
|
495
|
+
const preserveConsoleLogSetting =
|
|
496
|
+
Common.Settings.Settings.instance().resolve(SDK.SDKSettings.preserveConsoleLogSettingDescriptor);
|
|
496
497
|
const userActivationEvalSetting = Common.Settings.Settings.instance().moduleSetting('console-user-activation-eval');
|
|
497
498
|
settingsPane.append(
|
|
498
499
|
SettingsUI.SettingsUI.createSettingCheckbox(
|
|
@@ -601,7 +602,8 @@ export class ConsoleView extends UI.Widget.VBox implements
|
|
|
601
602
|
onSuggestionAccepted: this.#onAiCodeCompletionSuggestionAccepted.bind(this),
|
|
602
603
|
onRequestTriggered: this.#onAiCodeCompletionRequestTriggered.bind(this),
|
|
603
604
|
onResponseReceived: this.#onAiCodeCompletionResponseReceived.bind(this),
|
|
604
|
-
|
|
605
|
+
disclaimerTooltipId: 'console-ai-code-generation-disclaimer-tooltip',
|
|
606
|
+
disclaimerTextVariant: 'console',
|
|
605
607
|
} :
|
|
606
608
|
undefined;
|
|
607
609
|
|
|
@@ -678,7 +680,7 @@ export class ConsoleView extends UI.Widget.VBox implements
|
|
|
678
680
|
citationsTooltipId: CITATIONS_TOOLTIP_ID,
|
|
679
681
|
disclaimerTooltipId: DISCLAIMER_TOOLTIP_ID,
|
|
680
682
|
spinnerTooltipId: SPINNER_TOOLTIP_ID,
|
|
681
|
-
|
|
683
|
+
disclaimerTextVariant: 'console',
|
|
682
684
|
});
|
|
683
685
|
this.aiCodeCompletionSummaryToolbarContainer =
|
|
684
686
|
this.element.createChild('div', 'ai-code-completion-summary-toolbar-container');
|
|
@@ -775,7 +777,7 @@ export class ConsoleView extends UI.Widget.VBox implements
|
|
|
775
777
|
}
|
|
776
778
|
|
|
777
779
|
modelRemoved(model: SDK.ConsoleModel.ConsoleModel): void {
|
|
778
|
-
if (!Common.Settings.Settings.instance().
|
|
780
|
+
if (!Common.Settings.Settings.instance().resolve(SDK.SDKSettings.preserveConsoleLogSettingDescriptor).get() &&
|
|
779
781
|
model.target().outermostTarget() === model.target()) {
|
|
780
782
|
this.consoleCleared();
|
|
781
783
|
}
|
|
@@ -433,7 +433,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
|
433
433
|
case Protocol.Runtime.ConsoleAPICalledEventType.Clear:
|
|
434
434
|
messageElement = document.createElement('span');
|
|
435
435
|
messageElement.classList.add('console-info');
|
|
436
|
-
if (Common.Settings.Settings.instance().
|
|
436
|
+
if (Common.Settings.Settings.instance().resolve(SDK.SDKSettings.preserveConsoleLogSettingDescriptor).get()) {
|
|
437
437
|
messageElement.textContent = i18nString(UIStrings.consoleclearWasPreventedDueTo);
|
|
438
438
|
} else {
|
|
439
439
|
messageElement.textContent = i18nString(UIStrings.consoleWasCleared);
|