diff --git a/src/components/OutputsTable/NewScenarioButton.tsx b/src/components/OutputsTable/NewScenarioButton.tsx
index 43827ed..590868e 100644
--- a/src/components/OutputsTable/NewScenarioButton.tsx
+++ b/src/components/OutputsTable/NewScenarioButton.tsx
@@ -27,7 +27,7 @@ export default function NewScenarioButton() {
onClick={onClick}
>
- New Scenario
+ Add Scenario
);
}
diff --git a/src/components/OutputsTable/NewVariantButton.tsx b/src/components/OutputsTable/NewVariantButton.tsx
index cde24ad..8cbbef0 100644
--- a/src/components/OutputsTable/NewVariantButton.tsx
+++ b/src/components/OutputsTable/NewVariantButton.tsx
@@ -31,7 +31,7 @@ export default function NewVariantButton() {
minH={headerMinHeight}
>
- New Variant
+ Add Variant
);
}
diff --git a/src/components/OutputsTable/ScenarioEditor.tsx b/src/components/OutputsTable/ScenarioEditor.tsx
index bc28ba1..f650e8d 100644
--- a/src/components/OutputsTable/ScenarioEditor.tsx
+++ b/src/components/OutputsTable/ScenarioEditor.tsx
@@ -143,6 +143,7 @@ export default function ScenarioEditor({
onKeyDown={(e) => {
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
e.preventDefault();
+ e.currentTarget.blur();
onSave();
}
}}
diff --git a/src/components/nav/AppShell.tsx b/src/components/nav/AppShell.tsx
index c6c00a9..33b7fa3 100644
--- a/src/components/nav/AppShell.tsx
+++ b/src/components/nav/AppShell.tsx
@@ -1,4 +1,15 @@
-import { Box, Flex, Stack, Button, Heading, VStack, Icon, HStack } from "@chakra-ui/react";
+import {
+ Box,
+ Flex,
+ Stack,
+ Button,
+ Heading,
+ VStack,
+ Icon,
+ HStack,
+ BoxProps,
+ forwardRef,
+} from "@chakra-ui/react";
import Head from "next/head";
import { api } from "~/utils/api";
import { BsPlusSquare } from "react-icons/bs";
@@ -7,24 +18,31 @@ import { useRouter } from "next/router";
import Link from "next/link";
import { useHandledAsyncCallback } from "~/utils/hooks";
-const NavButton = ({ label, onClick }) => {
- return (
-
- );
-};
+ {children}
+
+ )
+);
+
+ExperimentLink.displayName = "ExperimentLink";
export default function AppShell(props: { children: React.ReactNode; title?: string }) {
const experiments = api.experiments.list.useQuery();
const router = useRouter();
const utils = api.useContext();
+ const currentId = router.query.id as string | undefined;
const createMutation = api.experiments.create.useMutation();
const [createExperiment] = useHandledAsyncCallback(async () => {
@@ -38,25 +56,34 @@ export default function AppShell(props: { children: React.ReactNode; title?: str
{props.title ? `${props.title} | Prompt Lab` : "Prompt Lab"}
-
-
+
+
Experiments
- {experiments?.data?.map((exp) => (
-
- {exp.label}
-
- ))}
-
+
+ {experiments?.data?.map((exp) => (
+
+ {exp.label}
+
+ ))}
+
+
+ New Experiment
+
+ {/* } onClick={createExperiment}>
+ New Experiment
+ */}
+ {/* */}
+
diff --git a/src/server/api/routers/experiments.router.ts b/src/server/api/routers/experiments.router.ts
index b67c163..173719d 100644
--- a/src/server/api/routers/experiments.router.ts
+++ b/src/server/api/routers/experiments.router.ts
@@ -47,7 +47,7 @@ export const experimentsRouter = createTRPCRouter({
messages: [
{
role: "system",
- content: "count to three in Spanish...",
+ content: "count to three in {{input}}...",
},
],
},
@@ -56,7 +56,13 @@ export const experimentsRouter = createTRPCRouter({
prisma.testScenario.create({
data: {
experimentId: exp.id,
- variableValues: {},
+ variableValues: { input: "Spanish" },
+ },
+ }),
+ prisma.templateVariable.create({
+ data: {
+ experimentId: exp.id,
+ label: "input",
},
}),
]);