diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.query/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.query/route.tsx index afed660eb..80fa5bae8 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.query/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.query/route.tsx @@ -1,3 +1,4 @@ +import { LightBulbIcon } from "@heroicons/react/20/solid"; import { Form, useNavigation } from "@remix-run/react"; import { type ActionFunctionArgs, @@ -7,14 +8,20 @@ import { import { useState } from "react"; import { typedjson, useTypedActionData, useTypedLoaderData } from "remix-typedjson"; import { z } from "zod"; +import { ExitIcon } from "~/assets/icons/ExitIcon"; import { TSQLEditor } from "~/components/code/TSQLEditor"; import { TSQLResultsTable } from "~/components/code/TSQLResultsTable"; import { EnvironmentLabel } from "~/components/environments/EnvironmentLabel"; import { PageBody, PageContainer } from "~/components/layout/AppLayout"; import { Button } from "~/components/primitives/Buttons"; -import { Header3 } from "~/components/primitives/Headers"; +import { Header2, Header3 } from "~/components/primitives/Headers"; import { NavBar, PageTitle } from "~/components/primitives/PageHeader"; import { Paragraph } from "~/components/primitives/Paragraph"; +import { + ResizableHandle, + ResizablePanel, + ResizablePanelGroup, +} from "~/components/primitives/Resizable"; import { Select, SelectItem } from "~/components/primitives/Select"; import { Spinner } from "~/components/primitives/Spinner"; import { Switch } from "~/components/primitives/Switch"; @@ -180,6 +187,7 @@ export default function Page() { const [query, setQuery] = useState(defaultQuery); const [scope, setScope] = useState("environment"); const [prettyFormatting, setPrettyFormatting] = useState(true); + const [showHelpSidebar, setShowHelpSidebar] = useState(true); const isLoading = navigation.state === "submitting" || navigation.state === "loading"; @@ -189,96 +197,152 @@ export default function Page() { -
- {/* Query editor */} -
- -
- - - - -
-
- {/* Results */} -
-
-
- - {results?.rows?.length ? `${results.rows.length} Results` : "Results"} - - {results?.stats && ( - - {formatQueryStats(results.stats)} - + + +
+ {/* Query editor */} +
+ +
+ + + + {!showHelpSidebar && ( + +
+
+ {/* Results */} +
+
+
+ + {results?.rows?.length ? `${results.rows.length} Results` : "Results"} + + {results?.stats && ( + + {formatQueryStats(results.stats)} + + )} +
+ +
+ {isLoading ? ( +
+ + Executing query... +
+ ) : results?.error ? ( +
+                    {results.error}
+                  
+ ) : results?.rows && results?.columns ? ( + + ) : ( + + Run a query to see results here. + )}
-
- {isLoading ? ( -
- - Executing query... -
- ) : results?.error ? ( -
{results.error}
- ) : results?.rows && results?.columns ? ( - - ) : ( - - Run a query to see results here. - - )} -
-
+ + {showHelpSidebar && ( + <> + + + setShowHelpSidebar(false)} /> + + + )} + ); } +function QueryHelpSidebar({ onClose }: { onClose: () => void }) { + return ( +
+
+
+ + + Query help + +
+ + Help content coming soon... + +
+
+ ); +} + function ScopeItem({ scope }: { scope: QueryScope }) { const organization = useOrganization(); const project = useProject();