1010 * SPDX-License-Identifier: MIT
1111 */
1212
13- import { stage as stageFromEnvironment } from "./environment" ;
13+ import { Stage , stage as stageFromEnvironment } from "./environment" ;
1414
1515/**
1616 * A union of the flag names (alphabetical order).
1717 */
1818export type Flag =
19- /**
20- * Enables a preview of SoundEffects via the audio-sound-effect MicroPython branch.
21- */
22- | "audioSoundEffect"
23-
2419 /**
2520 * Enables verbose debug logging to the console of drag events.
2621 */
2722 | "dndDebug"
2823
2924 /**
30- * Flag to enable live-only features and hide beta only ones.
31- *
32- * We'll remove this when we go live.
25+ * Flag to add a beta notice. Enabled for staging site but not production stages.
3326 */
34- | "livePreview "
27+ | "betaNotice "
3528
3629 /**
3730 * Disables the pop-up welcome dialog.
@@ -42,22 +35,21 @@ export type Flag =
4235 | "noWelcome" ;
4336
4437interface FlagMetadata {
45- defaultOnStages : string [ ] ;
38+ defaultOnStages : Stage [ ] ;
4639 name : Flag ;
4740}
4841
4942const allFlags : FlagMetadata [ ] = [
5043 // Alphabetical order.
51- { name : "audioSoundEffect" , defaultOnStages : [ ] } ,
5244 { name : "dndDebug" , defaultOnStages : [ ] } ,
53- { name : "livePreview " , defaultOnStages : [ "local" , "REVIEW" ] } ,
45+ { name : "betaNotice " , defaultOnStages : [ "local" , "REVIEW" , "STAGING "] } ,
5446 { name : "noWelcome" , defaultOnStages : [ "local" , "REVIEW" ] } ,
5547] ;
5648
5749type Flags = Record < Flag , boolean > ;
5850
5951// Exposed for testing.
60- export const flagsForParams = ( stage : string , params : URLSearchParams ) => {
52+ export const flagsForParams = ( stage : Stage , params : URLSearchParams ) => {
6153 const enableFlags = new Set ( params . getAll ( "flag" ) ) ;
6254 const allFlagsDefault = enableFlags . has ( "none" )
6355 ? false
@@ -74,7 +66,7 @@ export const flagsForParams = (stage: string, params: URLSearchParams) => {
7466
7567const isEnabled = (
7668 f : FlagMetadata ,
77- stage : string ,
69+ stage : Stage ,
7870 allFlagsDefault : boolean | undefined ,
7971 thisFlagOn : boolean
8072) : boolean => {
0 commit comments