From c7c910d1ca4a520e43c2a12c0d3074d591d4dc6b Mon Sep 17 00:00:00 2001 From: zhom <2717306+zhom@users.noreply.github.com> Date: Wed, 26 Nov 2025 01:42:33 +0400 Subject: [PATCH] style: tight table design --- src/components/profile-data-table.tsx | 62 +++++++++++++++++---------- src/components/proxy-check-button.tsx | 33 ++++++++------ src/components/ui/table.tsx | 4 +- 3 files changed, 61 insertions(+), 38 deletions(-) diff --git a/src/components/profile-data-table.tsx b/src/components/profile-data-table.tsx index 15166a2..2cafe58 100644 --- a/src/components/profile-data-table.tsx +++ b/src/components/profile-data-table.tsx @@ -100,7 +100,7 @@ type TableMeta = { profileId: string, proxyId: string | null, ) => void | Promise; - checkingProxyId: string | null; + checkingProfileId: string | null; proxyCheckResults: Record; // Selection helpers @@ -209,6 +209,7 @@ const TagsCell = React.memo<{ const [visibleCount, setVisibleCount] = React.useState( effectiveTags.length, ); + const [isFocused, setIsFocused] = React.useState(false); React.useLayoutEffect(() => { // Only measure when not editing this profile's tags @@ -298,7 +299,7 @@ const TagsCell = React.memo<{ type="button" ref={containerRef as unknown as React.RefObject} className={cn( - "flex overflow-hidden gap-1 items-center p-2.5 w-full bg-transparent rounded border-none cursor-pointer", + "flex overflow-hidden gap-1 items-center px-2 py-1 h-6 w-full bg-transparent rounded border-none cursor-pointer", isDisabled ? "opacity-60" : "cursor-pointer hover:bg-accent/50", )} onClick={() => { @@ -322,7 +323,7 @@ const TagsCell = React.memo<{ ); return ( -
+
{ButtonContent} {hiddenCount > 0 && ( @@ -348,11 +349,14 @@ const TagsCell = React.memo<{ return (
-
+
div]:items-center [&_div:first-child>div]:!h-6", + "[&_input]:!ml-0 [&_input]:!mt-0 [&_input]:!px-0", + !isFocused && "[&_div:first-child>div]:justify-center", + )} + badgeClassName="shrink-0" inputProps={{ - className: "py-1", + className: "!py-0 text-sm caret-current !ml-0 !mt-0 !px-0", onKeyDown: (e) => { if (e.key === "Escape") setOpenTagsEditorFor(null); }, + onFocus: () => setIsFocused(true), + onBlur: () => setIsFocused(false), }} />
@@ -440,9 +453,9 @@ export function ProfilesDataTable({ const [openProxySelectorFor, setOpenProxySelectorFor] = React.useState< string | null >(null); - const [checkingProxyId, setCheckingProxyId] = React.useState( - null, - ); + const [checkingProfileId, setCheckingProfileId] = React.useState< + string | null + >(null); const [proxyCheckResults, setProxyCheckResults] = React.useState< Record >({}); @@ -818,7 +831,7 @@ export function ProfilesDataTable({ proxyOverrides, storedProxies, handleProxySelection, - checkingProxyId, + checkingProfileId, proxyCheckResults, // Selection helpers @@ -864,7 +877,7 @@ export function ProfilesDataTable({ proxyOverrides, storedProxies, handleProxySelection, - checkingProxyId, + checkingProfileId, proxyCheckResults, handleToggleAll, handleCheckboxChange, @@ -1033,7 +1046,7 @@ export function ProfilesDataTable({ size="sm" disabled={!canLaunch || isLaunching || isStopping} className={cn( - "cursor-pointer min-w-[70px]", + "cursor-pointer min-w-[70px] h-7", !canLaunch && "opacity-50", )} onClick={() => @@ -1118,7 +1131,7 @@ export function ProfilesDataTable({ meta.setRenameError(null); } }} - className="inline-block w-30" + className="w-30 h-6 px-2 py-1 text-sm font-medium leading-none border-0 shadow-none focus-visible:ring-0" />
{name}
+
{name}
) : ( - {trimName(name, 14)} + {trimName(name, 14)} {name} @@ -1160,7 +1173,7 @@ export function ProfilesDataTable({
) : result && !result.is_valid ? (

Proxy check failed

-

+

Failed {formatRelativeTime(result.timestamp)}

diff --git a/src/components/ui/table.tsx b/src/components/ui/table.tsx index c6b54d6..3f570d8 100644 --- a/src/components/ui/table.tsx +++ b/src/components/ui/table.tsx @@ -67,7 +67,7 @@ function TableHead({ className, ...props }: React.ComponentProps<"th">) { ) { return ( );