From 3a677ce50912b82c7d4b2ffc2aad50cbc638637a Mon Sep 17 00:00:00 2001 From: John Smith Date: Sun, 22 Dec 2024 17:48:18 +1030 Subject: [PATCH] feat: More playground responsive ness (#353) * feat: Collapse breadcrumb on small screens * chore: Improve mobile layout of configs list * chore: Move clerk pickers into popover --- app/app/clusters/[clusterId]/configs/page.tsx | 36 ++-- app/app/clusters/[clusterId]/runs/layout.tsx | 24 ++- app/app/clusters/[clusterId]/usage/page.tsx | 157 ++++++------------ app/app/layout.tsx | 7 +- app/components/breadcrumbs.tsx | 79 +++++---- app/components/header.tsx | 90 ++++++++-- 6 files changed, 204 insertions(+), 189 deletions(-) diff --git a/app/app/clusters/[clusterId]/configs/page.tsx b/app/app/clusters/[clusterId]/configs/page.tsx index 34785fca..a2c19b88 100644 --- a/app/app/clusters/[clusterId]/configs/page.tsx +++ b/app/app/clusters/[clusterId]/configs/page.tsx @@ -21,25 +21,15 @@ type Prompt = ClientInferResponseBody< const columns: ColumnDef[] = [ { accessorKey: "name", - header: ({ column }) => { - return ( - - ); - }, + header: "Name", cell: ({ row }) => (

{row.getValue("name")}

-

+

{row.original.initialPrompt}

{row.original.attachedFunctions.filter(Boolean).length > 0 && ( -
+
{row.original.attachedFunctions.map((tool) => ( [] = [ }, { id: "id", - header: "Configuration ID", + header: ({ column }) => ( +
Configuration ID
+ ), cell: ({ row }) => ( -
{row.original.id}
+
{row.original.id}
), }, { id: "lastUpdated", - header: "Last Updated", + header: ({ column }) => ( +
Last Updated
+ ), cell: ({ row }) => ( -

+

{row.original.updatedAt ? formatDistanceToNow(new Date(row.original.updatedAt), { addSuffix: true, @@ -75,6 +69,7 @@ const columns: ColumnDef[] = [ }, { id: "actions", + header: "Actions", cell: function Cell({ row }) { const [isDeleting, setIsDeleting] = useState(false); const { getToken } = useAuth(); @@ -133,6 +128,7 @@ const columns: ColumnDef[] = [ size="sm" onClick={handleDelete} disabled={isDeleting} + className="hidden md:inline-flex" > {isDeleting ? "Deleting..." : "Delete"} @@ -188,18 +184,19 @@ export default function Page({ params }: { params: { clusterId: string } }) { } return ( -

+

Saved Run Configurations

Saved run configurations are reusable configurations that can be used in your next run.

-
+
+ + + {/* User profile section */} +
+
+ +
+ +
+ {/* Navigation section */} +

Navigation

+ {navigationLinks.map( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (child: any, index: any) => + child && ( + + {child} + + ) + )} +
+
- + +
+ {'logo'} +

Playground

+
+
+
-
+ {/* Desktop user controls */} +
@@ -26,7 +94,7 @@ export function Header() { hidePersonal={true} appearance={{ variables: { - colorText: "black", + colorText: 'black', }, }} afterSelectOrganizationUrl="/switch-org"