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

Automatically select available login #405

Merged
merged 10 commits into from
Jan 28, 2022

Conversation

samsymons
Copy link
Collaborator

Task/Issue URL: https://app.asana.com/0/1177771139624306/1201228737296484/f
Tech Design URL:
CC: @brindy

Description:

This PR changes the Logins+ popover to automatically select existing credentials if you're on an existing domain that has them.

We can only do the automatic scrolling with SwiftUI on macOS 11+, so for 10.15 the existing filtering logic has been retained.

Steps to test this PR:

  1. Visit a site for which you have credentials available in Logins+, and show the panel - check that it scrolls to the credentials for you automatically
  2. Visit a site which you do not have credentials for, check that it automatically selects the first item
  3. In PasswordManagementViewController's viewDidAppear method, swap the calls in the macOS 11 availability check and run the above two tests again, verify that the old search bar filtering logic is still used

Testing checklist:

  • Test with Release configuration

Internal references:

Software Engineering Expectations
Technical Design Template
When ready for review, remember to post the PR in MM

@bstandaert-ddg
Copy link

This doesn't work for me on a site with a "www." prefix:

Screen.Recording.2022-01-24.at.4.17.42.PM.mov

I think what's happening is that the login panel removes the prefix before saving the login, but it's being compared to the tab domain that still has the prefix included.

@samsymons
Copy link
Collaborator Author

@bstandaert-ddg Yep, you're right, that's exactly what's happening. The matching logic is weak right now, and I think we need to do a better job of being more lenient regarding which credentials this functionality matches against.

I'm gonna put something together and get you & Brindy to take another look. Thanks!

@samsymons samsymons self-assigned this Jan 24, 2022
@samsymons samsymons requested a review from brindy January 26, 2022 22:35
@samsymons samsymons assigned brindy and unassigned samsymons Jan 26, 2022
@samsymons
Copy link
Collaborator Author

@bstandaert-ddg Made a change to fix the issue you were seeing, what do you think?

Copy link
Contributor

@brindy brindy left a comment

Choose a reason for hiding this comment

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

Looks like a couple of Swift Lint violations but otherwise LGTM

@brindy brindy assigned samsymons and unassigned brindy Jan 27, 2022
@bstandaert-ddg
Copy link

Looks good!

@samsymons samsymons merged commit 1a8b7c8 into develop Jan 28, 2022
@samsymons samsymons deleted the sam/automatically-select-available-login branch January 28, 2022 04:52
samsymons added a commit that referenced this pull request Jan 31, 2022
# By Lucas Adamski (1) and others
# Via Tomas Strba
* develop:
  Version 0.18.5
  support privacy config for clickToLoad (#407)
  Automatically select available login (#405)

# Conflicts:
#	DuckDuckGo/SecureVault/Model/PasswordManagementItemListModel.swift
#	DuckDuckGo/SecureVault/View/PasswordManagementItemList.swift
#	DuckDuckGo/SecureVault/View/PasswordManagementViewController.swift
samsymons added a commit that referenced this pull request Feb 1, 2022
* develop:
  Version 0.18.5
  support privacy config for clickToLoad (#407)
  Automatically select available login (#405)
  initial FB Click to Load (WIP) (#329)
  onboarding updates (#398)
  Version 0.18.4
  Configuration of Sparkle - Setting SUAllowsAutomaticUpdates to NO (#404)
  Hide downloads button if the popover is opened/closed manually (#397)
samsymons added a commit that referenced this pull request Feb 18, 2022
# By Alexey Martemyanov (20) and others
# Via Tomas Strba (2) and others
* develop: (63 commits)
  Tweaks of suggestions and autocomplete (#403)
  Bump privacy dashboard to latest version (#409)
  Point to the latest BrowserServicesKit branch. (#414)
  Move embedded TDS from BSK to platform repo (#412)
  Image of shield with dot replaced (#410)
  Expand Fireproofing to include Local Storage and IndexedDB (#408)
  Version 0.18.5
  support privacy config for clickToLoad (#407)
  Automatically select available login (#405)
  initial FB Click to Load (WIP) (#329)
  onboarding updates (#398)
  Version 0.18.4
  Configuration of Sparkle - Setting SUAllowsAutomaticUpdates to NO (#404)
  Hide downloads button if the popover is opened/closed manually (#397)
  Textfield of the homepage is empty and unfocused right after switching to the homepage (#400)
  Remove navigatorCredentials (#392)
  Remove GPC header if it exists when not needed (#366)
  Version 0.18.3
  Fireproofing encrypted storage (#332)
  Fix Lock Screen UI issues (#399)
  ...

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo/Crash Reports/Model/CrashReportSender.swift
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