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 779960 - Implement room list filtering
Implement room list filtering
Status: RESOLVED FIXED
Product: polari
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Polari maintainers
Polari maintainers
Depends on:
Blocks:
 
 
Reported: 2017-03-13 03:16 UTC by Florian Müllner
Modified: 2017-03-14 01:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
utils: Add updateTerms() helper (1.49 KB, patch)
2017-03-13 03:16 UTC, Florian Müllner
committed Details | Review
connection: Only refilter networks on actual filter changes (1.21 KB, patch)
2017-03-13 03:16 UTC, Florian Müllner
committed Details | Review
serverRoomList: Add ModelFilter (6.08 KB, patch)
2017-03-13 03:16 UTC, Florian Müllner
committed Details | Review
serverRoomList: Implement filtering (1.90 KB, patch)
2017-03-13 03:17 UTC, Florian Müllner
committed Details | Review
serverRoomList: Don't use filter text as room name to join (2.16 KB, patch)
2017-03-13 03:17 UTC, Florian Müllner
committed Details | Review
serverRoomList: Include custom room item in list (4.81 KB, patch)
2017-03-13 03:17 UTC, Florian Müllner
committed Details | Review
serverRoomList: Hide custom room item for exact matches (2.61 KB, patch)
2017-03-13 03:17 UTC, Florian Müllner
committed Details | Review
serverRoomList: Provide an efficient way to join a single room (3.05 KB, patch)
2017-03-13 03:17 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2017-03-13 03:16:40 UTC
Patches are on top of bug 779940. For testing convenience, everything is available on the wip/fmuellner/roomlist-filtering branch, or as flatpak build in the repo at https://people.gnome.org/~fmuellner/fmuellner.flatpakrepo.
Comment 1 Florian Müllner 2017-03-13 03:16:45 UTC
Created attachment 347781 [details] [review]
utils: Add updateTerms() helper

As we will soon add filtering to the server room list, it makes
sense to generalize how we normalize and split filter text into
terms. Add a utility method based on the code in ConnectionsList
for that purpose. As a bonus, the method's return value indicates
whether the terms actually changed, so callers can avoid unneeded
work (for example when the amount of stripped whitespace changed).
Comment 2 Florian Müllner 2017-03-13 03:16:51 UTC
Created attachment 347782 [details] [review]
connection: Only refilter networks on actual filter changes

Use the shared updateTerms() helper and take advantage of its return
value.
Comment 3 Florian Müllner 2017-03-13 03:16:57 UTC
Created attachment 347783 [details] [review]
serverRoomList: Add ModelFilter

TreeViews are filtered by wrapping the actual model in a ModelFilter,
so do that to prepare for room list filtering.
Comment 4 Florian Müllner 2017-03-13 03:17:03 UTC
Created attachment 347784 [details] [review]
serverRoomList: Implement filtering

The entry already looks like it can be used to filter the list of
rooms, now make it behave as advertised.
Comment 5 Florian Müllner 2017-03-13 03:17:11 UTC
Created attachment 347785 [details] [review]
serverRoomList: Don't use filter text as room name to join

Now that the entry is used for filtering the room list, it is extremely
weird to also use its text as room name that is joined along the selected
rooms from the list - it means the user either has to enter the complete
room name (in which case selecting rooms from the list becomes pointless),
or remember to clear the entry after selecting a room.

Just remove the conflicting functionality for now, we will bring back
the ability to enter custom room names in a way that is compatible with
filtering soon.
Comment 6 Florian Müllner 2017-03-13 03:17:17 UTC
Created attachment 347786 [details] [review]
serverRoomList: Include custom room item in list

While creating new rooms (by joining a non-existent room) isn't a very
common operation, allowing users to enter a custom room name is still
important, as it means they can join rooms while the list hasn't been
loaded yet.
To account for that case, include an additional row in the list that
uses the current filter text as room name.
Comment 7 Florian Müllner 2017-03-13 03:17:24 UTC
Created attachment 347787 [details] [review]
serverRoomList: Hide custom room item for exact matches

Now that we mirror the filter text in a row, we can end up with a
duplicated room name in case the list contains an exact match. We
don't need a custom item in that case, so hide it.
Comment 8 Florian Müllner 2017-03-13 03:17:30 UTC
Created attachment 347788 [details] [review]
serverRoomList: Provide an efficient way to join a single room

The ability to join multiple rooms at once is neat, but most useful
right after setting up a new network. After that, by far the most
common case is to join a single room, so it's worth making that
case as efficient as possible. Right now we require users to select
a room by selecting a row via mouse or keynav, and then activate
the join button. This is often slower than the pre-room-list dialog,
where a room was joined by hitting Enter after typing the (full)
room name - to improve on both current and old behavior, keep the
top result selected when filtering and toggle the selected row
when the entry is activated.
Comment 9 Florian Müllner 2017-03-14 01:06:53 UTC
Attachment 347781 [details] pushed as 4eecba1 - utils: Add updateTerms() helper
Attachment 347782 [details] pushed as c8814c8 - connection: Only refilter networks on actual filter changes
Attachment 347783 [details] pushed as 2182d2b - serverRoomList: Add ModelFilter
Attachment 347784 [details] pushed as 6c139ab - serverRoomList: Implement filtering
Attachment 347785 [details] pushed as 7f30cee - serverRoomList: Don't use filter text as room name to join
Attachment 347786 [details] pushed as ebbf7ba - serverRoomList: Include custom room item in list
Attachment 347787 [details] pushed as e470de1 - serverRoomList: Hide custom room item for exact matches
Attachment 347788 [details] pushed as 05c3115 - serverRoomList: Provide an efficient way to join a single room