-
Notifications
You must be signed in to change notification settings - Fork 581
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement activity dot indicator experiment (#11319)
* chore: bump palette-mobile to get latest colors and VisualClue * feat: define the experiment And define a payload that allows us to force the dots to display (for QA) * feat: add a hook for convenience * feat: implement the experiment on the activity panel bell * feat: update red for inbox indicator * feat: add variants to bottom tab Strangely, I don't see how the profile icon's dot ever gets requested so I've added the ability to force it here * refactor: move color calculation into hook * feat: track the activity dot experiment, once per session * feat: address PR feedback - Use new var instead of mutating destructured var from props - Avoid 'px' in positioning props
- Loading branch information
1 parent
bb6db0e
commit a04dab7
Showing
8 changed files
with
177 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { useExperimentVariant } from "app/utils/experiments/hooks" | ||
|
||
type Variant = "control" | "variant-b" | "variant-c" | ||
type Color = "red50" | "blue100" | ||
|
||
export function useActivityDotExperiment() { | ||
const { enabled, trackExperiment, variant, payload } = useExperimentVariant( | ||
"onyx_activity-dot-experiment" | ||
) | ||
|
||
// Dev Menu helper to force visible dots for testing during QA | ||
const forceDots = Boolean(payload && JSON.parse(payload)?.forceDots === "true") | ||
|
||
const color: Color = enabled ? (variant === "variant-b" ? "red50" : "blue100") : "blue100" | ||
|
||
return { | ||
enabled, | ||
variant: variant as Variant, | ||
color, | ||
trackExperiment, | ||
forceDots, | ||
} | ||
} |
Oops, something went wrong.