UI: show recently selected items at the top of searches #110828
No reviewers
Labels
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#110828
Loading…
Reference in New Issue
No description provided.
Delete Branch "JacquesLucke/blender:recent-searches"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The goal is to make the search faster to use by dynamically adapting to the user. This can be achieved using the simple but common approach of showing recently selected items at the top. Note, that the "matching score" between the query and each search item still has precedence when determining the order. So the last used item is only at the top, if there is no other search item that matches the query better.
Besides making the search generally faster to use, my hope is that this can also reduce the need for manually weighting search items in some places. This is because while the ordering might not be perfect the first time, it will always be once the user selected the element that should be at the top once.
This patch currently includes:
Things that we might want to include:
This topic has been discussed in the past on phabricator.
UI: sort recently used search items to the topto UI: show recently selected items at the top of searches@blender-bot build
Would it work well if we show the latest item(s) with the Recover Last Session icon?
Hm, not sure if that would help too much. Especially since over time, most entries at the top would likely have this icon. (not to mention that I don't know how to add an icon there right now)
For reference, this is how e.g. the menu search looks like. I guess the icon would be shown on the left side, but then there would be an empty space for other entries.
I wonder if it makes more sense to add the search that takes the cache into account to the UI module, with a new file like
UI_string_search.hh
. It feels a bit high level for blenkernel, since it's really about user interaction.@ -0,0 +14,4 @@
*/
void add_recent_search(StringRef choosen_str);
const blender::string_search::RecentCache *get_recent_cache();
Unnecessary
blender::
here I think, same belowThat's actually necessary here because otherwise there is an ambiguity.
@ -0,0 +20,4 @@
void read_recent_searches_file();
/**
* Wrapper for the lower level #StringSearch in blenlib, that takes recent searches into account
Unnecessary comma after
blenlib
@ -19,0 +23,4 @@
struct RecentCache {
/**
* Stores a logical time stamp for each previously choosen search item. The higher the time
* stamp, the more recent the item has been selected.
the more recent
->the more recently
After using this for a while it just becomes natural and expected. The order of items becomes irrelevant because I was simply scanning for names of operators I used prior.
Yes, a separator would be a nice touch but even without it's not that important because after a while most items shown as you open the dialog will be recent searches anyway.
+1 looks wise.
This works well in my testing too, and I find the diff straightforward and even elegant :)
@ -0,0 +31,4 @@
return storage;
}
void add_recent_search(const StringRef choosen_str)
Spelling:
choosen
->chosen
. Same in the header.@blender-bot build
While the feature is handy, I think there should be a preference to disable it.
Ok, I'll add the option. Do you have any opinion on where it should be shown in the user preferences?
I added the option in a fairly random place in the user preferences right now. I'm not sure where to put it, should it be in a new panel for search related stuff?
There are no other search options yet so it's probably okay to put it in there.
How about adding a separator, column heading, and change the label to something more descriptive:
Thank you! UI-wise this is good to go, and a great addition especially for the Add menu search.
@ -16,3 +18,3 @@
int length;
void *user_data;
int weight;
int recent_time;
Worth noting what units this is in & if it can ever be negative.
Do we really need a new preference option for this? I feel like with every new usability feature we add, we start having this discussion. It's easy to bloat the preferences this way, just because "there might be some people who prefer to disable this". Then I rather take the time to evaluate things first. I would say this feature can just be disabled in background mode?
Scrolled over the code briefly, looks fine.
Menu search is used in undo tests that don't run in background mode, in general I think it's reasonable to have functionality run predictably without depending on previous executions.
Without a way to disable this option, automated actions will manipulate the users history too.
I just realised the title is UI: show recently selected items at the top of searches, yet it seems that only items that have been searched for are added to the top, not the ones I clicked on. This issue was brought up by Julien Kaspar as well.
@JacquesLucke Should I open a report on this, is it out of scope? I mentioned this once in person I think, but forgot to ask again.
The recent-searches thing only applies to the search indeed. We can also make it work when clicking on things in a menu I guess, can't say how difficult it will be yet. It's not really a bug currently.