Add beta override switches to the Test Tool menu - #99444
Draft
arekm213 wants to merge 2 commits into
Draft
Conversation
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx bun ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
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.
Explanation of Change
Betas can only be flipped locally today by editing Onyx by hand in the console (
Onyx.merge('betas', [...betas, 'submit2026'])), which is easy to get wrong and gets wiped on the next reconnect.This adds a Beta overrides row to the Test Tool menu that opens a modal listing every beta in
CONST.BETASwith a switch each, so a beta can be turned on or off on the current device without touching the console. The row renders fromTestToolMenu, so it is available both in the hidden Test Tools modal and inline on Settings > Troubleshoot.Behavior:
Overriddenbadge.clearOnyxAndResetApp, so a testing setup is not lost by logging out.Implementation notes:
ONYXKEYS.BETAS_OVERRIDEkey (Partial<Record<Beta, boolean>>) rather than writing intoBETAS, because the server re-pushesBETASon every OpenApp/ReconnectApp and would wipe anything stored there.Permissions.isBetaEnabled, which takes the overrides as a new optional parameter defaulting to a module level value. That keeps the non-render callers (actions, utils, navigation guards) that receivebetasas a parameter honest without each of them subscribing to the key. Components get reactivity throughusePermissions, which passes the value in from a newBetasOverrideContext. This mirrors howONYXKEYS.BETASitself is already read: throughBetasContextfor components and throughOnyx.connectWithoutViewinViolationsUtilsandTransactionInlineEditfor non-React code. See Onyx Data Management.TestToolsModalNavigatornow skips itsESCAPEshortcut whilemodal.willAlertModalBecomeVisibleis true, so on web Escape closes the overrides modal instead of closing both it and the Test Tools modal.allbeta is excluded from the list, since it is a blanket switch rather than an individual feature.Known limitation, happy to address if reviewers prefer:
QuickCreationActionsBarandTravelMenuItemcallPermissions.isBetaEnableddirectly rather than throughusePermissions, so they read the correct value but do not re-render on an override change until something else re-renders them.Proposed by @JakubKorytko.
Fixed Issues
$ #98409
PROPOSAL:
Tests
/test-toolsor press Cmd/Ctrl+D). Alternatively go to Settings > Troubleshoot.defaultRoomson. Verify the switch flips and anOverriddenbadge appears next to the name.defaultRoomson,#adminsand#announcerooms appear in the LHN).defaultRoomsback off. Verify the badge stays, since the override is now pinned tofalserather than removed, and verify the rooms disappear again.Offline tests
N/A. Overrides are stored locally in Onyx and only affect frontend checks, so behavior is identical offline. Note that force enabling a beta the account does not have on the backend can still fail at the request level once online, which the modal calls out in its description.
QA Steps
Same as Tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android.mov
Android: mWeb Chrome
chromeMobile.mov
iOS: Native
iOS.mov
iOS: mWeb Safari
safariMobile.mov
MacOS: Chrome / Safari
chrome.mov