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

Allow to choose database from unlock dialog for Auto-Type and Browser [$150] #2322

Closed
kellerben opened this issue Sep 25, 2018 · 11 comments · Fixed by #5427
Closed

Allow to choose database from unlock dialog for Auto-Type and Browser [$150] #2322

kellerben opened this issue Sep 25, 2018 · 11 comments · Fixed by #5427

Comments

@kellerben
Copy link

kellerben commented Sep 25, 2018

Current Behavior

if you have several databases and press your global auto-type key, keepassxc tries to find the password in the currently unlocked databases or asks you to unlock the last database. Consider having several databases (like private/work, or several project-keepass-files). If you press the global autot-type key, you manually have to unlock the database where the password is stored in.

Possible Solution

All Cases occur after the global auto-key is pressed

Case 1: All databases are locked

Ask which database to unlock (or display the password-filed for opening and give the user a possibility to switch to another db)
case1

Case 2: A database is unlocked but password is not found

Display the currently unlocked DBs If autotype is pressed, ask the user if another database should be unlocked
case2

Case 3: A database is unlocked, some password is found

Give the user the possibility to unlock another DB.
case3

Operating system: Linux (but I expect everywhere)

@droidmonkey
Copy link
Member

Very comprehensive, thank you! I could have swore this was reported before, but I cannot find it.

phoerious added a commit that referenced this issue Nov 22, 2018
The Database, DatabaseWidget, and DatabaseTabWidget classes share many responsibilities in inconsistent ways resulting in impenetrable and unmaintainable code and a diverse set of bugs and architecture restrictions. This patch reworks the architecture, responsibilities of, and dependencies between these classes.

The core changes are:

* Move loading and saving logic from widgets into the Database class
* Get rid of the DatabaseManagerStruct and move all the information contained in it into the Database
* Let database objects keep track of modifications and dirty/clean state instead of handing this to external widgets
* Move GUI interactions for loading and saving from the DatabaseTabWidget into the DatabaseWidget (resolves #2494 as a side-effect)
* Heavily clean up DatabaseTabWidget and degrade it to a slightly glorified QTabWidget
* Use QSharedPointers for all Database objects
* Remove the modifiedImmediate signal and replace it with a markAsModified() method
* Implement proper tabName() method instead of reading back titles from GUI widgets (resolves #1389 and its duplicates #2146 #855)
* Fix unwanted AES-KDF downgrade if database uses Argon2 and has CustomData
* Improve code

This patch is also the first major step towards solving issues #476 and #2322.
@phoerious phoerious self-assigned this Nov 22, 2018
@phoerious phoerious added this to the v2.4.0 milestone Nov 22, 2018
@droidmonkey droidmonkey modified the milestones: v2.4.0, v2.5.0 Jan 16, 2019
@phoerious phoerious modified the milestones: v2.5.0, v2.6.0 Oct 26, 2019
@selurvedu
Copy link

@droidmonkey @phoerious is it possible to put a bounty on individual issue? I would like to donate some money for this particular thing.

@phoerious
Copy link
Member

I think that would be reasonable. This feature has been sitting on the back burner for far too long.

@droidmonkey
Copy link
Member

droidmonkey commented Dec 23, 2019

Yup I'll throw $100 on it. This is a fair amount of work and that might entice someone. I need to seed some more bounties around here.

@droidmonkey
Copy link
Member

I felt the Christmas spirit, $150 now on bounty!

https://www.bountysource.com/issues/63849610-feature-request-improve-autotype-with-several-databases

@droidmonkey droidmonkey changed the title feature-request: improve autotype with several databases Improve Auto-Type when using several databases Dec 23, 2019
@droidmonkey droidmonkey changed the title Improve Auto-Type when using several databases Improve Auto-Type when using several databases [$150] Dec 24, 2019
@chriswatt
Copy link

Added $50 to the bounty

@droidmonkey droidmonkey modified the milestones: v2.6.0, v2.6.1 May 30, 2020
@droidmonkey droidmonkey modified the milestones: v2.6.1, v2.7.0 Jul 21, 2020
@droidmonkey droidmonkey changed the title Improve Auto-Type when using several databases [$150] Allow to choose database from unlock dialog for Auto-Type and Browser [$150] Jul 21, 2020
@aswild
Copy link
Contributor

aswild commented Sep 4, 2020

@droidmonkey @phoerious what might an implementation of this feature look like, especially considering the changes in 2.6.0 which use this for unlocking via browser?

Personally, I like switching between tab pages because they respond to Ctrl-PageUp/PageDown shortcuts which I have bound to mouse buttons and that makes switching just a single click. Other designs could be a drop-down list or some other sort of list on the unlock dialog.

Currently, it looks like a DatabaseOpenDialog is tied to each DatabaseTabWidget and thus one database, so it might require more refactoring than I first expected to be able to present multiple database options in the unlock dialog. Could DatabaseOpenDialog be made more generic and accept a list of DatabaseWidget pointers and it can create a series of tabs that switch between a DatabaseOpenWidget for each?

I'd love to hack on this and come up with an implementation (if nobody else is taking on the challenge) but am having trouble knowing the best place to start.

@droidmonkey
Copy link
Member

To me this looks like a simple drop down choice above the credential fields to choose the database you want

aswild added a commit to aswild/keepassxc that referenced this issue Sep 5, 2020
When showing the database unlock dialog from browser or auto-type and
there's more than one open database, replace the filename label with
a drop-down box of all available files. Switching the filename here will
change the active tab of the main window and unlock it.

This is the first part of an implementation for
keepassxreboot#2322

TODO/Limitations:
  * The drop-down list should show only locked databases rather than all
    open databases.
  * The drop-down should dynamically respond if the set of open database
    tabs is changed (e.g. if the user closes a database in the main
    window while the unlock dialog is open)
  * No handling for the case where the active database is unlocked but
    has no matching credentials, and there's other locked databases open
    ("Case 2" in the github issue)
@aswild
Copy link
Contributor

aswild commented Sep 13, 2020

UX design question: are there any objections to setting setWindowModality(Qt::ApplicationModal) in the DatabaseOpenDialog constructor?

When the open dialog is a non-modal window, the main UI can still be open and arbitrarily interacted with, including opening/closing/locking/unlocking databases that the open dialog may be targeting. Making DatabaseOpenDialog modal blocks input to the main application, eliminating a big set of corner cases.

(Actually handling those corner cases is possible, but involves setting up quite a few signals between DatabaseOpenDialog and its parent DatabaseTabWidget and the code gets a bit messy)

@droidmonkey
Copy link
Member

The whole sequence needs refactoring and requires careful handling.

aswild added a commit to aswild/keepassxc that referenced this issue Sep 13, 2020
When showing the database unlock dialog from browser or auto-type and
there's more than one open database, replace the filename label with
a drop-down box of all available files. Switching the filename here will
change the active tab of the main window and unlock it.

This implements the major feature desired by [1] and the noticeable UX
regression between 2.5 and 2.6 when working with multiple databases on
an auto-lock timer.

Notes:
  * Make the DatabaseOpenDialog window ApplicationModal so that it
    blocks input to the main UI when open. This avoids a number of
    corner cases that would otherwise pop up if opening/closing or
    locking/unlocking extra database tabs in the background.
  * This does not handle auto-type/browser scenarios where the active
    database is unlocked but has no matching credentials, and there's
    other locked databases open which the user could be prompted to
    unlock ("Case 2" in the issue).

[1] keepassxreboot#2322
aswild added a commit to aswild/keepassxc that referenced this issue Sep 23, 2020
When showing the database unlock dialog from browser or auto-type and
there's more than one open database, add tabs to the unlock dialog so
that the user can choose which database to unlock.

This implements part of [1] and improves the UX when working with
multiple databases after version 2.6 switched to using the dialog for
browser unlock.

Make the DatabaseOpenDialog window Application-Modal so that it blocks
input to the main UI when the dialog is open. This reduces corner cases
by avoiding the possibility of databases getting closed or unlocked
behind the open dialog.

[1] keepassxreboot#2322
aswild added a commit to aswild/keepassxc that referenced this issue Sep 23, 2020
When showing the database unlock dialog from browser or auto-type and
there's more than one open database, add tabs to the unlock dialog so
that the user can choose which database to unlock.

This implements part of [1] and improves the UX when working with
multiple databases after version 2.6 switched to using the dialog for
browser unlock.

Make the DatabaseOpenDialog window Application-Modal so that it blocks
input to the main UI when the dialog is open. This reduces corner cases
by avoiding the possibility of databases getting closed or unlocked
behind the open dialog.

[1] keepassxreboot#2322
aswild added a commit to aswild/keepassxc that referenced this issue Sep 23, 2020
When showing the database unlock dialog from browser or auto-type and
there's more than one open database, add tabs to the unlock dialog so
that the user can choose which database to unlock.

This implements part of [1] and improves the UX when working with
multiple databases after version 2.6 switched to using the dialog for
browser unlock.

Make the DatabaseOpenDialog window Application-Modal so that it blocks
input to the main UI when the dialog is open. This reduces corner cases
by avoiding the possibility of databases getting closed or unlocked
behind the open dialog.

[1] keepassxreboot#2322
aswild added a commit to aswild/keepassxc that referenced this issue Sep 27, 2020
When showing the database unlock dialog from browser or auto-type and
there's more than one open database, add tabs to the unlock dialog so
that the user can choose which database to unlock.

This implements part of [1] and improves the UX when working with
multiple databases after version 2.6 switched to using the dialog for
browser unlock.

Make the DatabaseOpenDialog window Application-Modal so that it blocks
input to the main UI when the dialog is open. This reduces corner cases
by avoiding the possibility of databases getting closed or unlocked
behind the open dialog.

[1] keepassxreboot#2322
aswild added a commit to aswild/keepassxc that referenced this issue Oct 7, 2020
When showing the database unlock dialog from browser or auto-type and
there's more than one open database, add tabs to the unlock dialog so
that the user can choose which database to unlock.

This implements part of [1] and improves the UX when working with
multiple databases after version 2.6 switched to using the dialog for
browser unlock.

Make the DatabaseOpenDialog window Application-Modal so that it blocks
input to the main UI when the dialog is open. This reduces corner cases
by avoiding the possibility of databases getting closed or unlocked
behind the open dialog.

[1] keepassxreboot#2322
aswild added a commit to aswild/keepassxc that referenced this issue Oct 25, 2020
When showing the database unlock dialog from browser or auto-type and
there's more than one open database, add tabs to the unlock dialog so
that the user can choose which database to unlock.

This implements part of [1] and improves the UX when working with
multiple databases after version 2.6 switched to using the dialog for
browser unlock.

Make the DatabaseOpenDialog window Application-Modal so that it blocks
input to the main UI when the dialog is open. This reduces corner cases
by avoiding the possibility of databases getting closed or unlocked
behind the open dialog.

[1] keepassxreboot#2322
aswild added a commit to aswild/keepassxc that referenced this issue Oct 25, 2020
When showing the database unlock dialog from browser or auto-type and
there's more than one open database, add tabs to the unlock dialog so
that the user can choose which database to unlock.

This implements part of [1] and improves the UX when working with
multiple databases after version 2.6 switched to using the dialog for
browser unlock.

Make the DatabaseOpenDialog window Application-Modal so that it blocks
input to the main UI when the dialog is open. This reduces corner cases
by avoiding the possibility of databases getting closed or unlocked
behind the open dialog.

[1] keepassxreboot#2322
aswild added a commit to aswild/keepassxc that referenced this issue Jan 22, 2021
When showing the database unlock dialog from browser or auto-type and
there's more than one open database, add tabs to the unlock dialog so
that the user can choose which database to unlock.

This implements part of [1] and improves the UX when working with
multiple databases after version 2.6 switched to using the dialog for
browser unlock.

Make the DatabaseOpenDialog window Application-Modal so that it blocks
input to the main UI when the dialog is open. This reduces corner cases
by avoiding the possibility of databases getting closed or unlocked
behind the open dialog.

[1] keepassxreboot#2322
aswild added a commit to aswild/keepassxc that referenced this issue Jun 19, 2021
When showing the database unlock dialog from browser or auto-type and
there's more than one open database, add tabs to the unlock dialog so
that the user can choose which database to unlock.

This implements part of [1] and improves the UX when working with
multiple databases after version 2.6 switched to using the dialog for
browser unlock.

Make the DatabaseOpenDialog window Application-Modal so that it blocks
input to the main UI when the dialog is open. This reduces corner cases
by avoiding the possibility of databases getting closed or unlocked
behind the open dialog.

[1] keepassxreboot#2322
aswild added a commit to aswild/keepassxc that referenced this issue Aug 3, 2021
When showing the database unlock dialog from browser or auto-type and
there's more than one open database, add tabs to the unlock dialog so
that the user can choose which database to unlock.

This implements part of [1] and improves the UX when working with
multiple databases after version 2.6 switched to using the dialog for
browser unlock.

Make the DatabaseOpenDialog window Application-Modal so that it blocks
input to the main UI when the dialog is open. This reduces corner cases
by avoiding the possibility of databases getting closed or unlocked
behind the open dialog.

[1] keepassxreboot#2322
aswild added a commit to aswild/keepassxc that referenced this issue Aug 19, 2021
When showing the database unlock dialog from browser or auto-type and
there's more than one open database, add tabs to the unlock dialog so
that the user can choose which database to unlock.

This implements part of [1] and improves the UX when working with
multiple databases after version 2.6 switched to using the dialog for
browser unlock.

Make the DatabaseOpenDialog window Application-Modal so that it blocks
input to the main UI when the dialog is open. This reduces corner cases
by avoiding the possibility of databases getting closed or unlocked
behind the open dialog.

[1] keepassxreboot#2322
aswild added a commit to aswild/keepassxc that referenced this issue Aug 23, 2021
When showing the database unlock dialog from browser or auto-type and
there's more than one open database, add tabs to the unlock dialog so
that the user can choose which database to unlock.

This implements part of [1] and improves the UX when working with
multiple databases after version 2.6 switched to using the dialog for
browser unlock.

Make the DatabaseOpenDialog window Application-Modal so that it blocks
input to the main UI when the dialog is open. This reduces corner cases
by avoiding the possibility of databases getting closed or unlocked
behind the open dialog.

[1] keepassxreboot#2322
@droidmonkey droidmonkey linked a pull request Aug 25, 2021 that will close this issue
aswild added a commit to aswild/keepassxc that referenced this issue Aug 27, 2021
Cherry-pick ed99fe6, the latest from my
PR 2021-08-23.

When showing the database unlock dialog from browser or auto-type and
there's more than one open database, add tabs to the unlock dialog so
that the user can choose which database to unlock.

This implements part of [1] and improves the UX when working with
multiple databases after version 2.6 switched to using the dialog for
browser unlock.

Make the DatabaseOpenDialog window Application-Modal so that it blocks
input to the main UI when the dialog is open. This reduces corner cases
by avoiding the possibility of databases getting closed or unlocked
behind the open dialog.

[1] https://github .com/keepassxreboot/issues/2322
droidmonkey pushed a commit to aswild/keepassxc that referenced this issue Aug 29, 2021
* Closes keepassxreboot#2322

* Show locked databases in tabbed interface in unlock dialog for browser and auto-type workflows.

* Make the DatabaseOpenDialog window Application-Modal so that it blocks input to the main UI when the dialog is open. This reduces corner cases by avoiding the possibility of databases getting closed or unlocked
behind the open dialog.
droidmonkey pushed a commit that referenced this issue Aug 29, 2021
* Closes #2322

* Show locked databases in tabbed interface in unlock dialog for browser and auto-type workflows.

* Make the DatabaseOpenDialog window Application-Modal so that it blocks input to the main UI when the dialog is open. This reduces corner cases by avoiding the possibility of databases getting closed or unlocked
behind the open dialog.
@4lex11s
Copy link

4lex11s commented Feb 24, 2023

Thank you very much for this feature!
Do you think you can also activate only the main window (of the first password base) after these events:

  • a CTRL+SHIFT+L => Lock all Databases
  • a Win+L => Windows or Linux Lock session

Otherwise, when opening the session, the password request might be positioned on one of the secondary auto-open databases (of which we do not have the password in mind)...

Under keepass, I use the triggers to put the focus always on the first database whenever opening or closing any base. (FYI triggers will not be implemented: #1016 (comment))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants