Thursday, May 13, 2021

Command Popup HUD for LibreOffice

Command Popup is a pop-up window that lets you search for commands that are present in the main menu and run them. This was requested in bug tdf#91874 and over-time accumulated over 14 duplicated bugs reports, so it was a very requested feature.

I'm intrigued by similar functionality in other programs, because it enables very quick access to commands (or programs) and at the same time don't need to move your hand off the keyboard. It also makes it easy to search for commands - especially in an application like LibreOffice with humongous main menu. So I decided to try to implement it for LibreOffice.

Figure 1: Command Popup window

I was working on it here and there in my free time and managed to make it work as I imagined, however it was very rough around the edges and needed a lot of polish. Luckily in April, we had a hack week at Collabora, where I decided to use some time to work on finishing the command popup. I dusted up the old code and converted it to use the weld framework for widgets and fixed the many bugs, but I didn't manage to finish it completely so it took until recently that I actually pushed the code upstream into master.

The main UX focus is to easy search and navigate with the keyboard. When the Command pop-up is focused, all keyboard events should go to the search edit box, so it is possible to change the search term, however hitting up/down should change the selection in the tree view, where the search results are shown, and enter should execute the command. To get this working correctly was quite a challenge, but I found the correct formula eventually after trying some different ideas. Of course using the mouse should still work as well. 

To show the Command Popup, there is a menu entry in "Help > Search Commands" and is by default bind to "Ctrl+F1" shortcut (however this may change). 

The Command Popup will be available in LibreOffice 7.2, but if you want to try it out, you can get the current daily build, or wait for the LibreOffice 7.2 Alpha1. Any suggestions and comments are welcome. If you find a bug, please report it in the LibreOffice bugzilla page.


3 comments:

  1. Wouldn't this be better not to be 'hidden' behind a shortcut? Why not have this as a search box with a little magnifying glass on the application front so it is always visible? A little like the search box with Microsoft Office. There you search for actions and functionality so similar to this I think.

    Well done indeed this has the potential to be really useful.

    ReplyDelete
  2. Command Popup HUD I do wonder if it should have a option to be a toolbar/side bar thing instead of hidden in a menu due to how useful the search is to new users and old users alike.

    Think about it I have some text selected I am looking for a option to alter it being able to see text because its in the side bar where I am search.

    Even with the current pop-up it will be really useful at times. Particular with cases where something in a different place in libreoffice to MS office or to prior versions of libreoffice. Yes I have been caught out a few times when a feature I used a decade ago is no longer in exactly the same place it use to be.

    Advance feature down the track could be a show me how to access X feature as a form of inbuilt help. That most likely would be simpler in a side bar have a button to tick to go from run the command to show me where it is.

    Please do remember different UX configurations turn the menu bar off. This is why I think there need to be a tool bar icon/textbox or in the side bar. So the search function remains findable with the menu bar off. Yes not everyone with the menu bar off is going to think press Ctrl+F1 or so other short cut.

    Multi UX feature of libreoffice is something newer than the first time this bug was reported.

    Thanks just the same for the great work so far.

    ReplyDelete
  3. Hi Tomaž,
    Question on Twitter from Rizal Muttaqin (https://twitter.com/zalmut/status/1395748066729226241)

    " Just curios what Search field right under Help (not the one you talked about) is for in macOS? "

    ReplyDelete