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

ui/features: Environment-configurable feature flags with UI overrides #2101

Merged
merged 10 commits into from
Jan 4, 2023

Conversation

ssangervasi
Copy link
Contributor

@ssangervasi ssangervasi commented Dec 21, 2022

Closes [The hole in my soul]

Code Changes

  • Check out that readme!
  • The features slice now has persisted has state that can save flag changes for the user
  • The FeaturesPanel can toggle (and reset) flags from within the UI. Access tucked under the user menu.
  • Use NEXT_PUBLIC_APP_ENV for app-specific environment config - Next.js discussion
  • Removed react-feature-flags dependency

Steps to Confirm

  • Check out the loom below for switching flags when the build environment changes
  • Check out the gif for how to toggle a feature (navV2) that's currently dev-only
  • Try adding a new flag and see if its convenient

Pre-Merge Checklist

Description Of Changes

Lovely
quick-switch

Readme update:
flags-docs

Defaults switching per build environment
https://www.loom.com/share/28a23c54fcf2415299d8bfa92eb3d61c

@ssangervasi ssangervasi changed the title Ssangervasi/ff ui/features: Environment-configurable feature flags with UI overrides Dec 21, 2022
Copy link
Contributor

@allisonking allisonking left a comment

Choose a reason for hiding this comment

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

amaaaaaazing 🎏

@ssangervasi ssangervasi force-pushed the ssangervasi/ff branch 3 times, most recently from 0b6f871 to c770849 Compare January 3, 2023 22:28
@@ -59,20 +66,34 @@ const Header: React.FC = () => {
size="sm"
variant="ghost"
data-testid="header-menu-button"
onDoubleClick={() => featuresPanelDisclosure.onOpen()}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pro-tip: I'm leaving this here without the flag check so that those who know the trick can access the panel in prod builds even when the menu entry isn't shown.

@ssangervasi
Copy link
Contributor Author

Here's a screenshot with the additional message, showing a flag toggled on that would not be on by default (in env "test"):

Screen Shot 2023-01-04 at 15 10 08

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.

3 participants