From 901cf45d884286400be792f6e40d5e6dff251471 Mon Sep 17 00:00:00 2001 From: dvcolomban Date: Thu, 10 Sep 2026 00:16:19 +0200 Subject: [PATCH] fix(hub-ui): select a visible dock on standalone startup --- .../src/client/components/dock/DockStandalone.vue | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/hub-ui/src/client/components/dock/DockStandalone.vue b/packages/hub-ui/src/client/components/dock/DockStandalone.vue index c11e4d00..dc52e013 100644 --- a/packages/hub-ui/src/client/components/dock/DockStandalone.vue +++ b/packages/hub-ui/src/client/components/dock/DockStandalone.vue @@ -29,10 +29,16 @@ const isRpcTrusted = useIsRpcTrusted(context, (isTrusted) => { } }) +/** Select from the visible dock rail through normal activation, including client scripts and group routing. */ watch( - () => context.docks.entries, - () => { - context.docks.selectedId ||= context.docks.entries[0]?.id ?? null + [() => context.docks.groupedEntries, isRpcTrusted], + ([groups, trusted]) => { + if (!trusted || context.docks.selectedId) + return + const entry = groups.flatMap(([, entries]) => entries) + .find(entry => entry.type !== 'action' && entry.type !== '~builtin') + if (entry) + void context.docks.switchEntry(entry.id) }, { immediate: true }, )