From ca06ce423e058725ecfe6ecb062d4f05ab93ec87 Mon Sep 17 00:00:00 2001 From: Hentry Martin Date: Sun, 30 Nov 2025 16:32:22 +0100 Subject: [PATCH 1/3] fix: likes dislikes not updated automatically --- .../ScorecardQuestion/AiFeedback/AiFeedback.tsx | 2 +- .../AiFeedbackActions/AiFeedbackActions.tsx | 6 +++--- .../AiFeedbackComments/AiFeedbackComment.tsx | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedback/AiFeedback.tsx b/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedback/AiFeedback.tsx index 5210486bf..c4e3f0f07 100644 --- a/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedback/AiFeedback.tsx +++ b/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedback/AiFeedback.tsx @@ -40,7 +40,7 @@ const AiFeedback: FC = props => { await createFeedbackComment(workflowId as string, workflowRun?.id as string, feedback?.id, { content, }) - await mutate(`${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun?.id}/items`) + await mutate(`${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun?.id}/items?[${workflowRun?.status}]`) setShowReply(false) }, [workflowId, workflowRun?.id, feedback?.id]) diff --git a/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedbackActions/AiFeedbackActions.tsx b/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedbackActions/AiFeedbackActions.tsx index 93549abef..c248789bf 100644 --- a/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedbackActions/AiFeedbackActions.tsx +++ b/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedbackActions/AiFeedbackActions.tsx @@ -136,7 +136,7 @@ export const AiFeedbackActions: FC = props => { } try { - const itemsKey = `${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun.id}/items` + const itemsKey = `${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun.id}/items?[${workflowRun?.status}]` mutate(itemsKey, (items: any) => { if (!items || !Array.isArray(items)) return items @@ -202,7 +202,7 @@ export const AiFeedbackActions: FC = props => { setUpVotes(prevUp) setDownVotes(prevDown) - const itemsKey = `${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun.id}/items` + const itemsKey = `${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun.id}/items?[${workflowRun?.status}]` await mutate(itemsKey) } finally { setVotingInprogress(false) @@ -262,7 +262,7 @@ export const AiFeedbackActions: FC = props => { downVote: down, upVote: up, }) - await mutate(`${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun.id}/items`) + await mutate(`${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun?.id}/items?[${workflowRun?.status}]`) } catch (err) { setUserVote(prevUserVote) setUpVotes(prevUp) diff --git a/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedbackComments/AiFeedbackComment.tsx b/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedbackComments/AiFeedbackComment.tsx index 0b028c7ed..b4f6be70f 100644 --- a/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedbackComments/AiFeedbackComment.tsx +++ b/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedbackComments/AiFeedbackComment.tsx @@ -36,7 +36,7 @@ export const AiFeedbackComment: FC = props => { content, parentId: comment.id, }) - await mutate(`${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun?.id}/items`) + await mutate(`${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun?.id}/items?[${workflowRun?.status}]`) setShowReply(false) }, [workflowId, workflowRun?.id, props.feedback?.id]) @@ -44,7 +44,8 @@ export const AiFeedbackComment: FC = props => { await updateRunItemComment(workflowId as string, workflowRun?.id as string, props.feedback?.id, comment.id, { content, }) - await mutate(`${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun?.id}/items`) + console.log(`${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun?.id}/items?[${workflowRun?.status}]`) + await mutate(`${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun?.id}/items?[${workflowRun?.status}]`) setEditMode(false) }, [workflowId, workflowRun?.id, props.feedback?.id]) From 44c4edf7f142f680398afa80f51dc47b06b64604 Mon Sep 17 00:00:00 2001 From: Hentry Martin Date: Sun, 30 Nov 2025 16:34:13 +0100 Subject: [PATCH 2/3] fix: likes dislikes not updated automatically --- .../ScorecardQuestion/AiFeedbackComments/AiFeedbackComment.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedbackComments/AiFeedbackComment.tsx b/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedbackComments/AiFeedbackComment.tsx index b4f6be70f..84fb31c54 100644 --- a/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedbackComments/AiFeedbackComment.tsx +++ b/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedbackComments/AiFeedbackComment.tsx @@ -44,7 +44,6 @@ export const AiFeedbackComment: FC = props => { await updateRunItemComment(workflowId as string, workflowRun?.id as string, props.feedback?.id, comment.id, { content, }) - console.log(`${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun?.id}/items?[${workflowRun?.status}]`) await mutate(`${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun?.id}/items?[${workflowRun?.status}]`) setEditMode(false) }, [workflowId, workflowRun?.id, props.feedback?.id]) From 32c3ea631b5d3ad294f01cf4276ac750c78c7455 Mon Sep 17 00:00:00 2001 From: Hentry Martin Date: Sun, 30 Nov 2025 17:34:15 +0100 Subject: [PATCH 3/3] fix: lint --- .../ScorecardQuestion/AiFeedback/AiFeedback.tsx | 4 +++- .../AiFeedbackActions/AiFeedbackActions.tsx | 3 +++ .../AiFeedbackComments/AiFeedbackComment.tsx | 8 ++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedback/AiFeedback.tsx b/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedback/AiFeedback.tsx index c4e3f0f07..129738904 100644 --- a/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedback/AiFeedback.tsx +++ b/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedback/AiFeedback.tsx @@ -40,7 +40,9 @@ const AiFeedback: FC = props => { await createFeedbackComment(workflowId as string, workflowRun?.id as string, feedback?.id, { content, }) - await mutate(`${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun?.id}/items?[${workflowRun?.status}]`) + await mutate(` + ${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun?.id}/items?[${workflowRun?.status}] + `) setShowReply(false) }, [workflowId, workflowRun?.id, feedback?.id]) diff --git a/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedbackActions/AiFeedbackActions.tsx b/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedbackActions/AiFeedbackActions.tsx index c248789bf..dc23d2791 100644 --- a/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedbackActions/AiFeedbackActions.tsx +++ b/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedbackActions/AiFeedbackActions.tsx @@ -136,6 +136,7 @@ export const AiFeedbackActions: FC = props => { } try { + // eslint-disable-next-line max-len const itemsKey = `${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun.id}/items?[${workflowRun?.status}]` mutate(itemsKey, (items: any) => { if (!items || !Array.isArray(items)) return items @@ -202,6 +203,7 @@ export const AiFeedbackActions: FC = props => { setUpVotes(prevUp) setDownVotes(prevDown) + // eslint-disable-next-line max-len const itemsKey = `${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun.id}/items?[${workflowRun?.status}]` await mutate(itemsKey) } finally { @@ -262,6 +264,7 @@ export const AiFeedbackActions: FC = props => { downVote: down, upVote: up, }) + // eslint-disable-next-line max-len await mutate(`${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun?.id}/items?[${workflowRun?.status}]`) } catch (err) { setUserVote(prevUserVote) diff --git a/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedbackComments/AiFeedbackComment.tsx b/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedbackComments/AiFeedbackComment.tsx index 84fb31c54..402f8d51f 100644 --- a/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedbackComments/AiFeedbackComment.tsx +++ b/src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedbackComments/AiFeedbackComment.tsx @@ -36,7 +36,9 @@ export const AiFeedbackComment: FC = props => { content, parentId: comment.id, }) - await mutate(`${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun?.id}/items?[${workflowRun?.status}]`) + await mutate(` + ${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun?.id}/items?[${workflowRun?.status}] + `) setShowReply(false) }, [workflowId, workflowRun?.id, props.feedback?.id]) @@ -44,7 +46,9 @@ export const AiFeedbackComment: FC = props => { await updateRunItemComment(workflowId as string, workflowRun?.id as string, props.feedback?.id, comment.id, { content, }) - await mutate(`${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun?.id}/items?[${workflowRun?.status}]`) + await mutate(` + ${EnvironmentConfig.API.V6}/workflows/${workflowId}/runs/${workflowRun?.id}/items?[${workflowRun?.status}] + `) setEditMode(false) }, [workflowId, workflowRun?.id, props.feedback?.id])