feat(featureflags): add typed FeatureFlag<T> and background reset behavior#709
Merged
Conversation
44c6eb4 to
fd14f5a
Compare
…avior Make FeatureFlag generic (FeatureFlag<T: Any>) so option-based flags carry their typed default directly (e.g. BackgroundResetTimeout.FiveMinutes) instead of a raw string. Boolean flags use FeatureFlag<Boolean> unchanged. Add FlagOption.isDisabled for generic disabled-option detection, replacing hardcoded never string checks in the controller. Add defaultEnabled and defaultOption as computed properties derived from the typed default. Add BackgroundResetEffect composable that records a timestamp on ON_STOP and dismisses all sheets via popUntil when the configured timeout elapses on ON_RESUME. Only triggers on true backgrounding, not ON_PAUSE. Defers the reset when a deeplink is pending — waits for it to be consumed and only pops sheets if the deeplink did not result in any routing. Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
fd14f5a to
2329bd7
Compare
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.
Make FeatureFlag generic (
FeatureFlag<T: Any>) so option-based flags carry their typed default directly (e.g.BackgroundResetTimeout.FiveMinutes) instead of a raw string. Boolean flags useFeatureFlag<Boolean>unchanged.Add
FlagOption.isDisabledfor generic disabled-option detection, replacing hardcoded "never" string checks in the controller. AdddefaultEnabledanddefaultOptionas computed properties derived from the typeddefault.Add
BackgroundResetEffectcomposable that records a timestamp on ON_STOP and dismisses all sheets viapopUntilwhen the configured timeout elapses on ON_RESUME. Only triggers on true backgrounding, not ON_PAUSE.