Skip to content

Commit bca88b3

Browse files
committed
[OPIK-4444] [FE] Redesign API key submenu with split copy/manage actions
1 parent 1a07e0d commit bca88b3

File tree

2 files changed

+29
-23
lines changed

2 files changed

+29
-23
lines changed

apps/opik-frontend/src/components/pages-shared/llm/PromptModelSelect/PromptModelSelect.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
SelectTrigger,
1111
SelectValue,
1212
} from "@/components/ui/select";
13-
import { ChevronRight, Search } from "lucide-react";
13+
import { ChevronRight, Search, Settings2 } from "lucide-react";
1414
import { ListAction } from "@/components/ui/list-action";
1515
import TooltipWrapper from "@/components/shared/TooltipWrapper/TooltipWrapper";
1616
import { Input } from "@/components/ui/input";
@@ -328,6 +328,7 @@ const PromptModelSelect = ({
328328
setOpenConfigDialog(true);
329329
}}
330330
>
331+
<Settings2 className="size-3.5 shrink-0" />
331332
Manage AI providers
332333
</ListAction>
333334
</div>

apps/opik-frontend/src/plugins/comet/UserMenu.tsx

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ import {
1010
KeyRound,
1111
LogOut,
1212
Settings,
13+
Settings2,
1314
Shield,
1415
UserPlus,
1516
Zap,
1617
} from "lucide-react";
1718

1819
import { useOpenQuickStartDialog } from "@/components/pages-shared/onboarding/QuickstartDialog/QuickstartDialog";
19-
import { ListAction } from "@/components/ui/list-action";
2020
import TooltipWrapper from "@/components/shared/TooltipWrapper/TooltipWrapper";
2121
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
2222
import { Button } from "@/components/ui/button";
@@ -302,29 +302,34 @@ const UserMenu = () => {
302302
</DropdownMenuSubTrigger>
303303
<DropdownMenuPortal>
304304
<DropdownMenuSubContent className="w-60">
305-
<DropdownMenuItem
306-
className="cursor-pointer"
307-
onClick={() => {
308-
copy(user.apiKeys[0]);
309-
toast({ description: "Successfully copied API Key" });
310-
}}
311-
>
312-
<span className="truncate">
305+
<div className="flex h-10 items-center justify-between gap-2 px-4">
306+
<span className="comet-body-s truncate text-foreground">
313307
{maskAPIKey(user.apiKeys[0])}
314308
</span>
315-
<Copy className="ml-2 size-3 shrink-0" />
316-
</DropdownMenuItem>
317-
<DropdownMenuSeparator className="my-1" />
318-
<ListAction asChild>
319-
<a
320-
href={buildUrl(
321-
"account-settings/apiKeys",
322-
workspaceName,
323-
)}
324-
>
325-
Manage API keys
326-
</a>
327-
</ListAction>
309+
<div className="flex shrink-0 items-center gap-1 text-light-slate">
310+
<button
311+
className="cursor-pointer rounded p-0.5 hover:text-foreground"
312+
onClick={() => {
313+
copy(user.apiKeys[0]);
314+
toast({
315+
description: "Successfully copied API Key",
316+
});
317+
}}
318+
>
319+
<Copy className="size-3.5" />
320+
</button>
321+
<div className="mx-0.5 h-3.5 w-px bg-border" />
322+
<a
323+
className="cursor-pointer rounded p-0.5 hover:text-foreground"
324+
href={buildUrl(
325+
"account-settings/apiKeys",
326+
workspaceName,
327+
)}
328+
>
329+
<Settings2 className="size-3.5" />
330+
</a>
331+
</div>
332+
</div>
328333
</DropdownMenuSubContent>
329334
</DropdownMenuPortal>
330335
</DropdownMenuSub>

0 commit comments

Comments
 (0)