chore: delete old strategy variants; use new variants in default strategy #11343
Closed
thomasheartman wants to merge 1 commit intomainfrom
Closed
chore: delete old strategy variants; use new variants in default strategy #11343thomasheartman wants to merge 1 commit intomainfrom
thomasheartman wants to merge 1 commit intomainfrom
Conversation
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
thomasheartman
commented
Feb 17, 2026
Contributor
Author
There was a problem hiding this comment.
This adds the parameterized permission back in, defaulting to what was the hardcoded value before. It's likely that the implementation will change a bit when merging it with milestone strategy variants, so this is likely to be a stopgap.
be36eaf to
1949f70
Compare
1949f70 to
ee313d2
Compare
thomasheartman
commented
Feb 18, 2026
Comment on lines
-187
to
-190
| permission={[ | ||
| PROJECT_DEFAULT_STRATEGY_WRITE, | ||
| UPDATE_PROJECT, | ||
| ]} |
Contributor
Author
There was a problem hiding this comment.
These permissions are already required to save the form itself. It doesn't really make any sense to gate this one form field behind permissions you already need.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of the old variants, let's use the new variants for the default strategy.
From manual testing, they appear to work almost the exact same. My guess is that the old version was just forgotten after #5850.
The permissions that we used to require are the same permissions as the ones required to save the form, so there's no need to but those permissions on the "add variants" button.
In all the following screenies, the new strategy variants version is shown on the left, the old version on the right:
No variants:

Open editing:

Custom weighting:

Without names:

with names:

saved:

Claude's summary:
Here are the key differences between the two components:
1. Initialization pattern
StrategyVariantsinitializes variants in auseEffectwith empty dependency array, setting state after mount.NewStrategyVariantsinitializes variants directly in theuseStatecall, avoiding the extra render cycle.2. Cleanup effect
NewStrategyVariantshas an additional cleanupuseEffect(return function) that filters out variants with empty names when the component unmounts.StrategyVariantshas no such cleanup.3. Weight validation
NewStrategyVariantscomputes avariantWeightsErrorboolean (checks if weights don't sum to 1000) and passes it to bothVariantForm(asweightsError) andVariantsSplitPreview(asweightsError).StrategyVariantsdoes no weight validation.4. Permission prop
StrategyVariantsaccepts a configurablepermissionprop (defaulting toUPDATE_FEATURE_ENVIRONMENT_VARIANTS).NewStrategyVariantshardcodesUPDATE_FEATURE_ENVIRONMENT_VARIANTSdirectly.5. UI differences
NewStrategyVariantsshows anAlertinfo banner at the top explaining what variants do.NewStrategyVariants.Boxwrapper (StyledHelpIconBox) instead of being inline in theh3.startIcon={<Add />}icon inNewStrategyVariants.StrategyVariantsrenders the heading as an<h3>viaTypography variant='h3';NewStrategyVariantsuses a plainTypography(no heading variant).StrategyVariantsUpgradeAlertis conditionally rendered only when variants exist inNewStrategyVariants, but always shown inStrategyVariants.NewStrategyVariantsuses a plain<a>tag for the docs link;StrategyVariantsuses MUI's<Link>.In summary:
NewStrategyVariantsis a revised version with better initialization (no unnecessary re-render), weight validation, cleanup on unmount, and a refreshed UI.StrategyVariantsis the older version with more flexibility (configurable permission) but fewer guardrails.