@@ -83,22 +83,27 @@ export async function createDocksContext(
8383 // the live session state. Re-applied once the RPC becomes trusted so a reload
8484 // lands back on the same dock — see the restore effect near the end.
8585 const restoreIntent = {
86- open : sessionStore . value . open ,
87- selectedId : sessionStore . value . selectedId ,
88- route : sessionStore . value . route ,
86+ ...sessionStore . value ,
8987 }
9088
91- // `selectedId ` is backed by the session store so the current selection both
89+ // `selectedDockId ` is backed by the session store so the current selection both
9290 // drives the UI and persists across reloads through one source of truth.
93- const selectedId = computed < string | null > ( {
94- get : ( ) => sessionStore . value . selectedId ,
91+ const selectedDockId = computed < string | null > ( {
92+ get : ( ) => sessionStore . value . selectedDockId ,
9593 set : ( id ) => {
96- sessionStore . value . selectedId = id
94+ sessionStore . value . selectedDockId = id
9795 } ,
9896 } )
97+ const selectedDockRoute = computed < string | null > ( {
98+ get : ( ) => sessionStore . value . selectedDockRoute ,
99+ set : ( route ) => {
100+ sessionStore . value . selectedDockRoute = route
101+ } ,
102+ } )
103+
99104 const selected = computed (
100- ( ) => entries . value . find ( entry => entry . id === selectedId . value )
101- ?? BUILTIN_ENTRIES . find ( entry => entry . id === selectedId . value )
105+ ( ) => entries . value . find ( entry => entry . id === selectedDockId . value )
106+ ?? BUILTIN_ENTRIES . find ( entry => entry . id === selectedDockId . value )
102107 ?? null ,
103108 )
104109
@@ -142,8 +147,8 @@ export async function createDocksContext(
142147 // Clearing the selection when the active member vanishes matches the
143148 // hub reconcile behavior for a removed selected entry (shared-iframe
144149 // soft-nav §7.5).
145- if ( selectedId . value === entry . id )
146- selectedId . value = null
150+ if ( selectedDockId . value === entry . id )
151+ selectedDockId . value = null
147152 } ,
148153 }
149154 }
@@ -179,7 +184,7 @@ export async function createDocksContext(
179184 clientType,
180185 dockOpen : sessionStore . value . open ,
181186 paletteOpen : commandsContext ?. paletteOpen ?? false ,
182- dockSelectedId : selectedId . value ?? '' ,
187+ dockSelectedId : selectedDockId . value ?? '' ,
183188 popupOpen : isDockPopupOpen . value ,
184189 } )
185190
@@ -195,13 +200,13 @@ export async function createDocksContext(
195200
196201 const switchEntry = async ( id : string | null = null ) => {
197202 if ( id == null ) {
198- selectedId . value = null
203+ selectedDockId . value = null
199204 sessionStore . value . open = false
200- sessionStore . value . route = null
205+ sessionStore . value . selectedDockRoute = null
201206 return true
202207 }
203208 if ( id === '~client-auth-notice' ) {
204- selectedId . value = id
209+ selectedDockId . value = id
205210 sessionStore . value . open = true
206211 return true
207212 }
@@ -268,18 +273,18 @@ export async function createDocksContext(
268273 if ( entry . type === 'iframe' && entry . frameId && ! entry . subTabs )
269274 frameNavCurrentMember . set ( entry . frameId , entry . id )
270275
271- selectedId . value = entry . id
276+ selectedDockId . value = entry . id
272277 sessionStore . value . open = true
273278 // Only an iframe dock owns an address-bar route; ViewIframe keeps
274279 // `session.route` current for it. Clear it for anything else so a stale
275280 // route from a previous iframe isn't persisted against a non-iframe dock.
276281 if ( entry . type !== 'iframe' )
277- sessionStore . value . route = null
282+ sessionStore . value . selectedDockRoute = null
278283 return true
279284 }
280285
281286 const toggleEntry = async ( id : string ) => {
282- if ( selectedId . value === id )
287+ if ( selectedDockId . value === id )
283288 return switchEntry ( null )
284289 return switchEntry ( id )
285290 }
@@ -415,7 +420,7 @@ export async function createDocksContext(
415420 keybindings : [ { key : 'Escape' } ] ,
416421 action : ( ) => {
417422 sessionStore . value . open = false
418- selectedId . value = null
423+ selectedDockId . value = null
419424 } ,
420425 } ,
421426 {
@@ -533,9 +538,9 @@ export async function createDocksContext(
533538 // One-shot boot route (see `DocksPanelContext.consumeBootRoute`): the persisted
534539 // address-bar URL is handed back to exactly the iframe dock that was selected
535540 // before the reload, once.
536- let bootRoute : string | null = restoreIntent . selectedId != null ? restoreIntent . route : null
541+ let bootRoute : string | null = restoreIntent . selectedDockId != null ? restoreIntent . selectedDockRoute : null
537542 const consumeBootRoute = ( id : string ) : string | null => {
538- if ( bootRoute != null && id === restoreIntent . selectedId ) {
543+ if ( bootRoute != null && id === restoreIntent . selectedDockId ) {
539544 const route = bootRoute
540545 bootRoute = null
541546 return route
@@ -553,7 +558,8 @@ export async function createDocksContext(
553558 consumeBootRoute,
554559 } ,
555560 docks : {
556- selectedId,
561+ selectedId : selectedDockId ,
562+ selectedRoute : selectedDockRoute ,
557563 selected,
558564 entries,
559565 entryToStateMap : markRaw ( dockEntryStateMap ) ,
@@ -604,8 +610,8 @@ export async function createDocksContext(
604610 // open. `switchEntry` reads `session.route` back through `consumeBootRoute`
605611 // when the restored iframe boots.
606612 const applyRestore = ( ) : void => {
607- if ( restoreIntent . open && restoreIntent . selectedId != null )
608- void switchEntry ( restoreIntent . selectedId )
613+ if ( restoreIntent . open && restoreIntent . selectedDockId != null )
614+ void switchEntry ( restoreIntent . selectedDockId )
609615 }
610616 if ( rpc . isTrusted ) {
611617 applyRestore ( )
0 commit comments