Add support for services
We should implement
- reading the list of installed services from the config file,
- stores to hold transient service state,
- UI for switching services,
- controllers for displaying services in a
BrowserView
and swapping out theBrowserView
attached to theBrowserWindow
according to which service is currently selected.
The are two possible groupings for services that we should consider at this state:
-
Partitions are a concept from Electron to separate the session data and persistent cached, cookies,
localStorage
, etc., of differentWebContents
. By assigning multiple services to the same partition, they could share some cookies. This is useful for single-sign-on, e.g., to sign in to Gmail in a service and the use the same Google login cookies to SSO into a Slack instance. The naming however is a bit confusing and technical, we should probably call these profiles or identities instead. - Workspaces are groups of services displayed at the same time, which is a common concept in "messaging browsers". Services from the selected workspace are shown, while those from inactive workspaces are hidden or even unloaded entirely. A question is whether a service could be part of multiple workspaces, and whether services should be able to live outside a workspace.
We can explore other grouping options, e.g., secondary 'tab bars' of services when some primary service (or workspace?) is selected on the tab bar.
The design decision whether paritions and services should have a 1-to-1 or 1-to-n (n-to-n doesn't make sense here, a service must be loaded withing a single Session
, and thus a single partition) seems to have rather far-reaching consequences (some Electron APIs affect a whole Session
, while others are specific to the WebContents
), so we should make it early.
Other service groupings have much more modest consequences, so at first, we can design for a single workspace (all services visible at all times) and then build up from there later.