Stop using experiment flag for Token Highlighting This has now been turned on to 100% for a couple of weeks so it's time to retire the experiment flag. Google-Bug-Id: b/200015397 Change-Id: Idf667deb1b97a0c8467c7702b40a17b5622971c3
diff --git a/polygerrit-ui/app/elements/diff/gr-apply-fix-dialog/gr-apply-fix-dialog.ts b/polygerrit-ui/app/elements/diff/gr-apply-fix-dialog/gr-apply-fix-dialog.ts index f5072b9..a6176e1 100644 --- a/polygerrit-ui/app/elements/diff/gr-apply-fix-dialog/gr-apply-fix-dialog.ts +++ b/polygerrit-ui/app/elements/diff/gr-apply-fix-dialog/gr-apply-fix-dialog.ts
@@ -41,7 +41,6 @@ import {DiffLayer, ParsedChangeInfo} from '../../../types/types'; import {GrButton} from '../../shared/gr-button/gr-button'; import {TokenHighlightLayer} from '../gr-diff-builder/token-highlight-layer'; -import {KnownExperimentId} from '../../../services/flags/flags'; export interface GrApplyFixDialog { $: { @@ -109,10 +108,7 @@ constructor() { super(); this.restApiService.getPreferences().then(prefs => { - if ( - !prefs?.disable_token_highlighting && - appContext.flagsService.isEnabled(KnownExperimentId.TOKEN_HIGHLIGHTING) - ) { + if (!prefs?.disable_token_highlighting) { this.layers = [new TokenHighlightLayer(this)]; } });
diff --git a/polygerrit-ui/app/elements/diff/gr-diff-host/gr-diff-host.ts b/polygerrit-ui/app/elements/diff/gr-diff-host/gr-diff-host.ts index b1bad1c..59bd817 100644 --- a/polygerrit-ui/app/elements/diff/gr-diff-host/gr-diff-host.ts +++ b/polygerrit-ui/app/elements/diff/gr-diff-host/gr-diff-host.ts
@@ -332,9 +332,7 @@ const preferencesPromise = appContext.restApiService.getPreferences(); await getPluginLoader().awaitPluginsLoaded(); const prefs = await preferencesPromise; - const enableTokenHighlight = - appContext.flagsService.isEnabled(KnownExperimentId.TOKEN_HIGHLIGHTING) && - !prefs?.disable_token_highlighting; + const enableTokenHighlight = !prefs?.disable_token_highlighting; assertIsDefined(this.path, 'path'); this._layers = this.getLayers(this.path, enableTokenHighlight);
diff --git a/polygerrit-ui/app/elements/diff/gr-diff-host/gr-diff-host_test.js b/polygerrit-ui/app/elements/diff/gr-diff-host/gr-diff-host_test.js index 8901636..6facdca 100644 --- a/polygerrit-ui/app/elements/diff/gr-diff-host/gr-diff-host_test.js +++ b/polygerrit-ui/app/elements/diff/gr-diff-host/gr-diff-host_test.js
@@ -1304,7 +1304,7 @@ test('gr-diff-host provides syntax highlighting layer', async () => { stubRestApi('getDiff').returns(Promise.resolve({content: []})); await element.reload(); - assert.equal(element.$.diff.layers[0], element.syntaxLayer); + assert.equal(element.$.diff.layers[1], element.syntaxLayer); }); test('rendering normal-sized diff does not disable syntax', () => { @@ -1358,7 +1358,7 @@ test('gr-diff-host provides syntax highlighting layer', async () => { stubRestApi('getDiff').returns(Promise.resolve({content: []})); await element.reload(); - assert.equal(element.$.diff.layers[0], element.syntaxLayer); + assert.equal(element.$.diff.layers[1], element.syntaxLayer); }); test('syntax layer should be disabled', () => {
diff --git a/polygerrit-ui/app/elements/shared/gr-comment-thread/gr-comment-thread.ts b/polygerrit-ui/app/elements/shared/gr-comment-thread/gr-comment-thread.ts index 6b2e5c4..3f8264b 100644 --- a/polygerrit-ui/app/elements/shared/gr-comment-thread/gr-comment-thread.ts +++ b/polygerrit-ui/app/elements/shared/gr-comment-thread/gr-comment-thread.ts
@@ -55,7 +55,6 @@ import {PolymerDeepPropertyChange} from '@polymer/polymer/interfaces'; import {FILE, LineNumber} from '../../diff/gr-diff/gr-diff-line'; import {GrButton} from '../gr-button/gr-button'; -import {KnownExperimentId} from '../../../services/flags/flags'; import {DiffInfo, DiffPreferencesInfo} from '../../../types/diff'; import {DiffLayer, RenderPreferences} from '../../../api/diff'; import { @@ -206,8 +205,6 @@ private readonly reporting = appContext.reportingService; - private readonly flagsService = appContext.flagsService; - private readonly commentsService = appContext.commentsService; readonly storage = appContext.storageService; @@ -370,10 +367,7 @@ } _initLayers(disableTokenHighlighting: boolean) { - if ( - this.flagsService.isEnabled(KnownExperimentId.TOKEN_HIGHLIGHTING) && - !disableTokenHighlighting - ) { + if (!disableTokenHighlighting) { this.layers.push(new TokenHighlightLayer(this)); } this.layers.push(this.syntaxLayer);
diff --git a/polygerrit-ui/app/services/flags/flags.ts b/polygerrit-ui/app/services/flags/flags.ts index 2839874..863f95f 100644 --- a/polygerrit-ui/app/services/flags/flags.ts +++ b/polygerrit-ui/app/services/flags/flags.ts
@@ -25,7 +25,6 @@ */ export enum KnownExperimentId { NEW_IMAGE_DIFF_UI = 'UiFeature__new_image_diff_ui', - TOKEN_HIGHLIGHTING = 'UiFeature__token_highlighting', CHECKS_DEVELOPER = 'UiFeature__checks_developer', SUBMIT_REQUIREMENTS_UI = 'UiFeature__submit_requirements_ui', }