From 9928cba52128d0a58afc331e9950c258f272d26e Mon Sep 17 00:00:00 2001 From: Deon Sanchez <69873175+deon-sanchez@users.noreply.github.com> Date: Thu, 18 Sep 2025 09:20:29 -0600 Subject: [PATCH] Refactor Knowledge Actions Dropdown and SearchPage Component - Added TODO comments for implementing rename and sync functionalities in the KnowledgeActionsDropdown. - Adjusted column definitions in the SearchPage component to improve layout with flex and minWidth properties. - Commented out the sync button in the SearchPage for future implementation, enhancing code clarity. --- .../components/knowledge-actions-dropdown.tsx | 13 +++++++ frontend/src/app/knowledge/page.tsx | 35 +++++++++++++------ 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/frontend/components/knowledge-actions-dropdown.tsx b/frontend/components/knowledge-actions-dropdown.tsx index d4c0e6c0..9098adec 100644 --- a/frontend/components/knowledge-actions-dropdown.tsx +++ b/frontend/components/knowledge-actions-dropdown.tsx @@ -44,6 +44,19 @@ export const KnowledgeActionsDropdown = ({ + {/* //TODO: Implement rename and sync */} + {/* alert("Not implemented")} + > + Rename + + alert("Not implemented")} + > + Sync + */} setShowDeleteDialog(true)} diff --git a/frontend/src/app/knowledge/page.tsx b/frontend/src/app/knowledge/page.tsx index 0cd3c9f1..701b62c8 100644 --- a/frontend/src/app/knowledge/page.tsx +++ b/frontend/src/app/knowledge/page.tsx @@ -96,9 +96,11 @@ function SearchPage() { headerName: "Source", checkboxSelection: true, headerCheckboxSelection: true, + flex: 3, + minWidth: 200, cellRenderer: ({ data, value }: CustomCellRendererProps) => { return ( -
+
{ @@ -122,30 +124,37 @@ function SearchPage() { { field: "size", headerName: "Size", + flex: 2, + minWidth: 80, valueFormatter: params => params.value ? `${Math.round(params.value / 1024)} KB` : "-", }, { field: "mimetype", headerName: "Type", + flex: 2, + minWidth: 80, }, { field: "owner", headerName: "Owner", + flex: 2, + minWidth: 120, valueFormatter: params => - params.value || - params.data?.owner_name || - params.data?.owner_email || - "—", + params.data?.owner_name || params.data?.owner_email || "—", }, { field: "chunkCount", headerName: "Chunks", + flex: 1, + minWidth: 70, }, { field: "avgScore", headerName: "Avg score", + flex: 1, + minWidth: 90, cellRenderer: ({ value }: CustomCellRendererProps) => { return ( @@ -166,11 +175,12 @@ function SearchPage() { }, colId: "actions", filter: false, - maxWidth: 60, + width: 60, minWidth: 60, + maxWidth: 60, resizable: false, sortable: false, - initialFlex: 0, + flex: 0, }, ]); @@ -179,8 +189,6 @@ function SearchPage() { display: "flex", alignItems: "center", }), - initialFlex: 1, - minWidth: 100, resizable: false, suppressMovable: true, }; @@ -269,14 +277,15 @@ function SearchPage() { )} - + */}