Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client: For filtering, prioritize exact, startsWith #438

Merged
merged 1 commit into from
Oct 14, 2018

Conversation

digitalcircuit
Copy link
Contributor

@digitalcircuit digitalcircuit commented Oct 6, 2018

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
Criteria Rank Reason
Impact ★☆☆ 1/3 User-facing change in buffer filter order
Risk ★☆☆ 1/3 Order of buffer filtering (new to 0.13) will change; could be unexpected
Intrusiveness ★☆☆ 1/3 Small set of changes, shouldn't interfere with other pull requests

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.

Quassel 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!

Examples

Setup

  1. Add six PMs, acar, bcar, car, careful, caring, racecar
    • E.g. /query [name]
  2. Temporarily hide car
  3. Search for car with buffer filter, e.g. Ctrl+S

Before

Screenshot of Quassel before these changes showing the All Chats buffer list, filtering on 'car', with the PMs created as per the example setup

  • Normal
    • acar
    • bcar
    • careful
    • caring
    • racecar
  • Temporarily hidden
    • car

After

Screenshot of Quassel after these changes showing the All Chats buffer list, filtering on 'car', with the PMs created as per the example setup

  • Exact match
    • car (still temporarily hidden)
  • Starts with match
    • careful
    • caring
  • Normal
    • acar
    • bcar
    • racecar

When filtering buffer view results, prioritize exact string matches,
then prioritize startsWith matches, both case-insensitive.  Within
these results, sort normally (e.g. alphabetical).

This gives weight to exact matches and the start of the string.  When
no filter string is specified, sorting goes back to normal.

Search string: "car"
Before:
> acar
> bcar
> careful
> caring
> racecar
> car [hidden]

After:
> car [hidden]
> careful
> caring
> acar
> bcar
> racecar

Where [hidden] represents a buffer that's temporarily or permanently
hidden.
@Sput42 Sput42 merged commit 8a8d7e0 into quassel:master Oct 14, 2018
@digitalcircuit digitalcircuit deleted the ft-filter-prioritize-matches branch October 14, 2018 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants