From a98add29d1b5d5f834a69b0e25156d0f301a6ec8 Mon Sep 17 00:00:00 2001 From: David Hill Date: Sat, 24 Jan 2026 19:41:40 +0000 Subject: [PATCH] feat(app): add truncation tooltip to server items in status popover --- .../app/src/components/status-popover.tsx | 107 ++++++++++++------ 1 file changed, 71 insertions(+), 36 deletions(-) diff --git a/packages/app/src/components/status-popover.tsx b/packages/app/src/components/status-popover.tsx index aae245c6d..dd4f7d12a 100644 --- a/packages/app/src/components/status-popover.tsx +++ b/packages/app/src/components/status-popover.tsx @@ -1,4 +1,4 @@ -import { createEffect, createMemo, createSignal, For, onCleanup, Show } from "solid-js" +import { createEffect, createMemo, createSignal, For, onCleanup, onMount, Show } from "solid-js" import { createStore, reconcile } from "solid-js/store" import { useNavigate } from "@solidjs/router" import { useDialog } from "@opencode-ai/ui/context/dialog" @@ -7,6 +7,7 @@ import { Tabs } from "@opencode-ai/ui/tabs" import { Button } from "@opencode-ai/ui/button" import { Switch } from "@opencode-ai/ui/switch" import { Icon } from "@opencode-ai/ui/icon" +import { Tooltip } from "@opencode-ai/ui/tooltip" import { useSync } from "@/context/sync" import { useSDK } from "@/context/sdk" import { normalizeServerUrl, serverDisplayName, useServer } from "@/context/server" @@ -210,44 +211,78 @@ export function StatusPopover() { const isDefault = () => url === defaultServerUrl() const status = () => store.status[url] const isBlocked = () => status()?.healthy === false + const [truncated, setTruncated] = createSignal(false) + let nameRef: HTMLSpanElement | undefined + let versionRef: HTMLSpanElement | undefined + + onMount(() => { + const check = () => { + const nameTruncated = nameRef ? nameRef.scrollWidth > nameRef.clientWidth : false + const versionTruncated = versionRef ? versionRef.scrollWidth > versionRef.clientWidth : false + setTruncated(nameTruncated || versionTruncated) + } + check() + window.addEventListener("resize", check) + onCleanup(() => window.removeEventListener("resize", check)) + }) + + const tooltipValue = () => { + const name = serverDisplayName(url) + const version = status()?.version + return ( + + {name} + + {version} + + + ) + } + return ( - + + + {status()?.version} + + + + + Default + + +
+ + + + + ) }} @@ -276,7 +311,7 @@ export function StatusPopover() { return (