ubports / ubuntu-touch

Ubuntu Touch's issue inbox is now migrated to GitLab.
https://gitlab.com/ubports/ubuntu-touch
1.28k stars 110 forks source link

Support of multiple apps registered for the same protocol/domain in url-dispacher #2027

Open maciek134 opened 2 years ago

maciek134 commented 2 years ago

Description of the feature

Would be nice if url-dispatcher could handle multiple apps registering for the same protocol/domain. Right now it's whichever app registers first, meaning some protocols are immediately off-limits to 3rd party apps (some should still probably be either locked or require manual review, like settings://)

Illustrations

url-dispatcher modal popup design   url-dispatcher ContentHub design   System Settings screen for Default Applications

(I didn't make the checkbox properly, so it's just a colored box, sorry ;p)

Prototypes

Flow 1: Opening a link without having a default app set

This is how I see it working when the default app is not set. The default not being set is what would happen when a new app registers for a protocol/domain that was already registered to something else - I think this would be nice UX that wouldn't require users going to system settings to change the default (I hear Windows users are not fond of the way it's done there ;p)

Not sure here whether tapping the app should accept and close the modal, or should there be the standard Cancel / Ok buttons?

Flow 2: System Settings page (only Weather / App One is clickable)

Took some inspiration from Android and UTTT. I don't have UITK fully re-created in penpot yet so I don't have the slide-to-reveal-options list items, but I guess there would be two: edit ofc, and clear - in case the user decides they always want to be asked.

Flow 3: ContentHub-style app selection

On @cibersheep's suggestion, uses the same page as is recommended for ContentHub - not sure about the checkbox at the bottom, but otherwise it looks familiar and doesn't stand out how I thought it would.

I'm happy to work on this and I've already looked into how this could be implemented.

cibersheep commented 2 years ago

This sounds exciting! I would display a Page for Flow 1 as a ContentHub instead of a Dialog (more like for the Flow 2) For Flow 2, where would you suggest to add the app category? Under System Settings / system? I see adding a «reset default app» in System / Reset / Reset default apps.

maciek134 commented 2 years ago

Hmm, my reasoning for the dialog was that ContentHub at the moment is just a QML component that's included in the app and the app has total control over it - here it would be a system thing on top (like the trust store prompt in eg. camera). This might also be less jarring when used in webapps or even native apps that use heavy styling - whatever we show won't (can't) be styleable by the app developer and the app doesn't decide whether it's shown or not.

I'll make a prototype for a full Page to check how it would look like ;p

As for the settings page, I didn't think that far ahead :D on Ubuntu Desktop it's under System > Details, on Windows they have an Apps category. I guess System > Default Applications would make sense, at least for now.

Adding a "reset default apps" option sounds good too.

cibersheep commented 2 years ago

I understand your reasoning, but don't webapps use qml anyway? (like the overlay for external url?), and you have to provide a Dialog qml anyway. And the ContentHub has an element to show the Peers. So, I guess I am not understand the problem here.

For the category (I don't think we should look to other OS --specially the 'file -> format page' ones- :P-, for Unity you are right it is under System / Details... and that was always confusing for me. So that I never find it. Do you think we need an «app» category? Does something else we need to do with apps? Or is it more a System option were defaults app are defined? If it's the second, then System > Default Applications could work

maciek134 commented 2 years ago

I understand your reasoning, but don't webapps use qml anyway? (like the overlay for external url?), and you have to provide a Dialog qml anyway. And the ContentHub has an element to show the Peers. So, I guess I am not understand the problem here.

That's what I mean - web apps (or other apps) have control over the ContentHub component (which was recently discussed on Telegram - we should change that too, since you can really mess with it if you want - change colors, fonts, placement, etc). Here it wouldn't be possible, because it's a system service, so I think overlaying a full page with the default OS styling might be a bit jarring if the app is branded (as is apparently the trend now). Might be easier to explain once I sit down and finish the prototypes ;p

Do you think we need an «app» category? Does something else we need to do with apps? Or is it more a System option were defaults app are defined? If it's the second, then System > Default Applications could work

At the moment no, since it would have a single item. But having a system menu for Apps could be useful - being able to see details, clear cache, uninstall, etc in one place without a 3rd party app sounds nice. So maybe for now we could put it under System > Default Applications and think about it later? Instead of a category it could also be just an Applications page under System with the list of apps and menus like Default Apps above the list.

maciek134 commented 2 years ago

@cibersheep created a flow for ContentHub-style selection and I have to agree, it doesn't look out of place :D Flow 3: ContentHub-style app selection

cibersheep commented 2 years ago

@cibersheep created a flow for ContentHub-style selection and I have to agree, it doesn't look out of place :D

Yep, this makes sense to me :)

At the moment no, since it would have a single item. But having a system menu for Apps could be useful - being able to see details, clear cache, uninstall, etc in one place without a 3rd party app sounds nice.

That sounds like a place for the OpenStore. Again, I would say that app updates (now in system settings / system, updates) should be taken care only by OpenStore. Now you can uninstall the there, and get the details. Only clear cache would be needed.

So maybe for now we could put it under System > Default Applications and think about it later? Instead of a category it could also be just an Applications page under System with the list of apps and menus like Default Apps above the list.

That sounds like a plan