22const { isConnected, isConnecting, npmUser, error, activeOperations, hasPendingOperations } = useConnector ()
33
44const showModal = ref (false )
5+ const showTooltip = ref (false )
56
67const statusText = computed (() => {
78 if (isConnecting .value ) return ' connecting…'
8- if (isConnected .value && npmUser .value ) return ` @${npmUser .value } `
9+ if (isConnected .value && npmUser .value ) return ` connected as @${npmUser .value }`
910 if (isConnected .value ) return ' connected'
10- return ' disconnected '
11+ return ' connect local CLI '
1112})
1213
1314const statusColor = computed (() => {
@@ -31,28 +32,47 @@ const ariaLabel = computed(() => {
3132 <div class =" relative" >
3233 <button
3334 type =" button"
34- class =" flex items-center gap-2 px-3 py-1.5 font-mono text-xs text-fg-muted hover:text-fg bg-bg-subtle border border-border rounded-md transition-colors duration-200 hover:border-border-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50"
35+ class =" relative flex items-center justify-center w-8 h-8 rounded-md transition-colors duration-200 hover:bg-bg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50"
3536 :aria-label =" ariaLabel"
3637 @click =" showModal = true"
38+ @mouseenter =" showTooltip = true"
39+ @mouseleave =" showTooltip = false"
40+ @focus =" showTooltip = true"
41+ @blur =" showTooltip = false"
3742 >
43+ <!-- Status dot -->
3844 <span
39- class =" w-2 h-2 rounded-full transition-colors duration-200"
45+ class =" w-2.5 h-2.5 rounded-full transition-colors duration-200"
4046 :class =" statusColor"
4147 aria-hidden =" true"
4248 />
43- <span class =" hidden sm:inline" >{{ statusText }}</span >
44- <span class =" sm:hidden" >{{ isConnected ? 'on' : 'off' }}</span >
45- <!-- Operation count badge (only active operations) -->
49+ <!-- Operation count badge (overlaid) -->
4650 <span
4751 v-if =" isConnected && operationCount > 0"
48- class =" min-w-[1.25rem ] h-5 px-1 flex items-center justify-center font-mono text-xs rounded-full"
52+ class =" absolute -top-0.5 -right-0.5 min-w-[1rem ] h-4 px-1 flex items-center justify-center font-mono text-[10px] rounded-full"
4953 :class =" hasPendingOperations ? 'bg-yellow-500 text-black' : 'bg-blue-500 text-white'"
5054 aria-hidden =" true"
5155 >
5256 {{ operationCount }}
5357 </span >
5458 </button >
5559
60+ <!-- Tooltip -->
61+ <Transition
62+ enter-active-class =" transition-opacity duration-150"
63+ leave-active-class =" transition-opacity duration-100"
64+ enter-from-class =" opacity-0"
65+ leave-to-class =" opacity-0"
66+ >
67+ <div
68+ v-if =" showTooltip"
69+ role =" tooltip"
70+ class =" absolute right-0 top-full mt-2 px-2 py-1 font-mono text-xs text-fg bg-bg-elevated border border-border rounded shadow-lg whitespace-nowrap z-50"
71+ >
72+ {{ statusText }}
73+ </div >
74+ </Transition >
75+
5676 <ConnectorModal
5777 v-model:open =" showModal"
5878 />
0 commit comments