Bug 419622

Summary: Allow closing the Discover window during install and showing a progress notification instead
Product: [Applications] Discover Reporter: dagobertram
Component: discoverAssignee: Dan Leinir Turthra Jensen <leinir>
Status: RESOLVED FIXED    
Severity: wishlist CC: aleixpol, giecrilj, nate
Priority: NOR    
Version: 5.18.4   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In: 5.26
Attachments: Discover "blocks" the task bar since there is less free space

Description dagobertram 2020-04-04 09:32:28 UTC
SUMMARY
I really would like to have the ability to "close" the Discover application without closing all the pending tasks. On KDE Neon there is quite a lot to update generally. So when I update the computer with Discover, most of the time it is not necessary for me to leave the window open. I would like to close it while it is finishing the install process. Maybe there is a way to delay closing the background process until it finished updating?
Hopefully you can understand what I mean (Bug 403465 is quite the opposite). Maybe the following makes it clearer:

STEPS TO REPRODUCE
1. start updating the machine or install an application
2. try to close (hit the "x") on Discover before the process has finished

OBSERVED RESULT
Discover lets you choose to stop the pending tasks to close the application (since Bug 403465 got resolved)

EXPECTED RESULT
the Discover window vanishes but it does not really close the whole application until all pending tasks are complete

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Operating System: KDE neon 5.18
KDE Plasma Version: 5.18.4
KDE Frameworks Version: 5.68.0
Qt Version: 5.14.1
Comment 1 Nate Graham 2020-04-15 02:34:56 UTC
Why not just minimize it? The use case of "I want to get rid of this window from my view without actually quitting the application" is what window minimization is for, no?
Comment 2 dagobertram 2020-04-15 18:53:50 UTC
Well then I would have to come back to Discover and check if everything got installed. Meanwhile Discover blocks my task bar despite I finished everything I wanted it to start doing. After it finished successfully I finally can close it. Why not make it possible to preempt this step? It would be a significant usability improvement, at least for me.
Comment 3 Nate Graham 2020-04-15 18:57:29 UTC
What do you mean by "Discover blocks my task bar"?
Comment 4 dagobertram 2020-04-15 19:49:53 UTC
Created attachment 127578 [details]
Discover "blocks" the task bar since there is less free space
Comment 5 dagobertram 2020-04-15 19:51:50 UTC
I'm sorry english is not my first language ... Maybe it is called the task switcher? It just takes up space, where other windows might sit. I just attached a screenshot which might help describing.
Comment 6 Nate Graham 2020-04-15 20:12:21 UTC
Oh I see, it just takes up space.
Comment 7 Nate Graham 2020-04-17 15:13:09 UTC
How about this: while the update notifier is displayed and updates are in progress, Discover will allow you to close its main window but remain running. If you do this, when the update completes successfully, it will display a notification about this. If it fails, it will display a persistent notification mentioning the failure that prompts you to re-open the main window.
Comment 8 dagobertram 2020-04-17 18:10:43 UTC
Sounds really nice!
What do you think about turning the task itself into a notification? Similar to the one for copying files. It could show the progress while it is doing stuff. And then ...
> ... when the update completes successfully, it will display a notification about > this. If it fails, it will display a persistent notification mentioning the
> failure that prompts you to re-open the main window.
You could even make it possible to click the notification at any time to re-open Discover.
Comment 9 dagobertram 2020-04-17 18:13:20 UTC
But how to integrate that behavior with the existing one for "hitting the »x«" (Bug 403465)? How are you supposed to stop the installation process instantly?
Comment 10 Nate Graham 2020-04-17 19:26:29 UTC
(In reply to dagobertram from comment #8)
> Sounds really nice!
> What do you think about turning the task itself into a notification? Similar
> to the one for copying files. It could show the progress while it is doing
> stuff. And then you could even make it possible to click the notification at any
> time to re-open Discover.
I think that's a great idea!

(In reply to dagobertram from comment #9)
> But how to integrate that behavior with the existing one for "hitting the
> »x«" (Bug 403465)? How are you supposed to stop the installation process
> instantly?
With the above proposal, you would be able to cancel immediately using the Stop button on the notification.
Comment 11 dagobertram 2020-04-17 20:05:27 UTC
(In reply to Nate Graham from comment #10)
> With the above proposal, you would be able to cancel immediately using the
> Stop button on the notification.

Nice! Thank you for your support and dedication. I think it's awesome to see theory slowly becoming reality!
Comment 12 Nate Graham 2020-04-17 20:09:46 UTC
Heh, you're very welcome! Of cource, now somebody needs to do it. :)
Comment 13 dagobertram 2020-04-17 20:18:39 UTC
(In reply to Nate Graham from comment #12)
> Heh, you're very welcome! Of cource, now somebody needs to do it. :)

I know. Well, I just started to learn basic python but I guess Qt/C++, QML etc. are quite a different story ...  I have no experience in these languages whatsoever so I am happy to wait. ;D
(... Maybe there are really easy Python problems somewhere in the KDE world ready to get solved? I really would like to get more involved.)
Comment 14 Nate Graham 2020-04-17 20:21:37 UTC
I'm afraid we don't do much with Python, but C++ isn't such a bear. :) I started contributing code before I really had any idea what I was doing in C++. It's a time-honored tradition in fact! If you want some ideas, check out https://community.kde.org/Goals/Usability_%26_Productivity
Comment 15 Nate Graham 2022-05-23 19:10:02 UTC
*** Bug 454196 has been marked as a duplicate of this bug. ***
Comment 16 Bug Janitor Service 2022-05-24 15:20:37 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/discover/-/merge_requests/308
Comment 17 Aleix Pol 2022-05-25 23:29:37 UTC
Git commit 5751e862556f8ee17ea0af60b8e0959559b90b6d by Aleix Pol.
Committed on 24/05/2022 at 16:12.
Pushed by apol into branch 'master'.

Do not prevent closing the main window while busy

Instead now we will hide the main window and let discover finish
performing the remaining transactions in the background.
Thus, now when we close we will:
- Hide the main window
- Show a SNI to restore the window
- Expose the transaction state in KUiServerJobTracker

M  +1    -2    CMakeLists.txt
M  +2    -0    discover/CMakeLists.txt
M  +83   -5    discover/DiscoverObject.cpp
M  +5    -1    discover/DiscoverObject.h
M  +3    -3    discover/qml/DiscoverWindow.qml
M  +4    -3    libdiscover/backends/DummyBackend/DummyTransaction.cpp

https://invent.kde.org/plasma/discover/commit/5751e862556f8ee17ea0af60b8e0959559b90b6d