After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 588730 - Searching within a notebook should inform the user that no results were found within that notebook
Searching within a notebook should inform the user that no results were found...
Status: RESOLVED NOTGNOME
Product: tomboy
Classification: Applications
Component: General
0.14.x
Other All
: Normal enhancement
: 1.4.0
Assigned To: Tomboy Maintainers
Tomboy Maintainers
gnome[moved-to-github]
Depends on:
Blocks:
 
 
Reported: 2009-07-16 01:05 UTC by Scott Ritchie
Modified: 2017-07-31 12:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
Patch to ask the user whether they want all notebooks searched. (2.36 KB, patch)
2011-03-04 02:12 UTC, Luke Yelavich
none Details | Review
patch (not fixed completely) (3.68 KB, patch)
2011-04-27 20:07 UTC, Abhinav
reviewed Details | Review
screenshot for the last patch (32.49 KB, image/png)
2011-04-27 20:10 UTC, Abhinav
  Details
Proposed Patch (4.37 KB, patch)
2011-06-21 10:32 UTC, Abhinav
committed Details | Review
Handle line wrap and label resizing (2.63 KB, patch)
2011-06-26 00:39 UTC, Aaron D Borden
none Details | Review
Handle line wrap and label resizing (2.71 KB, patch)
2011-06-26 02:31 UTC, Aaron D Borden
none Details | Review

Description Scott Ritchie 2009-07-16 01:05:04 UTC
This is a small, but simple, bit of polish that I'd really like. I was searching for one of my notes, so I typed some words in it into the search bar. No results were found, and I was sure I had a note named like that, leaving me momentarily confused. It took me a bit to realize that I was searching within a specific notebook, and that tomboy was confining my search to that notebook in particular.

So, my suggestion is relatively simple - when the user is searching within a notebook and no results are found, write something like "No results within this notebook found" in the area where the search results normally appear.

Since the user's next action there will usually be to search all notebooks instead, it would also be nice to offer to do this for the user. So something like "No results within this notebook found. Click here to search across all notes." Clicking there would then have the same effect as clicking on All Notes.

Another case to consider is when the user finds a note while searching within a notebook, but not all of them. Here the system could (in the background) scan all the notebooks when a notebook-specific search is done, and then if other matches are found say something like "4 matching notes were found in other notebooks".

Anyway, even if only part of these suggestions are tried, it would probably improve the user experience, especially for new users to tomboy who don't yet know that searches are confined to a particular notebook. Thank you!

Other information:
https://bugs.launchpad.net/ubuntu/+source/tomboy/+bug/386893
Comment 1 Sandy Armstrong 2009-07-19 15:07:20 UTC
(In reply to comment #0)
> So, my suggestion is relatively simple - when the user is searching within a
> notebook and no results are found, write something like "No results within this
> notebook found" in the area where the search results normally appear.
> 
> Since the user's next action there will usually be to search all notebooks
> instead, it would also be nice to offer to do this for the user. So something
> like "No results within this notebook found. Click here to search across all
> notes." Clicking there would then have the same effect as clicking on All
> Notes.

Great idea, confirming bug (as an enhancement), patches welcome.  Taking away the usability keyword, because apparently that's only needed if we want a usability team member to provide their input.

> Another case to consider is when the user finds a note while searching within a
> notebook, but not all of them. Here the system could (in the background) scan
> all the notebooks when a notebook-specific search is done, and then if other
> matches are found say something like "4 matching notes were found in other
> notebooks".

This is also a great idea.  Please file it as a separate enhancement bug with a dependency on this bug.

> Anyway, even if only part of these suggestions are tried, it would probably
> improve the user experience, especially for new users to tomboy who don't yet
> know that searches are confined to a particular notebook. Thank you!

Yup, thanks for pointing this out.  :-)
Comment 2 Luke Yelavich 2011-03-04 02:12:39 UTC
Created attachment 182433 [details] [review]
Patch to ask the user whether they want all notebooks searched.

Here is a patch from Abhinav Upadhyay <er.abhinav.upadhyay@gmail.com> with the beginnings of what has been asked for, but according to the bug, he is likely going to see whether he can further extend the patch to use buttons/links inside the UI instead of a message box.

Its a start at least.
Comment 3 Abhinav 2011-04-27 20:07:54 UTC
Created attachment 186777 [details] [review]
patch (not fixed completely)

This does not work well enough. 

What it does is to remove the tree view with a new HPane in which I display a LinkButton. If the user clicks on it, "All Notes" gets selected and all the search results get displayed.

However it does not work well enough. For example
if you search for a note which isn't available in the selected notebook, you will get the message. Now if you add a new note (containing any text), after that the tree view isn't restored for some reason. I cannot figure it out right now. 

If you have some idea what might go wrong on adding a new note then please tell me, I would be happy to update this patch. I have been working on this for sometime now :-)

Thanks
Comment 4 Abhinav 2011-04-27 20:10:50 UTC
Created attachment 186778 [details]
screenshot for the last patch
Comment 5 Aaron D Borden 2011-06-11 19:54:11 UTC
Review of attachment 186777 [details] [review]:

Thanks for the patch. It looks good, I'm going to play around with it.

::: Tomboy/RecentChanges.cs
@@ +588,3 @@
+			String message = Catalog.GetString ("No results found " +
+				"in the selected notebook.\n Click here to " +
+				"search across all notes.");

I'm not a huge fan of puttin in the line break. Is there a way we can make it wrap automatically?
Comment 6 Aaron D Borden 2011-06-11 21:01:56 UTC
I looked at this more, and there are a bunch of Gtk warnings which are probably indicating problems that result in the strange behaviors you're seeing.

Some things I've noticed:
1. You're creating a new no_matches_box every time the search is 0. You can just wrap this in a if (no_matches_box == null) ...
2. Most of the warnings are from adding/removing the boxes to the hpaned container. RestoreMatchesWindow is probably being called more often than you think, and Gtk doesn't like removing an object that doesn't exist (it's not allowed).

I'm not sure what the "correct" way of doing this would be but I'm sure someone else has done it before. You might want to search the gtk-app archives or look for an existing app that does something similar and take a peak at the code. Good luck!
Comment 7 Abhinav 2011-06-21 10:32:21 UTC
Created attachment 190356 [details] [review]
Proposed Patch

Thanks Aaron. I did look at the code again. I think I have fixed the problem being caused by creating new notes. I just needed to add relevant function calls at the event handlers for note creation, deletion, modification etc.

Regarding, the wrapping of the text of the LinkButton, I couldn't really find any documentation on this. I am not sure if it's possible. 

Thanks
Abhinav
Comment 8 Aaron D Borden 2011-06-25 19:02:10 UTC
mentioned in IRC, take a look at gtk_label_set_line_wrap for the text wrapping.
Comment 9 Aaron D Borden 2011-06-26 00:37:35 UTC
Comment on attachment 190356 [details] [review]
Proposed Patch

commit 80e24a006aa0b49770b52d077f5b3afe85996517
Comment 10 Aaron D Borden 2011-06-26 00:39:29 UTC
Created attachment 190672 [details] [review]
Handle line wrap and label resizing

I'm surprised, but the gtk.label doesn't automatically resize itself. Abhinav, would you take a look at this patch?
Comment 11 Aaron D Borden 2011-06-26 02:31:37 UTC
Created attachment 190674 [details] [review]
Handle line wrap and label resizing

slight modification, text was getting cutoff.
Comment 12 Aaron D Borden 2011-07-14 18:57:49 UTC
Bummer, I noticed that if you have the "Unfiled Notes" notebook selected, the widget won't show up
Comment 13 André Klapper 2017-07-31 12:47:08 UTC
The Tomboy team has moved from GNOME Bugzilla to GitHub for bug reports and feature requests: 
      https://github.com/tomboy-notes/tomboy/issues/
Closing this report as NOTGNOME as part of Bugzilla Housekeeping (bug 781054) to keep tasks in one place. Please feel free to transfer this task to GitHub if this task is still valid in a recent Tomboy version. 
We are sorry for the inconvenience.