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

Improve hybrid form UX #248

Merged
merged 17 commits into from
Jan 19, 2023
Merged

Improve hybrid form UX #248

merged 17 commits into from
Jan 19, 2023

Conversation

GioSensation
Copy link
Member

@GioSensation GioSensation commented Jan 17, 2023

Reviewer: @shakyShane @alistairjcbrown
Asana: https://app.asana.com/0/0/1203752198387942/f

Description

Tweaks the flow to show identities autofill when an hybrid or login form doesn't have saved credentials. See this matrix to understand what we're changing:
CleanShot 2023-01-11 at 15 54 30

This also fixes a few other bugs. Full list of fixes in Asana.

Steps to test

Automated tests added, but there's also a comprehensive list of bugs this is fixing. You can find it in the Asana task. There you can also find the macOS build.

Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>
Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>
Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>
… ema/improve-hybrid-form-ux

Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>

# Conflicts:
#	dist/autofill-debug.js
#	dist/autofill.js
#	src/Form/FormAnalyzer.js
#	swift-package/Resources/assets/autofill-debug.js
#	swift-package/Resources/assets/autofill.js
Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>
Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>
Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>
Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>
… ema/improve-hybrid-form-ux

Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>

# Conflicts:
#	dist/autofill-debug.js
#	dist/autofill.js
#	swift-package/Resources/assets/autofill-debug.js
#	swift-package/Resources/assets/autofill.js
Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>
Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>
@GioSensation GioSensation self-assigned this Jan 17, 2023
Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>
this.decreaseSignalBy(strength + 2, `Unified detected ${signalType}`)
if (shouldCheckUnifiedForm && matchesLogin && strictSignupRegex.test(string)) {
this.signals.push(`hybrid form: ${signalType}`)
this.isHybrid = true
Copy link
Member Author

Choose a reason for hiding this comment

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

If we detect that it's a hybrid form, short circuit things. Actually, I'm wondering if we should also stop scanning the form at this stage 🤔. Feedback welcome, but as things stand now once this is set we never un-set it so the rest of the form scanning doesn't have any effect.

Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>
input[type=email],
input[type=text][aria-label*=email i]:not([aria-label*=search i]),
input:not([type])[aria-label*=email i]:not([aria-label*=search i]),
input[type=text][placeholder*=email i]:not([placeholder*=search i]):not([placeholder*=filter i]):not([placeholder*=subject i]),
Copy link
Member Author

Choose a reason for hiding this comment

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

These were duplicates 🤦‍♂️. Previously we discussed about generating these instead of having them hardcoded like this. It could give us easier access to variations, especially on other selectors where we use hyphens, underscores etc. For another day.

@GioSensation GioSensation marked this pull request as ready for review January 17, 2023 16:57
Copy link
Member

@alistairjcbrown alistairjcbrown left a comment

Choose a reason for hiding this comment

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

Added some questions and non-blocking comments. LGTM and the test build works really well :shipit:

},
iconMatchers: {
key: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4w',
dax: 'data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBo'
Copy link
Member

Choose a reason for hiding this comment

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

❓ Is it worth importing the actual string here than duplicating part of it?

Copy link
Member Author

@GioSensation GioSensation Jan 18, 2023

Choose a reason for hiding this comment

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

When I tried that I think that there was a build error because the tests use require and the rest of the code uses import. I couldn't figure it out quickly and just moved on. If you or @shakyShane have suggestions, please let me know and I'll be happy to improve it, otherwise I'd leave it be.

integration-test/helpers/pages.js Show resolved Hide resolved
integration-test/helpers/pages.js Outdated Show resolved Hide resolved
src/DeviceInterface/InterfacePrototype.js Show resolved Hide resolved
src/Form/FormAnalyzer.js Show resolved Hide resolved
src/Form/FormAnalyzer.js Show resolved Hide resolved
src/Form/matching.test.js Outdated Show resolved Hide resolved
src/Form/selectors-css.js Show resolved Hide resolved
src/DeviceInterface/InterfacePrototype.js Show resolved Hide resolved
Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>
Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>
Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>
Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>
password: {match: 'password', forceUnknown: 'captcha|mfa|2fa|two factor'},
username: {match: '(user|account|apple|login|net)((.)?(name|id|login).?)?(.?(or|/).+)?$|benutzername', forceUnknown: 'search|policy'},
email: {match: '.mail\\b|apple.?id', skip: 'phone|name|reservation number|code', forceUnknown: 'search|filter|subject|title|\btab\b'},
password: {match: 'password', skip: 'email', forceUnknown: 'captcha|mfa|2fa|two factor'},
Copy link
Member Author

Choose a reason for hiding this comment

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

Added this to fix a bug on substack reported just yesterday 💪. Test case added.

@GioSensation GioSensation merged commit 3a329ee into main Jan 19, 2023
@GioSensation GioSensation deleted the ema/improve-hybrid-form-ux branch January 19, 2023 12:01
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.

2 participants