Skip to content

Commit ce37d1d

Browse files
ergunshDevtools-frontend LUCI CQ
authored andcommitted
[PatchWidget] Navigate to settings on "Learn more" click
Bug: 403246254 Change-Id: I71f624062abb6ddb26fe211987274bf702113017 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6352458 Commit-Queue: Ergün Erdoğmuş <[email protected]> Commit-Queue: Alex Rudenko <[email protected]> Auto-Submit: Ergün Erdoğmuş <[email protected]> Reviewed-by: Alex Rudenko <[email protected]>
1 parent 8be47c2 commit ce37d1d

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

front_end/panels/ai_assistance/PatchWidget.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import '../../ui/components/tooltips/tooltips.js';
1010
import * as Common from '../../core/common/common.js';
1111
import * as Host from '../../core/host/host.js';
1212
import * as i18n from '../../core/i18n/i18n.js';
13-
import * as Platform from '../../core/platform/platform.js';
13+
import type * as Platform from '../../core/platform/platform.js';
1414
import * as Root from '../../core/root/root.js';
1515
import * as Persistence from '../../models/persistence/persistence.js';
1616
import * as Workspace from '../../models/workspace/workspace.js';
@@ -431,8 +431,9 @@ export class PatchWidget extends UI.Widget.Widget {
431431
// clang-format on
432432
}
433433
],
434-
// TODO: Update this href to be the correct link.
435-
learnMoreHref: Platform.DevToolsPath.EmptyUrlString
434+
onLearnMoreClick: () => {
435+
void UI.ViewManager.ViewManager.instance().showView('chrome-ai');
436+
}
436437
});
437438

438439
if (result) {

front_end/panels/common/common.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class FreDialog {
4343
static show({
4444
header,
4545
reminderItems,
46-
learnMoreHref,
46+
onLearnMoreClick,
4747
}: {
4848
header: {
4949
iconName: string,
@@ -53,7 +53,7 @@ export class FreDialog {
5353
iconName: string,
5454
content: Platform.UIString.LocalizedString|Lit.LitTemplate,
5555
}>,
56-
learnMoreHref: Platform.DevToolsPath.UrlString,
56+
onLearnMoreClick: () => void,
5757
}): Promise<boolean> {
5858
const dialog = new UI.Dialog.Dialog();
5959
const result = Promise.withResolvers<boolean>();
@@ -82,7 +82,7 @@ export class FreDialog {
8282
</main>
8383
<footer>
8484
<devtools-button
85-
@click=${() => UI.UIUtils.openInNewTab(learnMoreHref)}
85+
@click=${onLearnMoreClick}
8686
.jslogContext=${'fre-disclaimer.learn-more'}
8787
.variant=${Buttons.Button.Variant.OUTLINED}>
8888
${i18nString(UIStrings.learnMore)}

front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,8 @@ export class EntryLabelOverlay extends HTMLElement {
429429
// clang-format on
430430
}
431431
],
432-
// TODO: Update this href to be the correct link.
433-
learnMoreHref: Platform.DevToolsPath.EmptyUrlString
432+
// TODO: Update this to handle learn more click.
433+
onLearnMoreClick: () => {}
434434
});
435435

436436
if (userConsented) {

0 commit comments

Comments
 (0)