|
4 | 4 | /* eslint-disable @devtools/no-imperative-dom-api */ |
5 | 5 |
|
6 | 6 | import type * as Common from '../../core/common/common.js'; |
| 7 | +import * as Host from '../../core/host/host.js'; |
| 8 | +import type * as Platform from '../../core/platform/platform.js'; |
7 | 9 | import * as SDK from '../../core/sdk/sdk.js'; |
8 | 10 | import type * as Protocol from '../../generated/protocol.js'; |
9 | 11 | import * as UI from '../../ui/legacy/legacy.js'; |
@@ -186,7 +188,34 @@ export class GreenDevPanel extends UI.Panel.Panel { |
186 | 188 |
|
187 | 189 | const disclaimer = document.createElement('div'); |
188 | 190 | disclaimer.className = 'green-dev-floaty-disclaimer'; |
189 | | - disclaimer.textContent = 'Relevant data is sent to Google'; |
| 191 | + |
| 192 | + const link = document.createElement('span'); |
| 193 | + link.className = 'disclaimer-link'; |
| 194 | + link.textContent = 'Relevant data'; |
| 195 | + disclaimer.appendChild(link); |
| 196 | + |
| 197 | + disclaimer.appendChild(document.createTextNode(' is sent to Google')); |
| 198 | + |
| 199 | + const tooltip = document.createElement('div'); |
| 200 | + tooltip.className = 'disclaimer-tooltip'; |
| 201 | + |
| 202 | + tooltip.appendChild(document.createTextNode( |
| 203 | + 'Chat messages and any data the inspected page can access via Web APIs are sent to Google and may be seen by human reviewers to improve this feature. This is an experimental AI feature and won\'t always get it right.')); |
| 204 | + tooltip.appendChild(document.createElement('br')); |
| 205 | + tooltip.appendChild(document.createElement('br')); |
| 206 | + |
| 207 | + const learnMore = document.createElement('a'); |
| 208 | + const href = 'https://developer.chrome.com/docs/devtools/ai-assistance' as Platform.DevToolsPath.UrlString; |
| 209 | + learnMore.href = href; |
| 210 | + learnMore.className = 'learn-more-link'; |
| 211 | + learnMore.textContent = 'Learn about AI in DevTools'; |
| 212 | + learnMore.addEventListener('click', event => { |
| 213 | + event.preventDefault(); |
| 214 | + Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(href); |
| 215 | + }); |
| 216 | + tooltip.appendChild(learnMore); |
| 217 | + |
| 218 | + disclaimer.appendChild(tooltip); |
190 | 219 | blueCard.appendChild(disclaimer); |
191 | 220 |
|
192 | 221 | content.appendChild(blueCard); |
|
0 commit comments