From 6f0be19c36d0ccc7ee3940ba7a932d37764a5970 Mon Sep 17 00:00:00 2001 From: Lucas Massemin Date: Wed, 8 Jan 2025 15:07:02 +0100 Subject: [PATCH] Feedback inspector in Assistant builder (#9680) * Main code brought in * Improved design for feedback list. Bug with ordering * Specialized fetch function (renamed), small margin added to feedbacks, more loaded at once * Using pagination inside feedbacks side modal * Renamed batch to page, minor improvements * Update front/components/assistant_builder/AssistantBuilderPreviewDrawer.tsx Co-authored-by: Flavien David * Moved feedback code in its own file, added some props, regular cn usage * UseSWRInfinity and IntersectionObserver * Modified message anchor to be a hash param * linter * Now returning resource in static resource function * Using a query param * Renamed variable * bask to hasMore variable name * useInView hook * Fixed drawer styleing (and icon) --------- Co-authored-by: Flavien David --- .../assistant_builder/AssistantBuilder.tsx | 54 ++-- .../AssistantBuilderPreviewDrawer.tsx | 64 +++-- ...AssistantBuilderPreviewDrawerFeedbacks.tsx | 244 ++++++++++++++++++ .../assistant_builder/PrevNextButtons.tsx | 4 +- front/lib/api/assistant/feedback.ts | 15 +- .../agent_message_feedback_resource.ts | 12 +- front/lib/swr/assistants.ts | 76 ++++++ .../agent_configurations/[aId]/feedbacks.ts | 8 +- types/src/front/assistant/builder.ts | 6 +- 9 files changed, 420 insertions(+), 63 deletions(-) create mode 100644 front/components/assistant_builder/AssistantBuilderPreviewDrawerFeedbacks.tsx diff --git a/front/components/assistant_builder/AssistantBuilder.tsx b/front/components/assistant_builder/AssistantBuilder.tsx index b52d4be3a214..01ec5f353917 100644 --- a/front/components/assistant_builder/AssistantBuilder.tsx +++ b/front/components/assistant_builder/AssistantBuilder.tsx @@ -1,6 +1,7 @@ import "react-image-crop/dist/ReactCrop.css"; import { + BarChartIcon, Button, ChatBubbleBottomCenterTextIcon, ChevronLeftIcon, @@ -500,6 +501,7 @@ export default function AssistantBuilder({ } buttonsRightPanel={ <> + {/* Chevron button */}