Skip to content

Commit 4d79dad

Browse files
jackfranklinDevtools-frontend LUCI CQ
authored andcommitted
RPP: hide auto-annotations behind feature flag
Bug: none Change-Id: I44314f07516a6444b18bfc877efb1e0c0488fac8 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6383675 Reviewed-by: Andres Olivares <andoli@chromium.org> Auto-Submit: Jack Franklin <jacktfranklin@chromium.org> Commit-Queue: Andres Olivares <andoli@chromium.org> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
1 parent 0eebfab commit 4d79dad

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,11 @@ export class EntryLabelOverlay extends HTMLElement {
597597
}
598598

599599
#render(): void {
600+
const hasAiExperiment = Boolean(Root.Runtime.hostConfig.devToolsAiGeneratedTimelineLabels?.enabled);
600601
const aiDisabledByEnterprisePolicy = Root.Runtime.hostConfig.aidaAvailability?.enterprisePolicyValue ===
601602
Root.Runtime.GenAiEnterprisePolicyValue.DISABLE;
603+
604+
const doNotShowAIButton = !hasAiExperiment || aiDisabledByEnterprisePolicy;
602605
// clang-format off
603606
Lit.render(
604607
html`
@@ -617,9 +620,9 @@ export class EntryLabelOverlay extends HTMLElement {
617620
jslog=${VisualLogging.textField('timeline.annotations.entry-label-input').track({keydown: true, click: true})}
618621
></span>
619622
${
620-
// If the enterprise policy is disabled, do not render anything. If it is enabled, render either the
621-
// enabled or disabled ai button depending on whether the feature is available.
622-
aiDisabledByEnterprisePolicy ? Lit.nothing
623+
// If the enterprise policy is disabled or the user does not have the feature flag, do not render anything.
624+
// If it is enabled, render either the enabled or disabled ai button depending on whether the feature is available.
625+
doNotShowAIButton ? Lit.nothing
623626
: this.#isAiAvailable() ? this.#renderAiButton(): this.#renderDisabledAiButton()
624627
}
625628
</span>

0 commit comments

Comments
 (0)