Bug 442186 - Show accessed remote shares as on-demand items in the Networks section of the places panel
Summary: Show accessed remote shares as on-demand items in the Networks section of the...
Status: REPORTED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: git master
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2021-09-08 17:27 UTC by Nate Graham
Modified: 2023-04-05 06:46 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2021-09-08 17:27:33 UTC
When you access a Samba share using a KIO-using app or a non-KIO-using app with kio-fuse, the share itself is not added to the places panel in various KDE apps in the network group. This makes it hard to access that location again if you're accessing items on it a lot during this usage session; each time you need to access the share, you will have to go to Network > Shared Folders (SMB), > [share name] all over again. This is kind of a pain in the butt. Currently I work around this by adding a permanent places panel item for my shared computer's Samba share, but this takes up space for something I don't use very often, and would not work at all for a corporate setting where a user may connect to many Samba shares frequently.

It would be nice if connecting to a Samba share automatically added a temporary entry for it in the Places panel, along with the option to disconnect from it to make it disappear again. Basically it would appear on demand like a removable disk, but in the Networks section.
Comment 1 Harald Sitter 2021-09-08 18:29:36 UTC
The places tech doesn't have any infrastructure for this, does it? I reckon this needs addressing in kio/dolphin (a way to temporarily inject new places - whatever temporary here means) first before we can do anything from the slave side.
Comment 2 Nate Graham 2021-09-08 18:38:45 UTC
It has the ability to display transient items like this for removable devices. I was thinking we could maybe re-use that tech. It wouldn't surprise me if supporting work on Dolphin and/or KIO were required, though.
Comment 3 Harald Sitter 2021-09-08 18:53:02 UTC
(In reply to Nate Graham from comment #2)
> It has the ability to display transient items like this for removable
> devices. I was thinking we could maybe re-use that tech.

That's different though. That is simply querying solid for mount points. Nothing is actively "injecting" resources for that
Comment 4 Nate Graham 2021-09-08 18:57:31 UTC
If there's nothing for the ioslave to do, feel free to move this to kio or dolphin
Comment 5 Harald Sitter 2021-09-08 19:34:51 UTC
Well, it needs discussing with someone ;)

I would imagine the easiest would be to give the places system (which I think is in kio?) to handle all this and then have select slaves push urls into it. But I havent really thought about it very long. Long story short there may be something to do for the slave but first need the foundational tech somewhere
Comment 6 Harald Sitter 2021-09-09 09:49:07 UTC
After some musing I'm not convinced the worker actually should do anything. The main trick here is that the worker doesn't know what the client application is doing. e.g. you could have a sync application that uses KIO to implement network syncing. The user doesn't necessarily know about it nor did they take any active actions to visit the host, so it'd be odd if a random host then appears in the places model. That leads me to conclude that realistically this needs to be entirely handled in a higher level system.

There is also the fact that this should extend to all remote slaves. There's no reason bluetooth, sftp, gdrive shouldn't all work the same. So, also from a code reuse POV it probably makes more sense that a higher level system takes care of this for all workers with a suitable property set to opt into this.

A number of questions also popped into my mind:

What does temporary mean exactly? Do they go away when you log out? Or on reboot? What if you don't reboot for a year? Or maybe there's always only N entries at most?

What exactly is the UX here? You go into a host in dolphin and it adds it into the model? Or do you have to actually open a file there? Does it also apply if you manually enter the URL? What if you manually open a program with an url (`gwenview smb://foo/meow.jpg`)?

Do file open dialogs work the same as though used through dolphin?
Comment 7 Harald Sitter 2021-09-10 10:12:27 UTC
https://invent.kde.org/frameworks/kio/-/blob/master/src/filewidgets/kfileplacesmodel.cpp#L425

Uses kactivities under the hood

https://invent.kde.org/network/kio-extras/-/blob/master/recentlyused/recentlyused.cpp#L67

It's not really folded into the model though but an entry that leads to the recentlyused worker. Dolphin could use that to add entries to its places view. Or indeed the KIO model could expand the content. Bonus advantage that this would build on existing tech and not require any extra changes to track recent url activities.
Comment 8 Nate Graham 2021-09-10 13:35:36 UTC
Potentially relevant: https://invent.kde.org/system/kio-fuse/-/issues/18


> What does temporary mean exactly? Do they go away when you log out? Or on reboot?
> What if you don't reboot for a year? Or maybe there's always only N entries at most?
In my mind, for Samba at least, it means "while logged into the share, until logging out of it (manual or automatic)".


> What exactly is the UX here? You go into a host in dolphin and it adds it into the
> model? Or do you have to actually open a file there? Does it also apply if you
> manually enter the URL? What if you manually open a program with an url
> (`gwenview smb://foo/meow.jpg`)?
Any action that causes you to log into the share should do it IMO. Whether this means logging into the share and entering the password (or letting the system enter a saved password) or accessing a file on it from some other means, and entering the password.


> Do file open dialogs work the same as though used through dolphin?
In this manner, they should, IMO. Generally they do. They currently share the same data model; Dolphin just does custom drawing for its Places Panel (which IMO it should stop doing anyway).
Comment 9 Nate Graham 2021-09-10 15:26:03 UTC
Bug 442258 also looks relevant.
Comment 10 Harald Sitter 2021-09-13 12:16:15 UTC
Moving to KIO. Since you want this in both dolphin and fopendialog we'll probably need support in the kfileplacesmodel. Also since it should trigger on pretty much any interaction with a share, injecting into the model probably needs to happen in a fairly central place as well (kdirmodel maybe?).

In a way it feels like what you are describing is simply a more opinionated recent locations system, really. We could possibly just build on the existing locations tech...

- KIO would need to actually inject visited locations into KActivities (fileopen for example does not seem to do that right now)
- Then the placesmodel can ingest recent location data from KActivities and only show remote schemes. We need a way to figure out which protocols are remote though.

That is all very KDE though...
A more "native" option would be to always trigger kio-fuse when first accessing a network protocol, so we have a mount reflected in the system, and that mount then shows up to all programs as well as solid. Kfileplacesmodel then can simply model NetworkShare types from solid.