This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 253015 - Find in projects: unintuitive behavior for "Last: Open Projects"
Summary: Find in projects: unintuitive behavior for "Last: Open Projects"
Status: NEW
Alias: None
Product: utilities
Classification: Unclassified
Component: Search (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-16 08:43 UTC by terje7601
Modified: 2015-08-07 11:49 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Draft of the fix (6.77 KB, patch)
2015-08-07 11:37 UTC, Jaroslav Havlin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description terje7601 2015-06-16 08:43:25 UTC
When re-doing a search on "Open Projects", the search dialog proposes "Last: Open Projects". However, this doesn't use a "refreshed" list of projects. So if projects have been opened in the meantime, they aren't searched. Likewise, if projects have been closed, they are still searched. This is unintuitive & it took me quite a while to figure out why NetBeans didn't find what I was looking for. Also, I regularly open/close projects, and with the current behavior I can't even tell for sure which projects are actually searched (since I don't remember which projects were open at the time of my previous search). So in my opinion, "Last: Open Projects" should always search "all current open projects".
Comment 1 Jaroslav Havlin 2015-08-07 11:20:20 UTC
> However, this doesn't use a "refreshed" list of projects.
This is the currently intended behavior. But I understand it is confusing.

> This is unintuitive & it took me quite a while to figure out why NetBeans 
> didn't find what I was looking for.
This should be improved.

The idea behind the current behavior is to use the same static list of directories when search is refreshed and scope "Last" is selected.
So, if the last scope was "Selection", the scope will be the same when refreshing, even if the actual selection has changed (which is correct, I think).

For "Last: Open Projects", it works the same. To use current open projects, users need to change scope to "Open Projects". Similar case is "Current Project" (which is also correct I thing, we don't want to update the last search scope if file from another project is selected in the IDE).

I'm not sure what is correct for "Last: Open Projects". I've made a small internal poll and it was quite balanced. I'll need to ask more people.

Maybe we could add number of open project to name of the scope (so it would be "Last: Open Projects (5)"). But it is not very helpful if number of open projects is high.

Note: The (refresh) button title is "Modify Criteria", which is more exact than "Refresh". Search criteria can be changed, but search scope is preserved. Maybe the icon is confusing.

Thank you for reporting.
Comment 2 Jaroslav Havlin 2015-08-07 11:37:32 UTC
Created attachment 155214 [details]
Draft of the fix

Possible fix - if we decide to change the behavior. Needs to be tested. Also impact on API clients (that may rely on immutability of SearchInfo instances) should be evaluated.

Another option would be to add some "update" method to search info, which would return new updated instance if needed.
Comment 3 Jaroslav Havlin 2015-08-07 11:49:26 UTC
Note: Workaround is using Ctrl+Shift+F for opening the Find dialog. Search scope as well as other parameters are persisted.