From 6aafe41eeea5cf08b9c5723078888cfb858c832e Mon Sep 17 00:00:00 2001 From: Jonathan Summers-Muir Date: Thu, 14 Nov 2024 00:01:46 +0800 Subject: [PATCH] preview tab works now --- .../NavigationBar/NavigationBar.utils.tsx | 4 +- .../layouts/explorer/empty-state-panel.tsx | 5 +- .../data/database/postgres-in-use-query.ts | 102 +++++ .../project/[ref]/explorer/index-old.tsx | 150 ++++++++ .../pages/project/[ref]/explorer/index.tsx | 359 +++++++++++++----- 5 files changed, 529 insertions(+), 91 deletions(-) create mode 100644 apps/studio/data/database/postgres-in-use-query.ts create mode 100644 apps/studio/pages/project/[ref]/explorer/index-old.tsx diff --git a/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.utils.tsx b/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.utils.tsx index 40013061033..6619fc6d629 100644 --- a/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.utils.tsx +++ b/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.utils.tsx @@ -22,10 +22,10 @@ export const generateToolRoutes = (ref?: string, project?: Project): Route[] => return [ { - key: 'editor', + key: 'explorer', label: 'Explorer', icon: , - link: ref && (isProjectBuilding ? buildingUrl : `/project/${ref}/editor`), + link: ref && (isProjectBuilding ? buildingUrl : `/project/${ref}/explorer`), linkElement: , }, // { diff --git a/apps/studio/components/layouts/explorer/empty-state-panel.tsx b/apps/studio/components/layouts/explorer/empty-state-panel.tsx index a7e0142a482..a7420a083ee 100644 --- a/apps/studio/components/layouts/explorer/empty-state-panel.tsx +++ b/apps/studio/components/layouts/explorer/empty-state-panel.tsx @@ -68,9 +68,8 @@ export const EmptyStatePanel = ({ )} {aiButtonText && ( + + + ) + )} + {!showRightPanel && } + + {!showRightPanel && ( + + + + Try these example prompts: + + {isLoading ? ( + <> + {[...Array(4)].map((_, i) => ( + + ))} + + ) : ( + [ + 'Create a table to store user profiles with basic information', + 'Help me write a query to find the most active users in the last 30 days', + 'Show me how to implement row level security for a multi-tenant application', + 'Generate a function to calculate the distance between two geographic points', + ].map((prompt, i) => ( + { + setInput(prompt) + inputRef.current?.focus() + }} + > + "{prompt}" + + )) + )} + + + )} + + + setShowRightPanel(true)} + /> + - -
-
-
-
-
- -
-

Migrate to Supabase

-
-

- This panel features geometric shapes on the right side, each with a distinct shade - and reduced opacity, creating a subtle fade-out effect. -

+ {showRightPanel && ( + +
+

AI Assistant

+
-
- + +
{/* Chat content will go here */}
+ + + {}} /> + + + )} - + ) }