From 8d07a9d0eec70a7e6be6ebb0359d9f22e99d1671 Mon Sep 17 00:00:00 2001 From: Tim Sweeney Date: Mon, 18 Nov 2024 14:52:43 -0800 Subject: [PATCH] Small fix to overflow --- .../pages/CallPage/CallScoresViewer.tsx | 95 ++++++++++--------- 1 file changed, 49 insertions(+), 46 deletions(-) diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallPage/CallScoresViewer.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallPage/CallScoresViewer.tsx index d62d1bd1527d..daa60c951b63 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallPage/CallScoresViewer.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallPage/CallScoresViewer.tsx @@ -26,52 +26,7 @@ import {CallSchema} from '../wfReactInterface/wfDataModelHooksInterface'; const RUNNABLE_REF_PREFIX = 'wandb.runnable'; -// New RunButton component -const RunButton: React.FC<{ - actionRef: string; - callId: string; - entity: string; - project: string; - refetchFeedback: () => void; -}> = ({actionRef, callId, entity, project, refetchFeedback}) => { - const getClient = useGetTraceServerClientContext(); - const [isRunning, setIsRunning] = useState(false); - const [error, setError] = useState(null); - - const handleRunClick = async () => { - setIsRunning(true); - setError(null); - try { - await getClient().actionsExecuteBatch({ - project_id: projectIdFromParts({entity, project}), - call_ids: [callId], - action_ref: actionRef, - }); - refetchFeedback(); - } catch (err) { - setError('An error occurred while running the action.'); - } finally { - setIsRunning(false); - } - }; - - if (error) { - return ( - - ); - } - - return ( -
- -
- ); -}; const useLatestActionDefinitionsForCall = (call: CallSchema) => { const actionSpecs = ( @@ -311,7 +266,7 @@ export const CallScoresViewer: React.FC<{ { field: 'run', headerName: '', - width: 70, + width:75, rowSpanValueGetter: (value, row) => row.displayName, renderCell: params => { const actionRef = params.row.runnableActionRef; @@ -367,3 +322,51 @@ export const CallScoresViewer: React.FC<{ ); }; + + +const RunButton: React.FC<{ + actionRef: string; + callId: string; + entity: string; + project: string; + refetchFeedback: () => void; +}> = ({actionRef, callId, entity, project, refetchFeedback}) => { + const getClient = useGetTraceServerClientContext(); + + const [isRunning, setIsRunning] = useState(false); + const [error, setError] = useState(null); + + const handleRunClick = async () => { + setIsRunning(true); + setError(null); + try { + await getClient().actionsExecuteBatch({ + project_id: projectIdFromParts({entity, project}), + call_ids: [callId], + action_ref: actionRef, + }); + refetchFeedback(); + } catch (err) { + setError('An error occurred while running the action.'); + } finally { + setIsRunning(false); + } + }; + + + if (error) { + return ( + + ); + } + + return ( +
+ +
+ ); +}; \ No newline at end of file