You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Plugin API (desktop): know which window shows a workspace, and open it there
#10422
On desktop I keep three windows: one for the lead agent, one for its workers, one for everything else. When I pick a workspace or tab from a plugin (a picker screen, a sidebar view, a Command Center item), I want Paseo to bring forward the window that already shows it.
How I do it today
By hand. A pick opens in the window I'm in, so the same workspace ends up in two windows and I close one.
Plugins that work with windows reach around the SDK. paseo-window-restore 0.4.0 calls window.paseoDesktop.window.openNew(), gives each window an id in sessionStorage, talks between windows over a BroadcastChannel, and patches Storage.prototype.setItem to learn what each window shows.
Where Paseo gets in the way
@getpaseo/plugin has nothing about windows: no id for the window a surface renders in, no list of windows, nothing about what another window shows.
/** Desktop only. Undefined on web and mobile. */declarefunctionuseDesktopWindows(): readonlyPluginDesktopWindow[]|undefined;interfacePluginDesktopWindow{/** Stable while the window is open. */id: string;/** The window this surface renders in. */current: boolean;focused: boolean;/** The workspace it shows, or null on any other route. */workspace: WorkspaceRef|null;}// An option on openWorkspace, openAgent and openTab:{window?: "current"|"showing"}// "showing": focus a window that already shows the target, else open here
The read side is the record #6875 needs. The option reuses it.
Not asking for: window bounds, window names, or restoring a session's windows.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
What I'm trying to do
On desktop I keep three windows: one for the lead agent, one for its workers, one for everything else. When I pick a workspace or tab from a plugin (a picker screen, a sidebar view, a Command Center item), I want Paseo to bring forward the window that already shows it.
How I do it today
By hand. A pick opens in the window I'm in, so the same workspace ends up in two windows and I close one.
Plugins that work with windows reach around the SDK. paseo-window-restore 0.4.0 calls
window.paseoDesktop.window.openNew(), gives each window an id insessionStorage, talks between windows over aBroadcastChannel, and patchesStorage.prototype.setItemto learn what each window shows.Where Paseo gets in the way
@getpaseo/pluginhas nothing about windows: no id for the window a surface renders in, no list of windows, nothing about what another window shows.What a better workflow would look like
The read side is the record #6875 needs. The option reuses it.
Not asking for: window bounds, window names, or restoring a session's windows.
Related
All reactions