Improve keyboard usage for menu search popup #51087

Open
opened 2017-03-30 10:50:07 +02:00 by blend-it · 48 comments
Member

System Information
NA

Blender Version
Broken: example: 2.78
Worked: >new feature request<

Short description of error
when spacebar search menu popups and user start writing the required command, only down-arrow keyboard shortcut are allowed to select the required command, starting from first item on top.
It will be very useful and faster if also up-arrow can be usable to select the last item in the list (so starting from bottom).
See image as reference: green arrow show the required feature, red one is the only one actually working.
spacebar-search.png

Exact steps for others to reproduce the error
not an error, only UI usage improvement :)

**System Information** NA **Blender Version** Broken: example: 2.78 Worked: >new feature request< **Short description of error** when spacebar search menu popups and user start writing the required command, only down-arrow keyboard shortcut are allowed to select the required command, starting from first item on top. It will be very useful and faster if also up-arrow can be usable to select the last item in the list (so starting from bottom). See image as reference: green arrow show the required feature, red one is the only one actually working. ![spacebar-search.png](https://archive.blender.org/developer/F528627/spacebar-search.png) **Exact steps for others to reproduce the error** not an error, only UI usage improvement :)
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @blend-it

Added subscriber: @blend-it

Added subscribers: @JulianEisel, @mano-wii

Added subscribers: @JulianEisel, @mano-wii

This does not seem complicated, and would really be useful!
@JulianEisel, could you take a look?

This does not seem complicated, and would really be useful! @JulianEisel, could you take a look?

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Seems reasonable, moved to quick hacks since this is a nice one for new developers.

Seems reasonable, moved to quick hacks since this is a nice one for new developers.
Author
Member

I always propose easy and fast hacks, but unfortunately I'm not a coder, so I can't do it myself (and I don't want broke something) ;)

I always propose easy and fast hacks, but unfortunately I'm not a coder, so I can't do it myself (and I don't want broke something) ;)

Added subscriber: @karinafantonio

Added subscriber: @karinafantonio
Karina Antonio self-assigned this 2017-04-03 04:28:58 +02:00

Hi, first-time contributor here! I've created a patch with this new feature, plus a short screencast attached.

One issue evident in the screencast is how long it takes to wrap from the top of the searchbox to the bottom for long item lists. This happens because I'm calling ui_searchbox_update in a loop, but I don't know any other way to access the end of the item list/the size of the item list. Furthermore, where is the value of items.more assigned?

searchbox_wrap.diff
searchbox_wrap_demo.mp4
Any feedback is greatly appreciated!

Hi, first-time contributor here! I've created a patch with this new feature, plus a short screencast attached. One issue evident in the screencast is how long it takes to wrap from the top of the searchbox to the bottom for long item lists. This happens because I'm calling `ui_searchbox_update` in a loop, but I don't know any other way to access the end of the item list/the size of the item list. Furthermore, where is the value of items.more assigned? [searchbox_wrap.diff](https://archive.blender.org/developer/F532399/searchbox_wrap.diff) [searchbox_wrap_demo.mp4](https://archive.blender.org/developer/F532404/searchbox_wrap_demo.mp4) Any feedback is greatly appreciated!

Hi @karinafantonio,

I liked your code but one thing worries me...
It's this part:

while (data->items.more) {
	data->items.offset++;
	data->active = data->items.totitem - 1;
	ui_searchbox_update(C, ar, but, false);
}

We can have about 2000 items in a list
ui_searchbox_update in a loop can be quite inefficient.
So, if it were not for this detail, I think the patch would already be good to commit.

Hi @karinafantonio, I liked your code but one thing worries me... It's this part: ``` while (data->items.more) { data->items.offset++; data->active = data->items.totitem - 1; ui_searchbox_update(C, ar, but, false); } ``` We can have about 2000 items in a list `ui_searchbox_update` in a loop can be quite inefficient. So, if it were not for this detail, I think the patch would already be good to commit.

Ahh, I see. Here's the updated patch with that part removed.

Using (and making!) this patch feels really nice!

searchbox_wrap.diff

Ahh, I see. Here's the updated patch with that part removed. Using (and making!) this patch feels really nice! [searchbox_wrap.diff](https://archive.blender.org/developer/F532693/searchbox_wrap.diff)
Author
Member

Thanks for working on this feature :)
I nothing understand about the code, but if there are a performance issue, I can suggest you can trigger your routine only when:

  • letters in searchbox are more than 3,4 or 5 (the consequent list is shorter so faster to process,) and/or
  • the list itself is shorter than 6-10 items (is less useful to scroll from bottom if the last item is not visible to the user).
Thanks for working on this feature :) I nothing understand about the code, but if there are a performance issue, I can suggest you can trigger your routine only when: - letters in searchbox are more than 3,4 or 5 (the consequent list is shorter so faster to process,) and/or - the list itself is shorter than 6-10 items (is less useful to scroll from bottom if the last item is not visible to the user).

Hi, no problem, it was fun to do and a nice feature to have! ^^

The patch adds scrolling from bottom to top for all list sizes, and scrolling from top to bottom only when the entire list is visible (so when the list is <= 10 items). No performance issues at all for these cases, there are only issues for the case of wrapping from top to bottom with large lists with many not-visible items (so my latest patch disabled wrapping in this case).

Hi, no problem, it was fun to do and a nice feature to have! ^^ The patch adds scrolling from bottom to top for all list sizes, and scrolling from top to bottom only when the entire list is visible (so when the list is <= 10 items). No performance issues at all for these cases, there are only issues for the case of wrapping from top to bottom with large lists with many not-visible items (so my latest patch disabled wrapping in this case).

@blend-it changing behavior based on number of letters typed will seem buggy from user perspective.

I don't see why wrapping the list would have to be a slow operation.

@blend-it changing behavior based on number of letters typed will seem buggy from user perspective. I don't see why wrapping the list would have to be a slow operation.
Author
Member

@ideasman42 About the number of letters typed, I understand your point, but with less of 3/4 letters the list is so long and user can't see the bottom, so I think nobody try to scroll from an "invisible" bottom.
Anyway, I can't compile and try to check performance, so if you don't find this kind of issues, no problem!
Thanks to all and I hope to find the feature in 2.79 ;)

@ideasman42 About the number of letters typed, I understand your point, but with less of 3/4 letters the list is so long and user can't see the bottom, so I think nobody try to scroll from an "invisible" bottom. Anyway, I can't compile and try to check performance, so if you don't find this kind of issues, no problem! Thanks to all and I hope to find the feature in 2.79 ;)

Added subscriber: @Dinulja

Added subscriber: @Dinulja
Author
Member

the patch was not included in 2.79.... it's possible for 2.79a? :)

the patch was not included in 2.79.... it's possible for 2.79a? :)

Added subscriber: @kouhaku111

Added subscriber: @kouhaku111

where can i find the definition of data->active, items.totitem, items.more and items.offset

where can i find the definition of data->active, items.totitem, items.more and items.offset

Added subscriber: @sandstorm

Added subscriber: @sandstorm

Is there a commit for this patch? I compiled the latest version and it does not work as in the video.

Is there a commit for this patch? I compiled the latest version and it does not work as in the video.

Added subscriber: @durgesh

Added subscriber: @durgesh

I am working on improving the patch

I am working on improving the patch

Added subscriber: @REMBO

Added subscriber: @REMBO

Is this task not done? Can I progress it?

Is this task not done? Can I progress it?

Added subscriber: @KalyanS

Added subscriber: @KalyanS

This comment was removed by @KalyanS

*This comment was removed by @KalyanS*

Added subscriber: @Fre2910

Added subscriber: @Fre2910

Added subscriber: @carlosedubarreto

Added subscriber: @carlosedubarreto

Added subscriber: @don.miguel

Added subscriber: @don.miguel

Hello, the patch does not seem to work so I worked on a different approach. If anyone is interested, here is my submitted patch .

Hello, the patch does not seem to work so I worked on a different approach. If anyone is interested, here is my [submitted patch ](https://developer.blender.org/D6813).

Added subscriber: @Faraz-007

Added subscriber: @Faraz-007

Removed subscriber: @Faraz-007

Removed subscriber: @Faraz-007

Added subscriber: @lemagedurage

Added subscriber: @lemagedurage

Hi there!

Since I couldn't get previous patches to apply / work properly, and because I'm doing a course for my university, I dived into this issue too.
This issue is harder than it might look because the underlying data structure is an iterator, which doesn't expose the total amount of search results. Wrapping from the bottom item to the top one is trivial, but wrapping from the top item to the bottom one is not.

Based on Karina's and Don's work, I created a somewhat simplified patch here that should work fine on the current master branch.

Testers and feedback are welcome. I hope this little feature can be added soon.

Hi there! Since I couldn't get previous patches to apply / work properly, and because I'm doing a course for my university, I dived into this issue too. This issue is harder than it might look because the underlying data structure is an iterator, which doesn't expose the total amount of search results. Wrapping from the bottom item to the top one is trivial, but wrapping from the top item to the bottom one is not. Based on Karina's and Don's work, I created a somewhat simplified patch [here ](https://developer.blender.org/differential/diff/23590/) that should work fine on the current master branch. Testers and feedback are welcome. I hope this little feature can be added soon.

Added subscriber: @propersquid

Added subscriber: @propersquid

Added subscriber: @paul2t

Added subscriber: @paul2t

In #51087#906688, @lemagedurage wrote:
Based on Karina's and Don's work, I created a somewhat simplified patch here that should work fine on the current master branch.

Hello Jaap,
You need to create a new Revision from this diff and attach it to this task.
Then, someone will review it.

> In #51087#906688, @lemagedurage wrote: > Based on Karina's and Don's work, I created a somewhat simplified patch [here ](https://developer.blender.org/differential/diff/23590/) that should work fine on the current master branch. Hello Jaap, You need to create a new Revision from this diff and attach it to this task. Then, someone will review it.
Campbell Barton changed title from Improve keyboard usage for spacebar search menu to Improve keyboard usage for menu search popup 2020-08-26 04:33:58 +02:00

Added subscriber: @Luckeneder

Added subscriber: @Luckeneder

I tried the diff from Jaap, and i can comfirm it works
interface_region_search.c

I tried the diff from Jaap, and i can comfirm it works [interface_region_search.c](https://archive.blender.org/developer/F9515788/interface_region_search.c)

Added subscriber: @AlexCarter

Added subscriber: @AlexCarter

{F9611275}Ok so I took a look into it and found a way that both wraps to the actual bottom of search list (not just the bottom of what is visual) and also does so without a while loop. Line 1004 in interface_template_search_menu.c creates a variable filtered_amount which is the full size of the search array so to the uiSearchItems struct I added an int size and a setter function so now the total size of the search array is stored and accessible to us back in the ui_searchbox_select function.

{[F9611275](https://archive.blender.org/developer/F9611275/ui-search-loop.diff)}Ok so I took a look into it and found a way that both wraps to the actual bottom of search list (not just the bottom of what is visual) and also does so without a while loop. Line 1004 in `interface_template_search_menu.c` creates a variable `filtered_amount` which is the full size of the search array so to the `uiSearchItems` struct I added an int `size` and a setter function so now the total size of the search array is stored and accessible to us back in the `ui_searchbox_select` function.

Added subscriber: @jenkm

Added subscriber: @jenkm

I don't mind being able to jump to the first/last item, e.g. with the Page Up / Page Down.
But this endless scrolling doesn't look like a good idea.
We already have this issue in menus and enums, when it is hard to stop at the first/last item. It requires increased accuracy and multiple attempts.
A good example is scrolling the enum on mouse hover with ctrl+wheel. It would be much more useful if scrolling stopped at the first/last item.

I'm not even talking about scrolling with a macbook trackpad, the current behavior with endless scrolling is just terrible, it does not allow you to use a quick swipe to scroll to the beginning/end.

Or another example is a preview menu like a Brushes or MatCap, it's just terrible if it's looped, if the previews are similar then you just don't understand when you've reached the end.

I don't mind being able to jump to the first/last item, e.g. with the Page Up / Page Down. But this endless scrolling doesn't look like a good idea. We already have this issue in menus and enums, when it is hard to stop at the first/last item. It requires increased accuracy and multiple attempts. A good example is scrolling the enum on mouse hover with ctrl+wheel. It would be much more useful if scrolling stopped at the first/last item. I'm not even talking about scrolling with a macbook trackpad, the current behavior with endless scrolling is just terrible, it does not allow you to use a quick swipe to scroll to the beginning/end. Or another example is a preview menu like a Brushes or MatCap, it's just terrible if it's looped, if the previews are similar then you just don't understand when you've reached the end.

Added subscriber: @3di

Added subscriber: @3di

I think continuous scroll should be OK on the f3 menu because it's a fixed size and so will never go off screen. The reason the continuous scroll is such a problem on shift a menus is because those menus can grow off screen, and because the mouse scroll wheel is not very accurate, it's really tricky to select the offscreen options without accidentally going back to the bottom/top

I think nice additions would be:

  • page up/down to jump a page at a time
  • home/end to go to the top or bottom
  • scroll with middle mouse button + drag (like you can everywhere else in Blender).
  • scroll bar on the right for fast scrolling.
I think continuous scroll should be OK on the f3 menu because it's a fixed size and so will never go off screen. The reason the continuous scroll is such a problem on shift a menus is because those menus can grow off screen, and because the mouse scroll wheel is not very accurate, it's really tricky to select the offscreen options without accidentally going back to the bottom/top I think nice additions would be: - page up/down to jump a page at a time - home/end to go to the top or bottom - scroll with middle mouse button + drag (like you can everywhere else in Blender). - scroll bar on the right for fast scrolling.

Added subscriber: @Camilo-Villavicencio

Added subscriber: @Camilo-Villavicencio

Hi! I was able to implement a combination of the first two additions Michael listed above.

Now, pressing the Page Up and Page down keys on Windows on the f3 menu will first select the top or bottom list item of the menu respectively. Pressing either button again will then jump up/down a page in the f3 menu.

I've attached a diff with my additions, as well as a short video of the feature in use.

{F13047150}blender_3lzPkau4nh.mp4

Feel free to let me know what you guys think!

Hi! I was able to implement a combination of the first two additions Michael listed above. Now, pressing the Page Up and Page down keys on Windows on the f3 menu will first select the top or bottom list item of the menu respectively. Pressing either button again will then jump up/down a page in the f3 menu. I've attached a diff with my additions, as well as a short video of the feature in use. {[F13047150](https://archive.blender.org/developer/F13047150/menu-page-jumping.diff)}[blender_3lzPkau4nh.mp4](https://archive.blender.org/developer/F13047156/blender_3lzPkau4nh.mp4) Feel free to let me know what you guys think!
Philipp Oeser removed the
Interest
User Interface
label 2023-02-10 09:26:26 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
22 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#51087
No description provided.