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 683391 - bad interaction between search and selection
bad interaction between search and selection
Status: RESOLVED OBSOLETE
Product: gnome-boxes
Classification: Applications
Component: general
3.9
Other Linux
: Normal normal
: --
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-09-05 09:02 UTC by Christophe Fergeau
Modified: 2016-03-31 13:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
collection-view: convert from filter_model to model for selection (1.15 KB, patch)
2012-09-05 09:40 UTC, Marc-Andre Lureau
committed Details | Review
Remove dead code (1014 bytes, patch)
2012-09-05 09:40 UTC, Marc-Andre Lureau
committed Details | Review
Hide selectionbar when searchbar is active (1.32 KB, patch)
2012-09-05 09:40 UTC, Marc-Andre Lureau
needs-work Details | Review

Description Christophe Fergeau 2012-09-05 09:02:04 UTC
Go to selection mode
Select an item
Go out of selection mode (the selected item will be rememberd)
Do a search so that the item was selected is hidden (eg select a windows box, and search for fedora
Go to selection mode
-> the topbar says '1 box selected', and clicking 'delete' removes the invisible box

Changing CollectionView:get_selected_items to use model_filter instead of model is a step in the right direction imo, but then clearing the search entry while in selection mode makes the hidden selected box appear and be selected. Imo we should just clear the saved selection when there are any changes in the filtering. I couldn't find how to do that from a quick glance, so just logging that bug for now.
Comment 1 Marc-Andre Lureau 2012-09-05 09:19:23 UTC
already helping a bit http://fpaste.org/K0wJ/
Comment 2 Marc-Andre Lureau 2012-09-05 09:19:53 UTC
nah fpaste, bad idea:

- Gtk.TreeIter iter;
- if (!model.get_iter (out iter, path))
+ Gtk.TreeIter filter_iter, iter;
+
+ if (!model_filter.get_iter (out filter_iter, path))
return false;
+ model_filter.convert_iter_to_child_iter (out iter, filter_iter);
Comment 3 Marc-Andre Lureau 2012-09-05 09:21:54 UTC
(In reply to comment #0)
> Changing CollectionView:get_selected_items to use model_filter instead of model
> is a step in the right direction imo, but then clearing the search entry while
> in selection mode makes the hidden selected box appear and be selected. Imo we
> should just clear the saved selection when there are any changes in the
> filtering. I couldn't find how to do that from a quick glance, so just logging
> that bug for now.

I am not sure it is a good idea. Instead, I would rather disable actions when there is an active search. We should check with designers. In general, it's bad idea to undo what the user did..
Comment 4 Marc-Andre Lureau 2012-09-05 09:40:48 UTC
Created attachment 223508 [details] [review]
collection-view: convert from filter_model to model for selection
Comment 5 Marc-Andre Lureau 2012-09-05 09:40:51 UTC
Created attachment 223509 [details] [review]
Remove dead code
Comment 6 Marc-Andre Lureau 2012-09-05 09:40:54 UTC
Created attachment 223510 [details] [review]
Hide selectionbar when searchbar is active
Comment 7 Christophe Fergeau 2012-09-05 11:09:11 UTC
Review of attachment 223508 [details] [review]:

I'm not sure what you are trying to address with this patch, but this does not help with what I described in this bug report, when going to selection mode after filtering out a selected entry, the topbar still shows "1 selected".
Comment 8 Christophe Fergeau 2012-09-05 11:10:18 UTC
Review of attachment 223509 [details] [review]:

ACK
Comment 9 Christophe Fergeau 2012-09-05 11:13:59 UTC
Review of attachment 223510 [details] [review]:

I'd rather have input from the designers before we do this.
This patch has a number of issues, it lets you go in selection mode when search is active, but hides the bottom bar which makes selection mode useless, if nothing is filtered but the search bar is shown, the bottom bar is still disabled (the search bar should probably go away after a while in such cases)
Comment 10 Marc-Andre Lureau 2012-09-05 12:01:11 UTC
Review of attachment 223510 [details] [review]:

the selection bar is only shown if there are selected items, and we are not in search mode.
Comment 11 Christophe Fergeau 2012-09-05 13:23:52 UTC
Review of attachment 223510 [details] [review]:

I've understood that, but there is no point in being able to select items if the selection bar is not present.
Comment 12 Marc-Andre Lureau 2012-09-05 14:55:21 UTC
Review of attachment 223510 [details] [review]:

I think it is useful to be able to filter the result and select items, and get back to selection mode with selection bar. It's clearly less error prone than current behaviour.
Comment 13 Christophe Fergeau 2012-09-05 15:06:33 UTC
Review of attachment 223510 [details] [review]:

I'd rather we get feedback from the design team before trying to be smart with the behaviour, imo the changes you suggest are not intuitive at all. Going from one weird behaviour to another behaviour which is weird in other ways, and then potentially changing it again after we get feedback from the design team  does not really seem worth it.
Comment 14 Marc-Andre Lureau 2012-09-06 11:15:31 UTC
Attachment 223508 [details] pushed as f9664c9 - collection-view: convert from filter_model to model for selection
Attachment 223509 [details] pushed as 062e150 - Remove dead code
Comment 15 Jakub Steiner 2012-10-16 21:49:57 UTC
While it's still not super elegant, when we ran into this for Documents, we suggested to always show selected items regardless of the query (OR <selected>). For cases when this is undesirable (bigger selection, still need to add a few items with query), the checkbox next to the search entry allows to hide the selection and only match the query string.

https://raw.github.com/gnome-design-team/gnome-mockups/master/documents/selection-toolbar.png
Comment 16 Marc-Andre Lureau 2012-10-17 08:42:16 UTC
(In reply to comment #15)
> While it's still not super elegant, when we ran into this for Documents, we
> suggested to always show selected items regardless of the query (OR
> <selected>). For cases when this is undesirable (bigger selection, still need
> to add a few items with query), the checkbox next to the search entry allows to
> hide the selection and only match the query string.
> 
> https://raw.github.com/gnome-design-team/gnome-mockups/master/documents/selection-toolbar.png

Ah nice! May I suggest that the results are sorted alphabetically, and not list the selected items first? (if they are already selected, it is likely that's not what we are looking for, but it's still important to show it's part of the current selection)
Comment 17 Marc-Andre Lureau 2012-10-17 08:43:26 UTC
(In reply to comment #16)
> Ah nice! May I suggest that the results are sorted alphabetically, and not list
> the selected items first? (if they are already selected, it is likely that's
> not what we are looking for, but it's still important to show it's part of the
> current selection)

ah perhaps it is already sorted by time in the screenshot!
Comment 18 Zeeshan Ali 2013-03-01 01:04:37 UTC
Is this still valid? I can't reproduce through the steps in the description.
Comment 19 Christophe Fergeau 2013-03-27 19:07:13 UTC
Yes, though the steps changed as selection mode behaviour changed (selection no longer remembered when going in and out of selection mode)

Go to selection mode
Select an item
Do a search so that the item was selected is hidden (eg select a windows box,
and search for fedora
-> the topbar says '1 box selected', and clicking 'delete' removes the
invisible box

However, things are much less confusing this way, so it might be acceptable not to do anything. Comment #15 seems to suggest this needs to be improved.
Comment 20 Zeeshan Ali 2013-03-27 21:58:02 UTC
Looking at comment#15, we'll need to add new UI if we want to fix this further. So moving to 3.9.
Comment 21 Zeeshan Ali 2014-02-21 01:16:58 UTC
Well the selection is no longer remembered when you exit the selection mode so this can't be reproduced anymore.