From 345788869aaffb283f7a1a330d83a58e5ae2a48f Mon Sep 17 00:00:00 2001 From: Jason Robison Date: Fri, 26 Jul 2024 21:35:37 -0600 Subject: [PATCH] Minor refactor --- ui/package-lock.json | 34 +++++++++++++++------------- ui/src/components/MainEditor.tsx | 2 +- ui/src/components/WorkshopMember.tsx | 5 ++-- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/ui/package-lock.json b/ui/package-lock.json index 7d2c02c..9ba1914 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -12,6 +12,8 @@ "@types/react": "^18.2.73", "@types/react-dom": "^18.2.23", "axios": "^1.6.8", + "nth-check": ">=2.0.1", + "postcss": ">=8.4.31", "react": "^18.2.0", "react-dom": "^18.2.0", "react-scripts": "5.0.1", @@ -5667,11 +5669,11 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -7056,9 +7058,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/ejs": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.9.tgz", - "integrity": "sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==", + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", "dependencies": { "jake": "^10.8.5" }, @@ -8286,9 +8288,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -17507,9 +17509,9 @@ } }, "node_modules/webpack-dev-server/node_modules/ws": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", - "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", "engines": { "node": ">=10.0.0" }, @@ -18155,9 +18157,9 @@ } }, "node_modules/ws": { - "version": "7.5.9", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", - "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", "engines": { "node": ">=8.3.0" }, diff --git a/ui/src/components/MainEditor.tsx b/ui/src/components/MainEditor.tsx index bb87fa7..3d99848 100644 --- a/ui/src/components/MainEditor.tsx +++ b/ui/src/components/MainEditor.tsx @@ -5,7 +5,7 @@ interface Props { setText: (text: string) => void; onSubmit: () => void; - isLoading: boolean; // New prop to indicate loading state + isLoading: boolean; } const MainEditor: React.FC = ({ text, setText, onSubmit, isLoading }) => { diff --git a/ui/src/components/WorkshopMember.tsx b/ui/src/components/WorkshopMember.tsx index 77887dc..0d23054 100644 --- a/ui/src/components/WorkshopMember.tsx +++ b/ui/src/components/WorkshopMember.tsx @@ -1,5 +1,7 @@ import React, { useState } from 'react'; +const MODELS = ['gpt-4-turbo', 'GPT-4', 'gpt-3.5-turbo', 'mistral-small', 'mistral-medium', 'mistral-large-latest', 'gemini-pro-1.5', 'gemini-pro', 'claude-3-haiku-20240307', 'claude-3-sonnet-20240229', 'claude-3-opus-20240229']; + interface Props { role: string; response: string; @@ -8,7 +10,6 @@ interface Props { } const WorkshopMember: React.FC = ({ role, response, model, onModelChange }) => { - const models = ['gpt-4-turbo', 'GPT-4', 'gpt-3.5-turbo', 'mistral-small', 'mistral-medium', 'mistral-large-latest', 'gemini-pro-1.5', 'gemini-pro', 'claude-3-haiku-20240307', 'claude-3-sonnet-20240229', 'claude-3-opus-20240229']; const [expanded, setExpanded] = useState(false); const handleClick = () => { @@ -22,7 +23,7 @@ const WorkshopMember: React.FC = ({ role, response, model, onModelChange

Click review text to expand