From b4afd4b49a7491334ac2204eab062b2b0fb313bc Mon Sep 17 00:00:00 2001 From: Kaosiso Ezealigo Date: Wed, 11 Dec 2024 01:50:10 +0100 Subject: [PATCH 1/3] fix(frontend): split state to select evaluaor category --- .../autoEvaluation/EvaluatorsModal/Evaluators/index.tsx | 7 ++----- .../autoEvaluation/EvaluatorsModal/EvaluatorsModal.tsx | 5 ----- .../autoEvaluation/EvaluatorsModal/NewEvaluator/index.tsx | 7 ++----- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/agenta-web/src/components/pages/evaluations/autoEvaluation/EvaluatorsModal/Evaluators/index.tsx b/agenta-web/src/components/pages/evaluations/autoEvaluation/EvaluatorsModal/Evaluators/index.tsx index 99600dda62..b3035dbfbf 100644 --- a/agenta-web/src/components/pages/evaluations/autoEvaluation/EvaluatorsModal/Evaluators/index.tsx +++ b/agenta-web/src/components/pages/evaluations/autoEvaluation/EvaluatorsModal/Evaluators/index.tsx @@ -22,8 +22,6 @@ type EvaluatorsProps = { onSuccess: () => void setEvaluatorsDisplay: any evaluatorsDisplay: string - setSelectedEvaluatorCategory: React.Dispatch> - selectedEvaluatorCategory: string } const useStyles = createUseStyles((theme: JSSTheme) => ({ @@ -74,13 +72,12 @@ const Evaluators = ({ setCloneConfig, setEvaluatorsDisplay, evaluatorsDisplay, - selectedEvaluatorCategory, - setSelectedEvaluatorCategory, }: EvaluatorsProps) => { const classes = useStyles() const [searchTerm, setSearchTerm] = useState("") const evaluatorTags = getEvaluatorTags() const evaluators = useAtom(evaluatorsAtom)[0] + const [selectedEvaluatorCategory, setSelectedEvaluatorCategory] = useState("view_all") const updatedEvaluatorConfigs = useMemo(() => { return evaluatorConfigs.map((config) => { @@ -128,7 +125,7 @@ const Evaluators = ({
setSelectedEvaluatorCategory(e.target.value)} > diff --git a/agenta-web/src/components/pages/evaluations/autoEvaluation/EvaluatorsModal/EvaluatorsModal.tsx b/agenta-web/src/components/pages/evaluations/autoEvaluation/EvaluatorsModal/EvaluatorsModal.tsx index c1404b6114..02a88dcea8 100644 --- a/agenta-web/src/components/pages/evaluations/autoEvaluation/EvaluatorsModal/EvaluatorsModal.tsx +++ b/agenta-web/src/components/pages/evaluations/autoEvaluation/EvaluatorsModal/EvaluatorsModal.tsx @@ -68,7 +68,6 @@ const EvaluatorsModal = ({ "evaluator_view", "list", ) - const [selectedEvaluatorCategory, setSelectedEvaluatorCategory] = useState("view_all") const [selectedTestset, setSelectedTestset] = useState("") const evalConfigFetcher = () => { @@ -114,8 +113,6 @@ const EvaluatorsModal = ({ setCloneConfig={setCloneConfig} setEvaluatorsDisplay={setEvaluatorsDisplay} evaluatorsDisplay={evaluatorsDisplay} - selectedEvaluatorCategory={selectedEvaluatorCategory} - setSelectedEvaluatorCategory={setSelectedEvaluatorCategory} /> ), }, @@ -128,8 +125,6 @@ const EvaluatorsModal = ({ setSelectedEvaluator={setSelectedEvaluator} setEvaluatorsDisplay={setEvaluatorsDisplay} evaluatorsDisplay={evaluatorsDisplay} - selectedEvaluatorCategory={selectedEvaluatorCategory} - setSelectedEvaluatorCategory={setSelectedEvaluatorCategory} /> ), }, diff --git a/agenta-web/src/components/pages/evaluations/autoEvaluation/EvaluatorsModal/NewEvaluator/index.tsx b/agenta-web/src/components/pages/evaluations/autoEvaluation/EvaluatorsModal/NewEvaluator/index.tsx index 972c3efc20..a6a426e879 100644 --- a/agenta-web/src/components/pages/evaluations/autoEvaluation/EvaluatorsModal/NewEvaluator/index.tsx +++ b/agenta-web/src/components/pages/evaluations/autoEvaluation/EvaluatorsModal/NewEvaluator/index.tsx @@ -15,8 +15,6 @@ type NewEvaluatorProps = { setSelectedEvaluator: React.Dispatch> setEvaluatorsDisplay: any evaluatorsDisplay: string - setSelectedEvaluatorCategory: React.Dispatch> - selectedEvaluatorCategory: string } const useStyles = createUseStyles((theme: JSSTheme) => ({ @@ -62,12 +60,11 @@ const NewEvaluator = ({ setSelectedEvaluator, setEvaluatorsDisplay, evaluatorsDisplay, - selectedEvaluatorCategory, - setSelectedEvaluatorCategory, }: NewEvaluatorProps) => { const classes = useStyles() const [searchTerm, setSearchTerm] = useState("") const evaluatorTags = getEvaluatorTags() + const [selectedEvaluatorCategory, setSelectedEvaluatorCategory] = useState("view_all") const filteredEvaluators = useMemo(() => { let filtered = evaluators @@ -103,7 +100,7 @@ const NewEvaluator = ({
setSelectedEvaluatorCategory(e.target.value)} > From a1c313961840a4b14a4e7a8fa77aadff12e5b0e7 Mon Sep 17 00:00:00 2001 From: Kaosiso Ezealigo Date: Wed, 11 Dec 2024 13:07:53 +0100 Subject: [PATCH 2/3] fix(frontend): removed maxHeight from menu container styles --- agenta-web/src/components/Sidebar/Sidebar.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/agenta-web/src/components/Sidebar/Sidebar.tsx b/agenta-web/src/components/Sidebar/Sidebar.tsx index 0854ac8a3d..b34ab57534 100644 --- a/agenta-web/src/components/Sidebar/Sidebar.tsx +++ b/agenta-web/src/components/Sidebar/Sidebar.tsx @@ -66,7 +66,6 @@ const useStyles = createUseStyles((theme: JSSTheme) => ({ }, menuContainer: { borderRight: "0 !important", - maxHeight: "calc(100vh - 390px)", overflowY: "auto", position: "relative", "& .ant-menu-item-selected": { From ec78df0908d89e670458a0f4aee4762a3a183e70 Mon Sep 17 00:00:00 2001 From: Kaosiso Ezealigo Date: Wed, 11 Dec 2024 13:27:22 +0100 Subject: [PATCH 3/3] minor fix(frontend) --- agenta-web/src/components/Sidebar/Sidebar.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/agenta-web/src/components/Sidebar/Sidebar.tsx b/agenta-web/src/components/Sidebar/Sidebar.tsx index b34ab57534..65c2ce801c 100644 --- a/agenta-web/src/components/Sidebar/Sidebar.tsx +++ b/agenta-web/src/components/Sidebar/Sidebar.tsx @@ -51,6 +51,7 @@ const useStyles = createUseStyles((theme: JSSTheme) => ({ justifyContent: "space-between", flexDirection: "column", flex: 1, + overflowY: "auto", }, "& .ant-menu-submenu-title": { display: "flex",