From 9c5bbdaa28e9fd4180b1e0c9ab964cfa6ceec1f8 Mon Sep 17 00:00:00 2001
From: Marco Beretta <81851188+berry-13@users.noreply.github.com>
Date: Mon, 29 Sep 2025 21:19:22 +0200
Subject: [PATCH] refactor(DataTable): improve column sizing and visibility
handling; remove deprecated features
---
client/src/components/Conversations/Convo.tsx | 2 +-
.../SettingsTabs/General/ArchivedChats.tsx | 35 +---
.../src/components/DataTable/DataTable.tsx | 196 ++++++++++--------
.../components/DataTable/DataTable.types.ts | 36 +++-
.../DataTable/DataTableComponents.tsx | 42 ++--
.../components/DataTable/DataTableSearch.tsx | 2 +-
.../client/src/components/DataTable/index.ts | 3 +
packages/client/src/components/index.ts | 2 +-
packages/client/src/index.ts | 2 -
.../client/src/locales/en/translation.json | 6 +-
10 files changed, 179 insertions(+), 147 deletions(-)
create mode 100644 packages/client/src/components/DataTable/index.ts
diff --git a/client/src/components/Conversations/Convo.tsx b/client/src/components/Conversations/Convo.tsx
index 048c2f129d..2dd936a718 100644
--- a/client/src/components/Conversations/Convo.tsx
+++ b/client/src/components/Conversations/Convo.tsx
@@ -132,7 +132,7 @@ export default function Conversation({ conversation, retainView, toggleNav }: Co
return (
{
- console.error('DataTable error:', error);
- showToast({
- message: localize('com_ui_unarchive_error'),
- severity: NotificationSeverity.ERROR,
- });
- },
- [showToast, localize],
- );
-
const flattenedConversations = useMemo(
() => data?.pages?.flatMap((page) => page?.conversations?.filter(Boolean) ?? []) ?? [],
[data?.pages],
@@ -259,7 +248,8 @@ export default function ArchivedChatsTable() {
);
},
meta: {
- className: 'min-w-[150px] flex-1',
+ width: 65,
+ className: 'min-w-[150px]',
},
enableSorting: true,
},
@@ -279,8 +269,9 @@ export default function ArchivedChatsTable() {
return formatDate(convo.createdAt?.toString() ?? '', isSmallScreen);
},
meta: {
- className: 'w-32 sm:w-40',
- // desktopOnly: true, // Potential future use
+ width: 20,
+ className: 'min-w-[6rem]',
+ desktopOnly: true,
},
enableSorting: true,
},
@@ -298,13 +289,13 @@ export default function ArchivedChatsTable() {
const isRowUnarchiving = unarchivingId === convo.conversationId;
return (
-
+
{
const conversationId = convo.conversationId;
if (!conversationId) return;
@@ -322,7 +313,7 @@ export default function ArchivedChatsTable() {
render={