From 5f2b10fed873f479381148e5d01e491a750e503d Mon Sep 17 00:00:00 2001 From: LukeGus Date: Wed, 30 Sep 2026 14:03:56 -0500 Subject: [PATCH] feat: tighter compact host rows with inline tags (#1325) --- src/ui/sidebar/tree/HostItem/HostItem.tsx | 25 ++++++++++++++++--- .../sidebar/tree/HostItem/HostItem.test.tsx | 7 ++++++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/ui/sidebar/tree/HostItem/HostItem.tsx b/src/ui/sidebar/tree/HostItem/HostItem.tsx index 9d4db9d20..6aeee2385 100644 --- a/src/ui/sidebar/tree/HostItem/HostItem.tsx +++ b/src/ui/sidebar/tree/HostItem/HostItem.tsx @@ -389,8 +389,7 @@ export function HostItem({ const depthStyle = depth > 0 ? ({ paddingLeft: rem(depth * 12) } as const) : undefined; - const trayButtonClass = - "flex items-center justify-center size-[22.75px] text-muted-foreground/60 hover:text-foreground hover:bg-muted transition-colors"; + const trayButtonClass = `flex items-center justify-center ${isCompact ? "size-[19px]" : "size-[22.75px]"} text-muted-foreground/60 hover:text-foreground hover:bg-muted transition-colors`; const availableActions: TabType[] = pluginActions.flatMap((action) => action.tabType ? [action.tabType] : [], @@ -1167,6 +1166,22 @@ export function HostItem({ )} + {isCompact && + showTags && + host.tags?.slice(0, 2).map((tag) => ( + + {tag} + + ))} + {isCompact && showTags && (host.tags?.length ?? 0) > 2 && ( + + +{host.tags!.length - 2} + + )} {isCompact && ( 0 && ( + {showTags && !isCompact && host.tags && host.tags.length > 0 && (
@@ -1228,7 +1243,9 @@ export function HostItem({ (alwaysShowTray || actionsOnly || (shouldUseClickTray && isTrayOpen)) && ( -
+
{connectionButtons}
)} diff --git a/src/ui/tests/sidebar/tree/HostItem/HostItem.test.tsx b/src/ui/tests/sidebar/tree/HostItem/HostItem.test.tsx index 30a4c6b79..2bbf3762c 100644 --- a/src/ui/tests/sidebar/tree/HostItem/HostItem.test.tsx +++ b/src/ui/tests/sidebar/tree/HostItem/HostItem.test.tsx @@ -219,6 +219,13 @@ describe("HostItem density parity", () => { expect(screen.getByText("prod")).toBeTruthy(); }); + it("puts compact tags on the name row instead of their own line", () => { + renderHostItem("compact"); + const tag = screen.getByText("prod"); + expect(tag.dataset.testid).toBe("host-inline-tag"); + expect(tag.closest("[data-drag-label]")).toBeTruthy(); + }); + it("hides tags in both densities when showTags is false", () => { render(