mozilla-mobile / focus-android

⚠️ Firefox Focus (Android) moved to a new repository. It is now developed and maintained as part of: https://github.com/mozilla-mobile/firefox-android
https://github.com/mozilla-mobile/firefox-android
Mozilla Public License 2.0
2.11k stars 711 forks source link

Default to displaying "Share" in custom tabs #1358

Closed autonome closed 6 years ago

autonome commented 6 years ago

This is a key feature in a very common task workflow, is quite frustrating that it's not there. The share menu item is present when opening the browser itself.

STR:

  1. Open Reddit app
  2. Open a link
  3. Opens in Focus
  4. Open the stacked dots menu

Expected: A "share" menu item is available.

Actual: There is no "share" menu item.

mcomella commented 6 years ago

I can reproduce. Reddit opens a custom tab and it appears our custom tab implementation doesn't include the "Share" menu item.

@pocmo Was this intentional in any way?

autonome commented 6 years ago

FWIW, I've seen it on other sites as well, not only Reddit.

On Fri, Oct 20, 2017, 00:04 Michael Comella notifications@github.com wrote:

I can reproduce. Reddit opens a custom tab and it appears our custom tab implementation doesn't include the "Share" menu item.

@pocmo https://github.com/pocmo Was this intentional in any way?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mozilla-mobile/focus-android/issues/1358#issuecomment-337997899, or mute the thread https://github.com/notifications/unsubscribe-auth/AADDtx5jmvOLyKrwBdt6mzrJJ2Vx8L48ks5st5YmgaJpZM4PgW2k .

pocmo commented 6 years ago

@pocmo Was this intentional in any way?

It depends. There's an Intent extra (CustomTabsIntent.EXTRA_DEFAULT_SHARE_MENU_ITEM) that tells us whether the third-party app wants to show a share item or not. So there could be multiple things happening here:

autonome commented 6 years ago

Those apps do not want to show a share item

These are just web pages I'm visiting. As a user, I should be deciding whether I want to share the URL, not anything else (eg, whether I have native app that's registered as handler for that domain or not).

On Fri, Oct 20, 2017 at 2:25 PM Sebastian Kaspari notifications@github.com wrote:

@pocmo https://github.com/pocmo Was this intentional in any way?

It depends. There's an Intent extra (CustomTabsIntent.EXTRA_DEFAULT_SHARE_MENU_ITEM) that tells us whether the third-party app wants to show a share item or not. So there could be multiple things happening here:

  • Those apps do not want to show a share item (in this case: No bug - other browsers with custom tab support should behave the same)
  • The apps want to show the share item - but there's a bug preventing it to show up
  • The app does not define the extra; in which case we default to "false" and do not show the item. And in this case it would be interesting to know if we should default to "true" and what Chrome does.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mozilla-mobile/focus-android/issues/1358#issuecomment-338147882, or mute the thread https://github.com/notifications/unsubscribe-auth/AADDt4azH4L7BwRDJlNMhZqiGRgFvwrCks5suGAHgaJpZM4PgW2k .

pocmo commented 6 years ago

These are just web pages I'm visiting. As a user, I should be deciding whether I want to share the URL, not anything else (eg, whether I have native app that's registered as handler for that domain or not).

I agree that a lot of the web related decisions Android has made give power to the developers of apps and take them away from the users (and their user agents). In custom tabs you have at least the option to switch to the full browser (via the menu). I do not think it would be worth fighting the custom tabs protocol here.

mcomella commented 6 years ago

in which case we default to "false" and do not show the item. And in this case it would be interesting to know if we should default to "true" and what Chrome does.

That being said, there are other places where they add true to intents so maybe they override it in some circumstances.

These are just web pages I'm visiting.

I agree with this sentiment. My understanding of the best user experience is that you can share web pages by default but apps can disable them if they choose (e.g. Citi might implement part of their app as a WebView but it doesn't really make sense to share internal app urls, as opposed to true web pages). fwiw, I also think developers who want a share action are more likely to forget adding one than developers who don't want it are to forget removing it.

Chrome may have left out default share so that apps can add their own custom share intents (e.g. sometimes you might not want to just share the URL directly).

I do not think it would be worth fighting the custom tabs protocol here.

Chrome seemed open to custom tabs feedback when it was first implemented - maybe it'd be worth asking about?

I think the action items for this bug are:

autonome commented 6 years ago

Can we err on the side of user agency in this? I reported this because I'm consistently seeing real URLs that I want to add to Pocket... and the share option is missing.

pocmo commented 6 years ago

Also see #1529 - There should be an option to switch to "full-featured" Focus. But it's missing currently.

bbinto commented 6 years ago

The app does not define the extra; in which case we default to "false" and do not show the item. And > in this case it would be interesting to know if we should default to "true" and what Chrome does.

We should at least set it to "True"

autonome commented 6 years ago

Hm, I initially filed this with Reddit as the example, and it morphed to talk about "custom tab".

But as I said in the first few comments, it's elsewhere too. Eg:

https://mozillagfx.wordpress.com/2017/11/06/webrender-newsletter-9/

Pretty sure this one should have a share option. I don't have a Wordpress app installed (if that's how the custom tab stuff works).

autonome commented 6 years ago

Should I file a different issue for just having Share there all the time no matter what? That's really the only way the user is in control of their experience, instead of Mozilla or the website or native app.

mcomella commented 6 years ago

Hm, I initially filed this with Reddit as the example, and it morphed to talk about "custom tab".

Custom Tabs are an Android feature where an application (e.g. reddit) can choose to open an external link in a "Custom Tab": this is a set of minor customizations over an installed browser (e.g. Focus, Chrome) including whether or not the "Share" menu option is shown.

The Reddit app chooses to open external links in custom tabs and so our custom tab implementation activates with your reddit app STR, which is where we discovered the issue with our custom tabs implementation that we're discussing in this bug.

But as I said in the first few comments, it's elsewhere too. Eg:

https://mozillagfx.wordpress.com/2017/11/06/webrender-newsletter-9/

But to identify if there's an additional issue you're encountering, @autonome do you have specific steps to reproduce this? If I:

The "Share" option is shown for me and I cannot reproduce the issue.

autonome commented 6 years ago

Thanks for explaining how custom tabs work! Very helpful, I appreciate it.

For the GFX blog, I'm pretty sure I opened it from the Reddit app, which means is the same problem.

I now understand this comment from @pocmo better:

"I do not think it would be worth fighting the custom tabs protocol here."

If anyone should be designing for user choice > app > OS, it's us.

If anyone should be pushing on the edges of what is possible in advocating for user control in proprietary ecosystems, it's us.

What is the penalty for perma-showing a Share option? App store banishment?

mcomella commented 6 years ago

What is the penalty for perma-showing a Share option? App store banishment?

I like the way you think. :) tbh, nothing major – worst case, we would be going against best practices in the ecosystem so users or app makers would dislike opening custom tabs in Firefox.

I think the use case for hiding share is internal app links (e.g. yelp could use webView to display some part of their app but it's an internal-only URL) which could be confusing to users if they won't work in the browser or when shared. Thus, I'm not sure how I'd feel about enabling Share all the time but Barbara mentioned we should default this to true if the app doesn't specify a value (which I think is the case for reddit).

autonome commented 6 years ago

Non-HTTP/S links are pretty easy to detect. Can just toggle visibility based on that?

autonome commented 6 years ago

Oh, right. You can make intent filters for HTTP/S URLs and handle them natively.

I'd still rather err on the side of: "User is always the decider of whether to share. Occasionally a non-critical share action will be confusing."

We shouldn't be prematurely optimizing for the sharing-while-Focus-is-default-and-custom-tab-also-with-internal-url scenario at the expense of user control.

pocmo commented 6 years ago

Note that "not showing the default(!) share item" does not mean there won't be a share item. There are a bunch of apps that show their own share item in the menu - because sharing in the app's context means more or something else. In the worst case we'd end up with two share items.

In general I agree that we should make it easier to switch to the full browser where the user has all options.

Looking at the code of the Custom Tabs library there is actually no way the app developer can specifiy "Do not show the share option". Instead they call addDefaultShareMenuItem() if they want to add the default one: https://developer.android.com/reference/android/support/customtabs/CustomTabsIntent.Builder.html#addDefaultShareMenuItem() This means defaulting to true might be problematic: There's no way to explicitly define "false".

autonome commented 6 years ago

In general I agree that we should make it easier to switch to the full browser where the user has all options.

Do you mean an additional step from the custom tab (eg, "Open with..."), or do you mean opening the view in the full browser in the first place?

I filed this because I got tired of doing "Open with" all the time, which is a pretty bad user experience compared to just being able to share directly from the default view.

pocmo commented 6 years ago

Do you mean an additional step from the custom tab (eg, "Open with..."), or do you mean opening the view in the full browser in the first place?

Actually some time ago I hacked a prototype app that would act as a receiver for Custom Tabs and then just open a regular tab in your browser of choice: https://github.com/pocmo/Just-Open-My-Browser

I filed this because I got tired of doing "Open with" all the time, which is a pretty bad user experience compared to just being able to share directly from the default view.

Is it primarily "Share" that you are missing in a Custom Tab or are there other reasons why you were using "Open with" all the time?

autonome commented 6 years ago

Is it primarily "Share" that you are missing in a Custom Tab or are there other reasons why you were using "Open with" all the time?

Just share.

I've not yet encountered a scenario as a non-developer user where I needed "Open with". As a developer user, I've used "Open with" to test different browsers.

bbinto commented 6 years ago

This means defaulting to true might be problematic: There's no way to explicitly define "false".

Sorry, not sure if I'm following your comment.

Also, @pocmo -- can we try setting it to true and see what happens with the reddit app?

As for https://github.com/pocmo/Just-Open-My-Browser, wouldn't that also solve some of the other custom tabs fall out issues like #1282

cc @brampitoyo

pocmo commented 6 years ago

Sorry, not sure if I'm following your comment.

Using the Custom Tabs library third-party developers can only call addDefaultShareMenuItem(). Without that no share button is shown. If we default to "true" then the share button is always shown and third-party developers cannot explicitly hide it - because there isn't something like removeDefaultShareMenuItem().

As for https://github.com/pocmo/Just-Open-My-Browser, wouldn't that also solve some of the other custom tabs fall out issues like #1282

You mean if we would open a normal tab instead of a custom tab?

bbinto commented 6 years ago

If we default to "true" then the share button is always shown and third-party developers cannot explicitly hide it

I guess we won't be a good Android citizen if we still set it to true?

You mean if we would open a normal tab instead of a custom tab?

Yes, I wonder.....if by supporting custom tabs we are shooting ourselves in the foot? If we don't offer custom tabs. I might need to get a refresher (sorry) on what the disadvantages for us would be if we removed the custom tabs support.

brampitoyo commented 6 years ago

On #1626, I proposed adding a menu item called “Open in Firefox Focus” and “Open in…” that will allow you to open the link in another browser or app.

Will this help solve the problem?

I know that we already have a “Share” icon on the toolbar, but I feel like some apps can elect not to show it. When this is the case, our “Open in…” menu items – which we control – will help make sure that our users can always perform a share action.

(I’m aware that it’s not a perfect solution, because “Open in…” is a metaphor that works with another browser, but doesn’t work with an app that you want to share the link in, such as WhatsApp or LINE.)

autonome commented 6 years ago

Hey Bram! Maybe I'm not understanding your suggestion - don't we already have "Open with..."?

Challenges of "Open with/in":

The difference in workflow, assuming our current "Open with" implementation, is illustrated below. Five discrete steps vs nine discrete steps. (Will be reduced to eight if selecting a quickshare option.)

Reddit -> click link -> custom tab (Focus) opens and loads URL -> share -> Pocket

Reddit -> click link -> custom tab (Focus) opens and loads URL -> Open with -> (open-with popup) Firefox -> Firefox opens and loads URL -> share -> Pocket

brampitoyo commented 6 years ago

Hi Dietrich, yes. I think I’m misunderstanding your suggestion.

You suggestion seems to concern the “Share” icon on the toolbar, which we already have?

The problem is, I’m not sure if it’s something that we enforce and can display in all cases, or something we hide when the app asks us to do it. For example, Twitter may say “OK, you can show a Share icon in the custom tabs”, but Facebook may say “No, you can’t show that icon there”.

If this icon is always displayed (I think this is Chrome’s custom tabs behaviour, too – makes sense to follow that in this case), that will solve this problem, right?

autonome commented 6 years ago

Yes, all prior discussion in this issue is about exactly this problem: The share button is sometimes missing, because Focus is acting as a custom tab, and the opener app has asked that the share button be hidden.

That behavior is both inconvenient and disempowering for users.

Sharing the icon all the time is what I recommended as the solution.

I believe we should do that regardless of whether Chrome does it or not, and also regardless of whether it's considered being a good Android citizen or not.

Because we fight for the users. ⚡️⚡️⚡️

brampitoyo commented 6 years ago

Over on #1626, we’re having a bit of an issue. Third-party apps can request to show their own button on the custom tabs toolbar alongside ours.

Because share is a common action, there might be a chance that they will want to display a share button, even when we show our own share.

As a result, we might then have duplicate share buttons. One share coming as a request from the app, and the other share shows up by default on Focus custom tabs. Maybe there’s a way around this?

mcomella commented 6 years ago

Over on #1626, we’re having a bit of an issue.

Discussion around this issue specifically begins at https://github.com/mozilla-mobile/focus-android/issues/1626#issuecomment-345984780.

mcomella commented 6 years ago

Merged: https://github.com/mozilla-mobile/focus-android/commit/b80672f06491513eae083e5c9c0c4ba3b68d2cb4

Will default to showing "Share" all the time. Thanks for the feedback, autonome! :)

autonome commented 6 years ago

😍😍😍 Thanks everyone!!!

On Sat, Dec 2, 2017, 09:44 Michael Comella notifications@github.com wrote:

Merged: b80672f https://github.com/mozilla-mobile/focus-android/commit/b80672f06491513eae083e5c9c0c4ba3b68d2cb4

Will default to showing "Share" all the time. Thanks for the feedback, autonome! :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mozilla-mobile/focus-android/issues/1358#issuecomment-348652052, or mute the thread https://github.com/notifications/unsubscribe-auth/AADDt-I1SYAks25Xmum0F8KDc6OtSwqlks5s8J1dgaJpZM4PgW2k .