Bug 487855

Summary: UserFilterRole keyword joining causes unexpected word constructs
Product: [Applications] systemsettings Reporter: medin <med.medin.2014>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: nate, sitter
Priority: NOR    
Version: 6.0.5   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 6.1
Sentry Crash Report:
Attachments: image

Description medin 2024-05-31 21:31:28 UTC
Created attachment 170029 [details]
image

See attached image for more info.
Comment 1 Harald Sitter 2024-06-03 08:39:52 UTC
It'd be grand if you could fill in the bug reporting template.

What do you expect to happen and why do you expect it to happen?
Comment 2 medin 2024-06-03 18:03:09 UTC
(In reply to Harald Sitter from comment #1)
> It'd be grand if you could fill in the bug reporting template.
> 
> What do you expect to happen and why do you expect it to happen?


The attached image is clear and enough to explain the bug, but to satisfy some minds I will do it. :(


Steps:

1) Open Plasma settings
2) Search for "ssl"

Observed result:
The search shows  "Accessibility" and disabled/empty "Wifi & Networking".

Expected result:
The search should show nothing, as "SSL & Certificates" page was removed from "Wifi & Networking", and Accessibility has no relation to SSL.
Comment 3 Harald Sitter 2024-06-03 20:48:34 UTC
Neither of them match because of the SSL technology, they match because the search term 'ssl' is appears in their keywords list.

The underlying data is a bit smudged though because     case MenuModel::UserFilterRole: joins the terms without separator, causing awkward word constructs such as 'keysslow'
Comment 4 Bug Janitor Service 2024-06-03 21:02:45 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/systemsettings/-/merge_requests/315
Comment 5 Harald Sitter 2024-06-04 13:15:27 UTC
Git commit 905ae9bce14eb99671a6524e625485ba96621ef1 by Harald Sitter.
Committed on 04/06/2024 at 13:14.
Pushed by sitter into branch 'master'.

join keywords lists using ZERO WIDTH SPACE instead of empty string

this prevents the filter rule from matching silly word constructs

for example kcm_access.json has `["bounce keys", "slow keys"]` as
keywords. when we join those without separator we get 'bounce keysslow
keys'. that still matches the original words but also the silly join
construct of e.g. 'ssl'. to prevent all unintended keyword unions (or
sequences thereof) simply insert a ZWSP as separator

M  +6    -1    app/MenuModel.cpp

https://invent.kde.org/plasma/systemsettings/-/commit/905ae9bce14eb99671a6524e625485ba96621ef1
Comment 6 Harald Sitter 2024-06-04 13:17:06 UTC
Git commit 5f576c3b6763889fd2ff795e3f765f0db68b0ab0 by Harald Sitter.
Committed on 04/06/2024 at 13:15.
Pushed by sitter into branch 'Plasma/6.1'.

join keywords lists using ZERO WIDTH SPACE instead of empty string

this prevents the filter rule from matching silly word constructs

for example kcm_access.json has `["bounce keys", "slow keys"]` as
keywords. when we join those without separator we get 'bounce keysslow
keys'. that still matches the original words but also the silly join
construct of e.g. 'ssl'. to prevent all unintended keyword unions (or
sequences thereof) simply insert a ZWSP as separator


(cherry picked from commit 905ae9bce14eb99671a6524e625485ba96621ef1)

Co-authored-by: Harald Sitter <sitter@kde.org>

M  +6    -1    app/MenuModel.cpp

https://invent.kde.org/plasma/systemsettings/-/commit/5f576c3b6763889fd2ff795e3f765f0db68b0ab0