@@ -7,7 +7,7 @@ import type { HubDocksUserSettings } from './dock-settings'
77import { attachFrameNavClient } from '@devframes/hub/client'
88import { DEFAULT_STATE_USER_SETTINGS , DOCK_RENDERERS_STATE_KEY } from '@devframes/hub/constants'
99import { computed , markRaw , reactive , ref , toRefs , watch , watchEffect } from 'vue'
10- import { BUILTIN_ENTRIES , HUB_UI_HIDE_EVENT } from '../constants'
10+ import { BUILTIN_ENTRIES , BUILTIN_ENTRY_SETTINGS , HUB_UI_HIDE_EVENT } from '../constants'
1111import { useBranding } from './branding'
1212import { createCommandsContext } from './commands'
1313import { docksGroupByCategories , getCategoryLabel , getGroupMembers , getGroupMembersGrouped , getRegisteredGroupIds , resolveCommandIcon , resolveGroupDefaultChild } from './dock-settings'
@@ -45,20 +45,32 @@ export async function createDocksContext(
4545 const clientDocks = reactive ( new Map < string , DevframeDockEntry > ( ) )
4646 const entries = computed < DevframeDockEntry [ ] > ( ( ) => {
4747 const server = dockEntries . value
48- if ( clientDocks . size === 0 )
49- return server
50- const seen = new Set < string > ( )
51- const merged : DevframeDockEntry [ ] = [ ]
52- for ( const entry of server ) {
53- seen . add ( entry . id )
54- // a client dock sharing a server id overrides it in the local merge
55- merged . push ( clientDocks . get ( entry . id ) ?? entry )
48+ let base : DevframeDockEntry [ ]
49+ if ( clientDocks . size === 0 ) {
50+ base = server
5651 }
57- for ( const [ id , entry ] of clientDocks ) {
58- if ( ! seen . has ( id ) )
59- merged . push ( entry )
52+ else {
53+ const seen = new Set < string > ( )
54+ const merged : DevframeDockEntry [ ] = [ ]
55+ for ( const entry of server ) {
56+ seen . add ( entry . id )
57+ // a client dock sharing a server id overrides it in the local merge
58+ merged . push ( clientDocks . get ( entry . id ) ?? entry )
59+ }
60+ for ( const [ id , entry ] of clientDocks ) {
61+ if ( ! seen . has ( id ) )
62+ merged . push ( entry )
63+ }
64+ base = merged
6065 }
61- return merged
66+ // Surface the viewer's own built-in Settings tab by default. hub-ui owns it
67+ // rather than depending on a host to register `~settings` server-side, so
68+ // Settings is always reachable (dock bar + `devframes:open-settings`). A host
69+ // that registered its own `~settings` entry wins — we only add ours when the
70+ // merged list has none.
71+ if ( base . some ( entry => entry . id === BUILTIN_ENTRY_SETTINGS . id ) )
72+ return base
73+ return [ ...base , BUILTIN_ENTRY_SETTINGS ]
6274 } )
6375
6476 const selectedId = ref < string | null > ( null )
0 commit comments