[pve-devel] [PATCH manager 2/3] headerbar: show shortcut for search in emptyText

Lukas Wagner l.wagner at proxmox.com
Fri Jul 21 16:04:54 CEST 2023


On 7/21/23 15:31, Thomas Lamprecht wrote:
> On 21/07/2023 11:39, Lukas Wagner wrote:
>> The shortcut is not really documented anywhere, so I think it make it a
>> bit more obvious to the user.
> 
> style not: commit message should wrap text at 70 character columns.
> https://pve.proxmox.com/wiki/Developer_Documentation#Commits_and_Commit_Messages
> 
Yes, I'm sorry. Usually neovim wraps automatically, but that does not work
when I edit lines afterwards. Really got to set up a color column for
commit messages.
>>
>> Signed-off-by: Lukas Wagner <l.wagner at proxmox.com>
>> ---
>>   www/manager6/form/GlobalSearchField.js | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/www/manager6/form/GlobalSearchField.js b/www/manager6/form/GlobalSearchField.js
>> index c009ac8b..8e5e13c0 100644
>> --- a/www/manager6/form/GlobalSearchField.js
>> +++ b/www/manager6/form/GlobalSearchField.js
>> @@ -8,7 +8,7 @@ Ext.define('PVE.form.GlobalSearchField', {
>>       extend: 'Ext.form.field.Text',
>>       alias: 'widget.pveGlobalSearchField',
>>   
>> -    emptyText: gettext('Search'),
>> +    emptyText: gettext('Search (Ctrl-Shift-F)'),
> 
> not true for MacOS though, maybe check navigator.platform for /mac/i and
> depending on that use CTRL or ⌘

Very good point, I did not think about that.
Macs do have a control key and that ctrl key seems to have the same keycode [1], so
the label would also be correct on a Mac, and the shortcut *should* work.

However, it would of course be more idiomatic to use Cmd-Shift-F, because
browsers usually use Cmd-F for search on macOS.
So in other words, we should adapt the label AND change the code that sets
up the keyboard shortcut.
Will look into that, just need to find a way how to test this properly ;)
> 
> Semi-related, is the aria-keyshortcuts attribute actually set here?
> 
> https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-keyshortcuts

Judging from the web inspector, this attribute does not seem to be set.
I'll look into that.


[1] https://stackoverflow.com/questions/47117199/control-key-in-web-browser-on-mac

-- 
- Lukas





More information about the pve-devel mailing list