diff --git a/frontend/src/components/panels/DetailPanel.tsx b/frontend/src/components/panels/DetailPanel.tsx index 47b0f1d..b35da39 100644 --- a/frontend/src/components/panels/DetailPanel.tsx +++ b/frontend/src/components/panels/DetailPanel.tsx @@ -659,25 +659,78 @@ const CATEGORY_COLORS: Record = { } function ServiceBadge({ svc, host, onEdit, onRemove }: { svc: ServiceInfo; host?: string; onEdit: () => void; onRemove: () => void }) { - const url = getServiceUrl(svc, host) - const color = CATEGORY_COLORS[svc.category ?? ''] ?? '#8b949e' - const portLabel = svc.port != null ? String(svc.port) : 'host' - const pathLabel = svc.path?.trim() ? svc.path.trim() : null - const inner = ( -
-
- - {svc.service_name} - {pathLabel && {pathLabel}} -
-
- {portLabel}/{svc.protocol} - {url && } - - + const url = getServiceUrl(svc, host); + const color = CATEGORY_COLORS[svc.category ?? ''] ?? '#8b949e'; + const hasPort = svc.port != null; + const portLabel = hasPort ? String(svc.port) : ''; + const pathLabel = svc.path?.trim() ? svc.path.trim() : ''; + // Layout: service name takes all available space, path/port are always right-aligned next to buttons, path is hidden if name must truncate + return ( +
+ + + {svc.service_name} + +
+ {pathLabel && ( + + {pathLabel} + + )} + {hasPort && ( + {portLabel}/{svc.protocol} + )} +
+ {url && ( +
{inner} - return inner + ); } diff --git a/frontend/src/components/ui/tooltip.tsx b/frontend/src/components/ui/tooltip.tsx deleted file mode 100644 index 69e8a82..0000000 --- a/frontend/src/components/ui/tooltip.tsx +++ /dev/null @@ -1,66 +0,0 @@ -"use client" - -import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip" - -import { cn } from "@/lib/utils" - -function TooltipProvider({ - delay = 0, - ...props -}: TooltipPrimitive.Provider.Props) { - return ( - - ) -} - -function Tooltip({ ...props }: TooltipPrimitive.Root.Props) { - return -} - -function TooltipTrigger({ ...props }: TooltipPrimitive.Trigger.Props) { - return -} - -function TooltipContent({ - className, - side = "top", - sideOffset = 4, - align = "center", - alignOffset = 0, - children, - ...props -}: TooltipPrimitive.Popup.Props & - Pick< - TooltipPrimitive.Positioner.Props, - "align" | "alignOffset" | "side" | "sideOffset" - >) { - return ( - - - - {children} - - - - - ) -} - -export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }