System Tray Icon and Run Minimized Support for Progressive Web Apps
Breakout session - TPAC 2024 - September 25 2024
Participants
- Natasha Gaitonde (Microsoft Edge)
- Amanda Baker (Microsoft Edge)
- Howard Wolosky (Microsoft Edge)
- Marijn Kruisselbrink (Google Chrome)
- Ayu Ishii (Google Chrome)
- Etienne Noël (Google Chrome)
- Dibyajyoti Pal (Google Chrome)
- Theresa O’Connor (Apple)
Chair
- Diego Gonzalez (Microsoft Edge)
- Lu Huang (Microsoft Edge)
Scribes
- Amanda Baker (Microsoft Edge)
Minutes
- Case study - chat/video calling apps
- windows are opened/closed frequently. Need to be launched quickly with restored state
- apps benefit from syncing when the window is not visible to the user
- long running web apps would benefit from not being suspended when hidden/minimized
- and benefit from a polling model rather than push
- badging on the tray icon, systray icon etc
- Diego: OS support - what's available?
- System tray: some apps can have icon in bottom corner of screen that serves as an entry point to app and includes menus + deeplinking
- Systray linux: some apps already use this type of menu, although some distros disable this
- Systray mac: mac has a menu bar and an equivalent function called "menu bar extras"
- Marijn: Mac also has a dock tray icon that is similar
- it's common to have an icon on the doc when windows are closed
- Proposed design for web apps:
- Add to manifest file: run_minimized: true/false
- Reuse list of manifest icons for systray icon
- Reuse manifest shortcuts for context neu options
- No need to create a new structure
- : if the platform convention is to surface different actions/granularity of actions then reuse gives gives the min experience, without creating something that is too windows-focused
- Lu: the two menus (shortcuts vs systray) are not tied
- Diego: start with shortcuts, then we can expand later if needed
- ?: what would run minimized mean on mac?
- Lu: in chrome on mac its just a mac wrapper.
- Marijn: We close the app shim when the last window closes
- Tess: IN terms of run minimized, would you get a system tray on mac? Would you show a potentially empty menu bar?
- Marijn: this is to opt to having the thing, but you also need to sign up for periodic/background sync to do the work
- Lu: this doesn’t opt you into any other spec apis
- Lu: shortcuts should always be there if they’re already there
- Tess: if I set `run_minimized` and the page is minimized, then what does is hidden say?
- Tess: I don’t know what the name run_minimized say?
- Howard: talking about reusing shortcuts, but systray scenarios don’t always result in the window reappearing. We may want an additional attribute to indicate if we want a foreground navigation to happen
- Marijn: https://github.com/WICG/web-app-launch/blob/main/sw_launch_event.md can transform navigation into other actions
- Howard: can you add that to a manifest?
- Tess: if the common case is navigation, a bool/enum hanging off of each shortcut would make sense.
- Howard: looking at chat apps minimized in the systray, they have status menu options. That doesn’t result in a navigation.
- Tess: does shortcuts allow you to define a hierarchy?
- Diego: no
- Hidden document would allow web apis to run without relying on a service worker
- Tess: in extension space, folks are trying to move away from hidden documents
- Long running periodic service worker mode: allow the SW to handle periodic updates.
- Lu: periodic sync doesn’t work if the browser is not running
- Marijn: that’s an implementation detail
- Tess: safari doesn’t have to be running for background sync
- Tess: Gmail is in a tab, does it have to be a PWA?
- Marijn: we’ve discussed not tying badging to pwa
- Natasha: Is the question around gating behind a manifest?
- Tess: different browsers handle installabilty differently. How do we handle clearing confusing for users when thers is different behavior between a standalone app and a tab?
- Diego: presence in systray is a place to surface badges on ios
- Tess: but if you have a SW with notifications and badging api, then I don’t need an additional opt in
- Marijn: currently you need to show some ui when receiving a push notification (need to show notification or window)
- Let push start the browser
- Background pages like extensions (not recommended)
- Specify manifest field
- No spec change to reuse shortcuts, icons, or badging api
- Require that minimized apps are kept active by UA?
- Requre UA to implement prompts to keep user aware of running the app?
- Require options to reopen/quit app?
- Lu: Looking for opinions on the reopen option.
- It’s strange if you try to open the app but it takes many seconds to open.
- Is hidden a good idea to address this issue?
- It may be difficult to recreate state pre-minimize without a hidden doc.
- Need to address the issue of no processes running when browser process is closed.
- Marijn: forcing the user to keep a bg window alive is an additional weight on the user
- Tess: especially without consent
- Marjin: it’s like a bf cache thing
- Tess: imagine a multi window experience. THeres a main screen with a collection of items and you close the collection screen when you look at a specific item. Is it weird that you would get the specific item you last looked at vs the collection page (the main app page)?
- Marijn: It feels like bf cache since you’re navigating to what was last there
- Tess: e.g. you inbox; you typed text into a draft composition window. Would you expect both windows to open?
- Lu: How would you close both windows? One at a time.
- Lu: another point about the weight of a hidden doc. The user knows if they close all their app windows that everything is gone. I’m pushing back against the idea that it’s going to be a weight to keep a hidden doc, because for the apps that a user needs this, the uswer would normally keep the window open so they didn’t lose state.
- Tess: plenty of pages misbehave with bf cache. Are we any worse off than that?
- Marijn: Some ways of installing apps via hidden document. Lots of apis to make sure that devs don’t try to use those windows. Having hidden bg windows seems problematic + bug prone.
- Lu: Summary on architecture slide: we don’t have the full solution to solve the problem, but it can’t be solved without some spec work. This is the start to the feature, so it’s okay if we don’t have answers now.
- Tess: run_minimized doesn’t convey its meaning very clearly, but I don’t have great suggestions atm
- Tess: might be a deficiency of shortcuts, but it sounds like there are two types of context menu items. SHortcuts are static, but you could imagine dynamic shortcuts, e.g. “most recent 3 channels”.
- Tess: do we need a shortcuts api for service workers to support dynamic shortcuts?
- Lu: Idea: url string can go to SW which can fill in the rest of the info
- Marijn: but you still need to fill in the text for the shortcut
- ?: is shortcut tied to a url?
- Marijn: yes
- Natasha; we should look into launch
- Diego: Aaron gustafson has an old explainer for dynamic shortcuts
- Diego: is there a way that developers could get on the systray and what would be the default behavior on mac? E.g. on windows it generates a hamburger menu that would expand into the application. How can we adapt the behavior per-platform?
- Ayu: it would be nice to be able to replace native apps that show up on the app menu