Add "Open in App window" menu item for installed PWA |
||||||||
Issue descriptionChrome Version: 67 OS: Chrome What steps will reproduce the problem? (1) Install a PWA. (2) Navigate to the PWA in a browser tab. (3) Open Chrome menu What is the expected result? The "Install to shelf" item is replaced with "Open in App window" (language t.b.d.). This should pop out the tab into its own window without navigating (opposite of "Open in Chrome" from the app window). What happens instead? Install to Shelf is still present. Work log: https://docs.google.com/spreadsheets/d/1EY3rJRmS-2yRa2HReGJcwcfQISKf_KJ33FCcEa25HkA/edit?usp=sharing
,
Mar 9 2018
I recommend we use the text used in Android, "Open {App name}".
,
Mar 9 2018
Does that just open the app or does it launch it at the tab's location?
,
Mar 9 2018
Sorry, I mistook Android for ARC++. It opens at the tab's location.
,
Mar 9 2018
We already have similar text on the right-click context menu: "Open link in <appname>". The problem is I find it a bit confusing, because you're clicking on a link to a website, and there's a separate option to "Open link in <website name>"... it's like, what's the difference between left-clicking an Inbox link, and opening link in Inbox? I think it's even more confusing if I'm already in Inbox, and there's an option to "Open Inbox".
,
Mar 9 2018
Maybe it's okay to diverge from Android here as the concept of windows as strong as it is on desktop.
,
Mar 9 2018
*isn't as strong as it is on desktop.
,
Mar 12 2018
+srahim - could you provide guidance on the menu UI string in the place of "Add to shelf..." in the 3-dot menu when the app is already added to self? re: c5-c7 I'm concerned of introducing a new concept "App window" by calling it so. Since app windows are apps, "Open <Appname>" seems natural, imo.
,
Mar 13 2018
WIP screencast.
,
Mar 13 2018
Nice! What's our plan for PWAs that loaded mixed content? We don't allow mixed content in PWA windows. I think we should just disable the option if the page has any mixed content in it. Another option would be to start a new navigation in the app window when the the site has mixed content in it, but I think it'll just confuse users and might cause data loss.
,
Mar 14 2018
Nice work Alan! I found a more compelling precedent: if you right-click a link from within an app to its own scope, there is an option "Open link in new <APPNAME> window." That seems sufficiently similar to this case to convince me that we can say "Open in <APPNAME> window" on the Chrome menu.
,
Mar 14 2018
Those were added by me in Issue 760457 . See that bug for other string changes. I never got feedback from UI so happy to revisit them if we think there is a better alternative!
,
Mar 14 2018
Concern: What happens when PWA names are very long? Answer: The menu tooling auto elides when menu item names are too long.
,
Mar 14 2018
FWIW so does the right click menu.
,
Mar 14 2018
- Is there a short_name we can use in menus? - Is there a max length in short_name?
,
Mar 14 2018
> - Is there a short_name we can use in menus? Yes. We are using it. > - Is there a max length in short_name? No.
,
Mar 14 2018
Should the "Open in app window" menu item have the app icon next to it?
,
Mar 14 2018
c13-17 re: max length on the browser-side display and eliding (assuming adding a max length at the spec level is not desired) Could we set the eliding length to be at about 30th letter to make the room ample but not too wide? re: app icon I think only the context menu has the app icon. Not the 3-dot menu item.
,
Mar 14 2018
I don't *think* we want a max length at the spec level. If we did, we would want to elide strings that are longer than the max, rather than ignoring them and showing an error. So there's no point speccing this, we can just do it in Chrome. I am happy to move eliding logic for short_name up higher, perhaps even to Manifest, so short_name is always elided to a fixed length. But for now, let's just put the elide logic in here (the menu code). Elide the name, not the entire menu string, so it reads "Open in A very very long app name... window."
,
Mar 14 2018
Added eliding to 30 characters.
,
Mar 15 2018
FYI: Turns out extension->short_name() doesn't get the short_name from the webmanifest as we don't appear to store that value when we install a PWA.
,
Mar 15 2018
#21: We should probably fix that, possibly in BookmarkAppHelper::UpdateWebAppInfoFromManifest.
,
Mar 15 2018
Wow, good find... that's sad. BookmarkAppHelper::UpdateWebAppInfoFromManifest copies the content::Manifest into a WebApplicationInfo. ConvertWebAppToExtension in convert_web_app.cc copies WebApplicationInfo into an extension manifest. WebApplicationInfo has no short_name field, which both of the other manifests do. So you'll need to: - Add a short_name field to WebApplicationInfo. - UpdateWebAppInfoFromManifest should set the short_name field of WebApplicationInfo. - ConvertWebAppToExtension should set the kShortName key.
,
Mar 15 2018
Filed issue 822162 for the short_name being dropped.
,
Mar 16 2018
,
Mar 19 2018
Updated screencast with new name.
,
Mar 26 2018
,
Mar 26 2018
,
Mar 27 2018
Bumping to Pri-1 because it involves adding a string. (Must be landed by Friday March 30).
,
Mar 27 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/09965805e0127744db69a6b63a9a1fc92f7875e3 commit 09965805e0127744db69a6b63a9a1fc92f7875e3 Author: Alan Cutter <alancutter@chromium.org> Date: Tue Mar 27 07:25:29 2018 Show "Open in app window" for tab if corresponding PWA is already installed This CL changes the "Install to shelf" app menu item to "Open in <app>" for secure pages that are within a PWA's scope. Screencast: https://bugs.chromium.org/p/chromium/issues/attachment?aid=329979&signed_aid=nYQJIKfjlAWeVah-WIOxWg==&inline=1 Bug: 819457 Change-Id: Iafa04c7850099eb0a83a2b230a2dd273ff71b11f Reviewed-on: https://chromium-review.googlesource.com/959983 Commit-Queue: Alan Cutter <alancutter@chromium.org> Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: Giovanni Ortuño Urquidi <ortuno@chromium.org> Reviewed-by: Alexei Svitkine <asvitkine@chromium.org> Reviewed-by: Matt Giuca <mgiuca@chromium.org> Cr-Commit-Position: refs/heads/master@{#546049} [modify] https://crrev.com/09965805e0127744db69a6b63a9a1fc92f7875e3/chrome/app/chrome_command_ids.h [modify] https://crrev.com/09965805e0127744db69a6b63a9a1fc92f7875e3/chrome/app/generated_resources.grd [modify] https://crrev.com/09965805e0127744db69a6b63a9a1fc92f7875e3/chrome/browser/extensions/extension_util.cc [modify] https://crrev.com/09965805e0127744db69a6b63a9a1fc92f7875e3/chrome/browser/extensions/extension_util.h [modify] https://crrev.com/09965805e0127744db69a6b63a9a1fc92f7875e3/chrome/browser/ui/browser_command_controller.cc [modify] https://crrev.com/09965805e0127744db69a6b63a9a1fc92f7875e3/chrome/browser/ui/extensions/application_launch.cc [modify] https://crrev.com/09965805e0127744db69a6b63a9a1fc92f7875e3/chrome/browser/ui/extensions/application_launch.h [modify] https://crrev.com/09965805e0127744db69a6b63a9a1fc92f7875e3/chrome/browser/ui/extensions/hosted_app_browsertest.cc [modify] https://crrev.com/09965805e0127744db69a6b63a9a1fc92f7875e3/chrome/browser/ui/toolbar/app_menu_model.cc [modify] https://crrev.com/09965805e0127744db69a6b63a9a1fc92f7875e3/tools/metrics/actions/actions.xml
,
Mar 27 2018
,
May 10 2018
Verified on M68 (10663.0.0, 68.0.3425.0). |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by alancutter@chromium.org
, Mar 7 2018