Enhance: remove minuscule text from under profile icons#4712
Conversation
This finally enables us to do away with the text under the profile icons as it replicates the normal `QListWidget` behaviour to move the selection to each item which begins with the first letter of the key pressed. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
|
Hey there! Thanks for helping Mudlet improve. 🌟 Test versionsYou can directly test the changes here:
No need to install anything - just unzip and run. |
vadi2
left a comment
There was a problem hiding this comment.
This does work, but not quite as good as the Qt version - in there if I have multiple profiles starting with a similar name, I can type the name of the profile and it'll find it. Here, only the last letter is considered, and while I can press the letter many times - it's not as intuitive as entering in a few first letters of the profile.
Do you think you could have this match the behaviour?
Oh, I thought it only considered the most recent keypress. Gonna have to think about that... |
This also makes the non-matching profiles get disabled which I think makes the action more obvious - and gives further instructions on how to reset things... Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
src/dlgConnectionProfiles.cpp
Outdated
| notificationAreaIconLabelError->hide(); | ||
| notificationAreaIconLabelInformation->show(); | ||
| notificationAreaMessageBox->show(); | ||
| notificationAreaMessageBox->setText(tr("As you type more letters in the name of a profile all the non-matching ones " |
There was a problem hiding this comment.
Let's not show this message, it was not necessary for the last ten years - this is definitely way too much "nagging"
There was a problem hiding this comment.
Yeah, but since I am actually disabling non-matching profiles we ought to let the end user know how to get them back again. I suppose I could try something more fancy that would only show this message once per Mudlet run - but I do not really want to add too much more 🍝 code here.
Also - I cannot view streamable.com URLs - they must be (like GitHub) using features that are only compatible with the most bleeding edge browsers and unlike GH (https://github.com/JustOff/github-wc-polyfill) I do not have a fix for them.
There was a problem hiding this comment.
Otherwise - is this any good? 😟
There was a problem hiding this comment.
The message does not need to be shown at all. Good UX does not require explanation!
My best guess is that the |
|
Sent a video on Discord that shows the differences, have a look |
…rofileIcons Needed to include fix for crashing on exit in TTimerUnit destructor. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
|
You should maybe put a timer of 2-3 seconds of no keys pressed before starting a new name circle |
|
Actually I did dissect that video on Discord and I eventually worked out that what I suspected was, indeed, the case:
I really don't want to have to use a timer - as it is I think the visual feed back from all the non-matching profiles becoming disabled (with the message explaining this - but which disappears as soon as the search is cleared by the first letter that does not leave any matching profiles) is a viable scheme as it is... |
|
The idea was to keep the same behaviour, not change it, because that won't be intuitive and frustrate muscle memory, though. |
|
I did not make up the timer myself: It is instead common best practice in such list selection widgets. Try your file explorer or web browser for good measure. Try the Mudlet map areas selection drop down menu as well. - You can't restart the selection by keep on typing. You need to pause for a moment to have it restart. |
I am not sure I like the idea of using timer dependent code simply because that will need a determination of the time period to use and that is going to be horribly subjective IMVHO - how about if the end user is using assistive technology (or even a screen reader). I feel the enabling/disabling idea is attractive because it is very much more visible - for me the selected item is not that well differentiated under the current release codebase - but with only a few (or ultimately only one) left enabled and not greyed out - it is hard to miss the profile(s) that are possible. I will have a closer look to see exactly how |
|
ℹ️ I have just tested the behaviour of the So how does everyone expect/want this process to work? |
|
How it's done in Qt, that was the original goal to keep that behaviour. With Qt I can type |
That wasn't what I was getting with a build of the ... and yeah - the |
|
AH! With @Faenriis help I've worked it out - if you type a sequence of keys quickly enough that it does string them together to find a match - however if you do it slower it will reset after a fraction of a second and, as I experienced, jump around the profiles. Maybe @Kebap was right when he talked about a timer that reset things - I was thinking of over a second but in fact it is only a fraction of a second. Okay with that knowledge I can have another think. |
This is to provide the same functionality that the QListWidget does for keypresses, if the keys are typed fast enough they are concatenated to form the text to search for. However if the user types slower than this then the individual keys are only considered on their own. This reflects what both Vadim and I experienced - in that he was typing fast enough to spell out a particular profile but I wasn't and so the profile that I was having selected was changing on each keypress. The time between keypresses allowed so that they can be concatenated I have set to be 1 second. This is significantly slower that the Qt code but it is long enough to permit the temporary disablement of non-matching profiles to be a useful visual feedback - and besides, it makes it easier to specify one of a number of profiles with a common initial text - the longer the timeout the more keys the user can string together! Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
vadi2
left a comment
There was a problem hiding this comment.
I honestly think it's fantastic, and the highlighting makes it even better than the original Qt implementation!
Just the notification should go, it's not all too helpful.
src/dlgConnectionProfiles.cpp
Outdated
| mCustomIconColors.append(QColor::fromHsv(i, 128, 255)); | ||
| } | ||
|
|
||
| mSearchTextTimer.setInterval(1000); |
There was a problem hiding this comment.
For easier reading!
| mSearchTextTimer.setInterval(1000); | |
| mSearchTextTimer.setInterval(1s); |
At the top, add:
#include <chrono>
using namespace std::chrono_literals;
There was a problem hiding this comment.
I'm getting deja vu all over again about this (std time intervals) - I'm not a fan of them but I guess i can do it... 🙁
src/dlgConnectionProfiles.cpp
Outdated
| void dlgConnectionProfiles::slot_searchTimerTimeOut() | ||
| { | ||
| reenableAllProfileItems(); | ||
| if (notificationAreaMessageBox->text() == tr("As you type more letters in the name of a profile all the non-matching ones " |
There was a problem hiding this comment.
It's intuitive enough to work with that it needs no explanation - and it's also impossible to read it fast enough :)
There was a problem hiding this comment.
Guess so - I must confess that is one incentive to drag the time interval out... 😈 ... but I'll leave the refactoring into clearNotificationArea() as that is still useful I think.
There was a problem hiding this comment.
Yes agree, clearNotificationArea() is good!
There was a problem hiding this comment.
clearNotificationArea ist super good - do more of those! 🌟
Remove the help text shown during typing the keys to select a profile - the time it is shown for is not enough for it to be that useful. Add `std::chrono` so we can give a time delay as `1s` instead of `1000` mS. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
This finally enables us to do away with the text under the profile icons as it replicates the normal `QListWidget` behaviour to move the selection to each item which begins with the first letter of the key pressed. This also makes the non-matching profiles get disabled which I think makes the action more obvious... Revised to include a timeout on concatenating keypresses: This is to provide the same functionality that the QListWidget does for keypresses, if the keys are typed fast enough they are concatenated to form the text to search for. However if the user types slower than this then the individual keys are only considered on their own. This reflects what both Vadim and I experienced - in that he was typing fast enough to spell out a particular profile but I wasn't and so the profile that I was having selected was changing on each keypress. The time between keypresses allowed so that they can be concatenated I have set to be 1 second. This is significantly slower that the Qt code but it is long enough to permit the temporary disablement of non-matching profiles to be a useful visual feedback - and besides, it makes it easier to specify one of a number of profiles with a common initial text - the longer the timeout the more keys the user can string together! Add `std::chrono` so we can give a time delay as `1s` instead of `1000` mS. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
This finally enables us to do away with the text under the profile icons as it replicates the normal
QListWidgetbehaviour to move the selection to each item which begins with the first letter of the key pressed.Signed-off-by: Stephen Lyons slysven@virginmedia.com