@@ -84,7 +84,9 @@ const WithAtlasProviders: React.FC = ({ children }) => {
8484
8585type CompassWorkspaceProps = Pick <
8686 React . ComponentProps < typeof WorkspacesPlugin > ,
87- 'initialWorkspaceTabs' | 'onActiveWorkspaceTabChange'
87+ | 'initialWorkspaceTabs'
88+ | 'onActiveWorkspaceTabChange'
89+ | 'savedWorkspacesPromise'
8890> &
8991 Pick <
9092 React . ComponentProps < typeof CompassSidebarPlugin > ,
@@ -140,6 +142,13 @@ type CompassWebProps = {
140142 */
141143 initialPreferences ?: Partial < AllPreferences > ;
142144
145+ /**
146+ * Optional promise that resolves with saved workspaces state from a
147+ * previous session. If provided, compass-web will restore tabs from that
148+ * state on first render.
149+ */
150+ savedWorkspacesPromise ?: Promise < OpenWorkspaceOptions [ ] | null > ;
151+
143152 /**
144153 * Callback prop called every time any code inside Compass logs something
145154 */
@@ -173,6 +182,7 @@ function CompassWorkspace({
173182 initialWorkspaceTabs,
174183 onActiveWorkspaceTabChange,
175184 onOpenConnectViaModal,
185+ savedWorkspacesPromise,
176186} : CompassWorkspaceProps ) {
177187 return (
178188 < WorkspacesProvider
@@ -203,10 +213,8 @@ function CompassWorkspace({
203213 data-testid = "compass-web-connected"
204214 className = { connectedContainerStyles }
205215 >
206- { /* TODO: only show this after user confirms the confirmation screen*/ }
207216 < WorkspacesPlugin
208- //TODO:
209- // savedWorkspacesPromise={savedTabs}
217+ savedWorkspacesPromise = { savedWorkspacesPromise }
210218 initialWorkspaceTabs = { initialWorkspaceTabs }
211219 openOnEmptyWorkspace = { { type : 'Welcome' } }
212220 onActiveWorkspaceTabChange = { onActiveWorkspaceTabChange }
@@ -269,6 +277,7 @@ const CompassWeb = ({
269277 darkMode,
270278 initialAutoconnectId,
271279 initialWorkspace,
280+ savedWorkspacesPromise,
272281 onActiveWorkspaceTabChange,
273282 initialPreferences,
274283 onLog,
@@ -425,6 +434,9 @@ const CompassWeb = ({
425434 initialWorkspaceTabs = {
426435 initialWorkspaceTabsRef . current
427436 }
437+ savedWorkspacesPromise = {
438+ savedWorkspacesPromise
439+ }
428440 onActiveWorkspaceTabChange = {
429441 onActiveWorkspaceTabChange
430442 }
0 commit comments