Page MenuHome GnuPG

Kleopatra: Auto-select in case of only one keysearch result
Open, NormalPublic

Description

While testing WKD search I found it very inconvenient and unintuitive that I had to select the single result before I could import it. In fact I managed to close the window without importing anything...

In case of only a single result is returned (as typical for WKD and LDAP), that one should be automatically selected.

And then the Import button should be more prominent.
I would get rid of the "select all" "deselect all" buttons (who needs those?) and instead place the "details" and "import" buttons there at the side. Far away from the "close" button. But probably I should make a separate task for that...

Event Timeline

ebo triaged this task as Wishlist priority.Jan 12 2024, 1:22 PM
ebo created this task.
ebo renamed this task from Kleopatra: Auto-select in case of WKD keysearch result to Kleopatra: Auto-select in case of only one keysearch result.Feb 15 2024, 9:22 AM
ebo raised the priority of this task from Wishlist to Normal.
ebo updated the task description. (Show Details)
ebo added a project: vsd33.
TobiasFella changed the task status from Open to Testing.Mar 12 2024, 10:58 AM
TobiasFella moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Mar 12 2024, 1:10 PM
ebo moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Jun 14 2024, 11:20 AM

Tested with Gpg4win-4.3.2-beta25:

Now there is always the first result selected. My request was to preselect only if there is exactly one search result. I don't think it is appropriate to preselect a random certificate, people might think this implies it is the best result.

This might be ok if we could apply some sensible indicators to predict which key is probably the one we want. Maybe it would be ok to preselect the one from WKD. But probably not when you have an AD configured? So I would not preselect anything if there is more than one result.

ebo changed the task status from Testing to Open.Jun 14 2024, 11:20 AM

That the first result is selected is a side effect of making the certificate list more accessible. When the lookup finished, then the certificate list gets focus so that the users can immediately interact with the result. When the list gets focus we unset and reset the current item which triggers the selection of the item. And that triggers an accessible event (so that the user knows than a list item was/is selected).

I'm wondering why this issue was written at all because the first item should have been selected since a long time.

Testing with various versions of kleopatra, I'm getting differing results:

  • on existing gpg4win (without this patch), nothing is selected at all when searching, so this ticket makes sense
  • on linux (qt6) and gpg4win-qt6, when there are multiple results, the first result has "keyboard focus" (the line shows visual focus, but the import button is disabled). When there is only one certificate, it is selected. This is my understanding of what @ebo wants.
  • on current gpg4win beta, the first certificate is always selected, no matter how many certs are found

No idea where the difference for multiple certificates with and without this patch comes from (some other commit?), but it doesn't seem to be caused by this commit.

We should determine what exactly we want, then I can look into making sure that it works as planned everywhere.

As I wrote "That the first result is selected is a side effect of making the certificate list more accessible." and "When the lookup finished, then the certificate list gets focus so that the users can immediately interact with the result."

So, the only way to prevent the selection of one of the results is to give the input focus to some other UI element than the result list. I think this would reduce the usability/accessibility. Currently, the user gets immediate feedback when the search is done by reading the first result.