Bug 395376 - Multi-line result support (e.g. for showing full dictionary definitions)
Summary: Multi-line result support (e.g. for showing full dictionary definitions)
Status: RESOLVED FIXED
Alias: None
Product: krunner
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Unspecified
: NOR wishlist
Target Milestone: ---
Assignee: Kai Uwe Broulik
URL:
Keywords: usability
: 377987 420879 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-06-14 15:16 UTC by Rui Zhao
Modified: 2021-04-26 19:14 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.22


Attachments
Display multiline subtext (74.50 KB, image/png)
2020-06-11 09:31 UTC, Alexander Lohnau
Details
Show multiline subtext on selected (193.95 KB, image/gif)
2020-06-11 09:36 UTC, Alexander Lohnau
Details
Here the subtext is not really useful and just a nice to have. So giving it more space would be unnecessary. (15.84 KB, image/png)
2020-06-15 06:08 UTC, Alexander Lohnau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rui Zhao 2018-06-14 15:16:23 UTC
(This is a feature request of krunner.)

I quite love krunner and am planning to develop a custom runner - dictionary from a custom dictionary (software).

Despite finding almost no document, there is another problem: words often have multiple translation and/or different part-of-speech.
However, if I'm correct, krunner only have one line for a result.

Can krunner be extended to support multi-line results from a runner?
I'm thinking is like the expanded view of Android's notification, but restricting this to the first result is enough from my perspective.
Comment 1 Mark Smith 2019-11-27 19:55:39 UTC
Yes please, this could be very useful but since words are only defined in a single line of text (and even this line is shown in a very small space) in the end it's totally useless. It shouldn't be too hard to fix, right? Or at the very least show the full definition in a popup when you hover with the mouse?

Anyway, I see in this screenshot from Plasma 4 (I guess?) that the full definition was once upon a time shown: 
https://digitizor.com/krunner-dictionary-plugin-finally-available/
Comment 2 Nate Graham 2020-05-07 14:16:21 UTC
*** Bug 420879 has been marked as a duplicate of this bug. ***
Comment 3 Alexander Lohnau 2020-06-11 09:30:27 UTC
I agree that the space it definitely not enough for some runners, but I am not sure what a good solution for this is, so I am just throwing in some ideas:

We could always show the subtext and display multiline text.
Or we could only show the multilines if the match is selected.

PS: I would be against displaying the normal text as multiline, because that could make it look inconsistent.
Comment 4 Alexander Lohnau 2020-06-11 09:31:04 UTC
Created attachment 129225 [details]
Display multiline subtext
Comment 5 Alexander Lohnau 2020-06-11 09:36:02 UTC
Created attachment 129226 [details]
Show multiline subtext on selected

Or maybe display the subtext on a new line if it is focused?
This is just a crappy gif that demonstrates the workflow a bit^^.
Comment 6 Nate Graham 2020-06-11 13:02:12 UTC
Those are some interesting options! I like the one where the items don't resize dynamically. Dynamic resizing seems like a clever way to save space, but I think it would be visually distracting to have everything moving around all the time.
Comment 7 Gustavo Castro 2020-06-14 02:47:01 UTC
I prefer the first option, too.

Another alternative, albeit probably less elegant and simple, could be displaying a not-too-long paragraph for each entry (maybe two or three lines at most), but if the results are longer, make the item selectable to display the complete definition in a small dialog or copy its content to the clipboard.
Comment 8 Alexander Lohnau 2020-06-14 15:38:37 UTC
*** Bug 377987 has been marked as a duplicate of this bug. ***
Comment 9 Alexander Lohnau 2020-06-15 06:07:25 UTC
In the duplicate bug the idea of a tooltip has been made.

This way we could preserve a consistent look, but also enable displaying more information.

TBH I am not sure how we handle this for keyboard only use.

And an issue with a lot of runners is that a the text itself is already very long and the subtext is just added.
Even if the subtext has a low priority/almost no use, because the runner depends on the KRunner fontend to make it look pretty.
Comment 10 Alexander Lohnau 2020-06-15 06:08:29 UTC
Created attachment 129374 [details]
Here the subtext is not really useful and just a nice to have. So giving it more space would be unnecessary.
Comment 11 Alexander Lohnau 2020-08-02 17:39:47 UTC
Git commit 72d6d7d329654a5898066501a93a123656013a12 by Alexander Lohnau.
Committed on 02/08/2020 at 17:39.
Pushed by alex into branch 'master'.

Implement subtext tooltip for KRunner

M  +6    -0    lib/qml/ResultDelegate.qml

https://invent.kde.org/plasma/milou/commit/72d6d7d329654a5898066501a93a123656013a12
Comment 13 Alexander Lohnau 2021-04-26 19:00:15 UTC
Git commit 5388c3e9743f3ce82783af205e103e4bf20114b8 by Alexander Lohnau.
Committed on 26/04/2021 at 18:39.
Pushed by alex into branch 'master'.

querymatch: Add property to display text as multiline string

This is an explicit property because some runners accidentally
produce slightly too long text and we don't want to have multiple lines
in that case.

M  +12   -0    src/querymatch.cpp
M  +15   -0    src/querymatch.h

https://invent.kde.org/frameworks/krunner/commit/5388c3e9743f3ce82783af205e103e4bf20114b8
Comment 14 Alexander Lohnau 2021-04-26 19:14:29 UTC
Git commit 7f936de1a832511ce7c294073b498fbba6604420 by Alexander Lohnau.
Committed on 26/04/2021 at 18:54.
Pushed by alex into branch 'master'.

Allow runners to display multiline display text

Counterpart of https://invent.kde.org/frameworks/krunner/-/merge_requests/65

M  +2    -2    lib/qml/ResultDelegate.qml
M  +1    -0    lib/resultsmodel.cpp
M  +1    -0    lib/resultsmodel.h
M  +2    -0    lib/runnerresultsmodel.cpp

https://invent.kde.org/plasma/milou/commit/7f936de1a832511ce7c294073b498fbba6604420
Comment 15 Alexander Lohnau 2021-04-26 19:14:47 UTC
Git commit 579e4b94ae45982fa62593b7b8abdd2f9518ba8a by Alexander Lohnau.
Committed on 26/04/2021 at 18:53.
Pushed by alex into branch 'master'.

dictionaryrunner: Display definitions as multiline text
FIXED-IN: 5.22

M  +2    -2    runners/dictionary/dictionaryrunner.cpp

https://invent.kde.org/plasma/kdeplasma-addons/commit/579e4b94ae45982fa62593b7b8abdd2f9518ba8a