fix: playground parameters area resizable

This commit is contained in:
jialin
2025-05-20 19:33:10 +08:00
parent 174f93fe11
commit 1c11e73ff8
11 changed files with 82 additions and 21 deletions
+9 -1
View File
@@ -10,6 +10,7 @@ import { useCallback, useEffect, useRef, useState } from 'react';
import { useHotkeys } from 'react-hotkeys-hook';
import { queryModelsList } from './apis';
import GroundReranker from './components/ground-reranker';
import useCollapseLayout from './hooks/use-collapse-layout';
import './style/play-ground.less';
const PlaygroundRerank: React.FC = () => {
@@ -21,6 +22,13 @@ const PlaygroundRerank: React.FC = () => {
>([]);
const [loaded, setLoaded] = useState(false);
useCollapseLayout({
handler: () => {
groundRerankerRef.current?.setCollapse?.();
},
triggeredRef: groundRerankerRef.current
});
const handleViewCode = useCallback(() => {
groundRerankerRef.current?.viewCode?.();
}, [groundRerankerRef]);
@@ -90,7 +98,7 @@ const PlaygroundRerank: React.FC = () => {
useHotkeys(
HotKeys.RIGHT.join(','),
() => {
groundLeftRef.current?.setCollapse?.();
groundRerankerRef.current?.setCollapse?.();
},
{
preventDefault: true