Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jon/ab/create-login-buttons #4473

Merged
merged 4 commits into from
Sep 26, 2023
Merged

Jon/ab/create-login-buttons #4473

merged 4 commits into from
Sep 26, 2023

Conversation

Jon-edge
Copy link
Collaborator

@Jon-edge Jon-edge commented Sep 20, 2023

CHANGELOG

  • added: Experiment config support between gui and login-ui
  • added: Experiment config for "Create Account" button labels

Dependencies

#4469

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

@Jon-edge Jon-edge force-pushed the jon/ab/create-login-buttons branch 3 times, most recently from 45ebbfc to 3603a69 Compare September 21, 2023 22:02
} catch (err) {
// Not found or incompatible. Re-generate with random values according to
// the defined distribution.
const generatedExperimentConfig = asExperimentConfig({})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consolidate isMaestro() check here and return default values if so

}, [])

return loggedIn ? (
return loggedIn || (!isMaestro() && experimentConfig == null) ? (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consolidate ismaestro checks to getExperimentConfig

const generateExperimentConfigVal = (key: keyof typeof experimentDistribution): boolean => {
return Math.random() < experimentDistribution[key]
const generateExperimentConfigVal = <T>(key: keyof typeof experimentDistribution, configVals: T[]): T => {
const variantProbability = experimentDistribution[key]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should assert that variantProbability.length === configVals.length - 1

@Jon-edge Jon-edge force-pushed the jon/ab/create-login-buttons branch 2 times, most recently from 8fd3040 to df5d072 Compare September 22, 2023 23:22
})
// behavior/appearance.
// If no generateCfgValFn given, returns defined defaults
const asExperimentConfig: any = (generateCfgValFn?: GenerateExperimentConfigValFn) =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A cleaner shouldn't be typed any. This would break the return type

@@ -74,7 +83,7 @@ const experimentConfigPromise: Promise<ExperimentConfig> = (async (): Promise<Ex
} catch (err) {
// Not found or incompatible. Re-generate with random values according to
// the defined distribution.
const generatedExperimentConfig = asExperimentConfig({})
const generatedExperimentConfig = asExperimentConfig(generateExperimentConfigVal)({})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why all the complexity of creating a function that gets passed in when all you really care about is a boolean like useDefaults. Pass that as the first arg to asExperimentConfig and you don't need to check for a null function.

@Jon-edge Jon-edge force-pushed the jon/ab/create-login-buttons branch 2 times, most recently from 91b3e4d to df584ad Compare September 25, 2023 21:58
@Jon-edge Jon-edge merged commit ef07ab9 into develop Sep 26, 2023
2 checks passed
@Jon-edge Jon-edge deleted the jon/ab/create-login-buttons branch September 26, 2023 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants