buffer filtering: alpha-prioritize exact match, then startsWith (as per upstream)
In short
- When filtering buffers by string, prioritize relevant results first
- Priorize by exact matches, then matches that start with the string, then all else
- Within these priorities, everything's sorted as before
- Makes it easier to search by exact/starting string
Rationale
It seems more likely to search for a channel/nickname with the starting letters rather than filtering by the middle, as that's how the channel/nickname list is sorted (when alphabetical sorting is enabled). Similarly, an exact match should emphasize that over any substring matches.
As per upstream, Quasseldroid should prioritize results that exactly match, then start with, over the rest of the results that merely contain the filter string.
This is personal opinion, feel free to disagree!
See the merged upstream pull request: [quassel/quassel/pr #438] client: For filtering, prioritize exact, startsWith.
Examples
Setup
- Add six PMs,
acar
,bcar
,car
,careful
,caring
,racecar
- E.g.
/query [name]
- E.g.
- Temporarily hide
car
- Search for
car
with buffer filter, e.g. Ctrl+S
Before
Screenshot from Quassel desktop
- Normal
- acar
- bcar
- careful
- caring
- racecar
- Temporarily hidden
- car
After
Screenshot from Quassel desktop
- Exact match
- car (still temporarily hidden)
- Starts with match
- careful
- caring
- Normal
- acar
- bcar
- racecar