-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Default to the new UI for first time users #5334
Conversation
I'm torn about what we should do with the old UI e2e tests here as updating the e2e tests would require going through the new UI on-boarding to be able to switch back to the old UI. We could delete the old UI e2e tests? It's a non-zero risk though.(Is it really? They're pretty flaky anyhow tbf.) Similar story for the old UI integration tests. Maybe this PR represents the end of the road for all old UI tests? |
All for deleting the old oldUi e2e tests and integration tests. For the new Ui. |
@@ -32,7 +32,9 @@ class PreferencesController { | |||
tokens: [], | |||
suggestedTokens: {}, | |||
useBlockie: false, | |||
featureFlags: {}, | |||
featureFlags: { | |||
betaUI: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kind of ironic to push people toward the new UI and still call it betaUI here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the flag is called "betaUI" and is references throughout the pull request.
when the reality is that it will become the production UI, by nature of being the primary one people get to see and is the natural progression of it.
the idea being that some OTHER unforeseen design become the new betaUI, or the community itself is leveraged to provide skins for metamask
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't follow, sorry. This is a feature flag that is now permanently enabled as the first step to us removing its usages. It is called betaUI
because that's what the feature it was. We will be removing it because, yes, it is becoming the default UI. I don't think that's ironic/unexpected, that's the progression of a feature flag.
If you're interested in community skins, feel free open up a new issue detailing those ideas!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get it, that's funny. With hindsight, we could have named this parameter something like "ui2" instead. It's like finding an old can of soap in your basement that says "new improved formula!". How new? How beta?
Not a big deal, we can just remove this flag when it's no longer a beta.
Should we remove the tests in a separate PR? |
If we make the integration tests non-required we could leave them as failing, yeah? Would that be a better option? |
package.json
Outdated
@@ -13,8 +13,6 @@ | |||
"watch:test:unit": "nodemon --exec \"npm run test:unit\" ./test ./app ./ui", | |||
"test:unit": "cross-env METAMASK_ENV=test mocha --exit --require test/setup.js --recursive \"test/unit/**/*.js\" \"ui/app/**/*.test.js\" && dot-only-hunter", | |||
"test:single": "cross-env METAMASK_ENV=test mocha --require test/helper.js", | |||
"test:integration": "npm run test:integration:build && npm run test:flat && npm run test:mascara", | |||
"test:integration:build": "gulp build:scss", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue with this is that the test:ingeration:build
is also used for test-integration-mascara
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks
Interesting Q about the test suite. It's mostly fine to remove old UI tests, except that we could catastrophically break it, and we probably wouldn't notice, since manually testing is just as tedious as it automatically clicking through just to enable the old UI. That said, the things we are changing right now are just background + new UI, and anything in background that would break the old UI would probably break the new UI too, so maybe we can just be very mindful about breaking background API changes during this interim? Lastly, how hard would it be for us to copy the new-ui setup to the beginning of the old-UI tests, so we can get the app to a state where they make sense? @tmashuang could you briefly review those files and see if they might compose at all? The old UI tests will probably need some of their first time flow tests removed, since it is no longer exactly possible to encounter. |
That's a risk, certainly. I would argue that the risk is small though as a lot of functionality/actions are shared and breaking changes would likely be clear during review. I think it's possible to go a single release cycle without old UI e2e tests and without regressions. |
27e8eca
to
ae3786a
Compare
Maybe we can run a command from the test to switch to old ui even though there is not a ui option to do it |
@kumavis to follow-up to my suggestions above, I'm thinking we can remove |
23d9324
to
2980059
Compare
de08662
to
ff235cb
Compare
test/integration/index.js
Outdated
@@ -2,7 +2,7 @@ const fs = require('fs') | |||
const path = require('path') | |||
const pump = require('pump') | |||
const browserify = require('browserify') | |||
const tests = fs.readdirSync(path.join(__dirname, 'lib')) | |||
const tests = fs.readdirSync(path.join(__dirname, 'lib')) // .filter((filename) => filename.match(/send/)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 😅
2446bbf
to
39faa35
Compare
More sed magic: sed -i.bak 's/MetaMask Beta/MetaMask/' app/_locales/**/messages.json && \ find app/_locales -name '*.bak' -delete sed -i.bak 's/"welcomeBeta"/"welcome"/' app/_locales/**/messages.json && \ find app/_locales -name '*.bak' -delete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm for it. It's very much time!
Closes #4971
This PR is the start of the new UI switch, showing the new UI by default for first time users.
We won't be merging this PR for a while, FYI.This PR is ready for review.Changes: