diff --git a/.changeset/flat-cups-tie.md b/.changeset/flat-cups-tie.md
new file mode 100644
index 000000000..f22eccd66
--- /dev/null
+++ b/.changeset/flat-cups-tie.md
@@ -0,0 +1,5 @@
+---
+'hive': patch
+---
+
+Improvements to UI of Preflight Script (Laboratory)
diff --git a/packages/web/app/src/components/v2/accordion.tsx b/packages/web/app/src/components/v2/accordion.tsx
index 944c3ac12..f5c5f554c 100644
--- a/packages/web/app/src/components/v2/accordion.tsx
+++ b/packages/web/app/src/components/v2/accordion.tsx
@@ -68,7 +68,7 @@ function Header({
diff --git a/packages/web/app/src/lib/hooks/laboratory/use-operation-collections-plugin.tsx b/packages/web/app/src/lib/hooks/laboratory/use-operation-collections-plugin.tsx
index 17ddbc6bb..bcdc7a5f9 100644
--- a/packages/web/app/src/lib/hooks/laboratory/use-operation-collections-plugin.tsx
+++ b/packages/web/app/src/lib/hooks/laboratory/use-operation-collections-plugin.tsx
@@ -307,8 +307,8 @@ export function Content() {
-
-
+
+
{collection.name}
{shouldShowMenu && (
diff --git a/packages/web/app/src/lib/preflight-sandbox/graphiql-plugin.tsx b/packages/web/app/src/lib/preflight-sandbox/graphiql-plugin.tsx
index f369438aa..35699adbe 100644
--- a/packages/web/app/src/lib/preflight-sandbox/graphiql-plugin.tsx
+++ b/packages/web/app/src/lib/preflight-sandbox/graphiql-plugin.tsx
@@ -1,6 +1,7 @@
import {
ComponentPropsWithoutRef,
createContext,
+ ReactNode,
useCallback,
useContext,
useEffect,
@@ -8,6 +9,7 @@ import {
useState,
} from 'react';
import { clsx } from 'clsx';
+import { PowerIcon } from 'lucide-react';
import type { editor } from 'monaco-editor';
import { useMutation } from 'urql';
import { Badge } from '@/components/ui/badge';
@@ -20,8 +22,7 @@ import {
DialogHeader,
DialogTitle,
} from '@/components/ui/dialog';
-import { Subtitle, Title } from '@/components/ui/page';
-import { Switch } from '@/components/ui/switch';
+import { Subtitle } from '@/components/ui/page';
import { useToast } from '@/components/ui/use-toast';
import { FragmentType, graphql, useFragment } from '@/gql';
import { useLocalStorage, useToggle } from '@/lib/hooks';
@@ -36,6 +37,7 @@ import {
TriangleRightIcon,
} from '@radix-ui/react-icons';
import { useParams } from '@tanstack/react-router';
+import { cn } from '../utils';
import type { LogMessage } from './preflight-script-worker';
export const preflightScriptPlugin: GraphiQLPlugin = {
@@ -63,6 +65,14 @@ const classes = {
icon: clsx('absolute -left-5 top-px'),
};
+function EditorTitle(props: { children: ReactNode; className?: string }) {
+ return (
+
+ {props.children}
+
+ );
+}
+
const sharedMonacoProps = {
theme: 'vs-dark',
className: classes.monaco,
@@ -397,43 +407,69 @@ function PreflightScriptContent() {
- This script is run before each operation submitted, e.g. for automated authentication.
+ Before each GraphQL request begins, this script is executed automatically - for example, to
+ handle authentication.
-
+ Preflight Script is disabled and will not be executed
+
+
+ )}
- )}
+
-
+
Environment variables{' '}
JSON
-
- Define variables to use in your Headers
+
+
+ Declare variables that can be used by both the script and headers.
+