diff --git a/client/src/components/Nav/SettingsTabs/General/ArchivedChats.tsx b/client/src/components/Nav/SettingsTabs/General/ArchivedChats.tsx index f5e79a61f9..2c351a50b8 100644 --- a/client/src/components/Nav/SettingsTabs/General/ArchivedChats.tsx +++ b/client/src/components/Nav/SettingsTabs/General/ArchivedChats.tsx @@ -248,8 +248,7 @@ export default function ArchivedChatsTable() { ); }, meta: { - width: 65, - className: 'min-w-[150px]', + className: 'min-w-[150px] flex-1', }, enableSorting: true, }, @@ -269,8 +268,7 @@ export default function ArchivedChatsTable() { return formatDate(convo.createdAt?.toString() ?? '', isSmallScreen); }, meta: { - width: 20, - className: 'min-w-[6rem]', + className: 'w-32 sm:w-40', desktopOnly: true, }, enableSorting: true, @@ -328,8 +326,7 @@ export default function ArchivedChatsTable() { ); }, meta: { - width: 30, - className: 'min-w-[5rem]', + className: 'w-24', }, enableSorting: false, }, @@ -363,8 +360,8 @@ export default function ArchivedChatsTable() { debounce: 300, }, selection: { - enableRowSelection: true, - showCheckboxes: true, + enableRowSelection: false, + showCheckboxes: false, }, }} filterValue={searchValue} diff --git a/packages/client/src/components/DataTable/DataTable.tsx b/packages/client/src/components/DataTable/DataTable.tsx index b2e193feea..088c327907 100644 --- a/packages/client/src/components/DataTable/DataTable.tsx +++ b/packages/client/src/components/DataTable/DataTable.tsx @@ -527,9 +527,15 @@ function DataTable, TValue>({ const metaWidth = (header.column.columnDef.meta as { width?: number } | undefined) ?.width; const widthStyle = isSelectHeader - ? { width: '32px', maxWidth: '32px' } + ? { width: '32px', maxWidth: '32px', minWidth: '32px' } : metaWidth && metaWidth >= 1 && metaWidth <= 100 - ? { width: `${metaWidth}%`, maxWidth: `${metaWidth}%` } + ? { + width: `${metaWidth}%`, + maxWidth: `${metaWidth}%`, + minWidth: isSmallScreen + ? `${Math.max(metaWidth * 0.8, 60)}px` + : `${metaWidth}%`, + } : {}; return ( > { const TableRowComponent = >( { row, virtualIndex, style, selected }: TableRowComponentProps, ref: React.Ref, -) => ( - - {row.getVisibleCells().map((cell) => { - const meta = cell.column.columnDef.meta as - | { className?: string; desktopOnly?: boolean; width?: number } - | undefined; - const isDesktopOnly = meta?.desktopOnly; - const percent = meta?.width; - const widthStyle = - cell.column.id === 'select' - ? { width: '32px', maxWidth: '32px' } - : percent && percent >= 1 && percent <= 100 - ? { width: `${percent}%`, maxWidth: `${percent}%` } - : undefined; +) => { + // Check if we're on mobile - use window.innerWidth for component-level check + const isSmallScreen = typeof window !== 'undefined' && window.innerWidth < 768; - return ( - - {flexRender(cell.column.columnDef.cell, cell.getContext())} - - ); - })} - -); + return ( + + {row.getVisibleCells().map((cell) => { + const meta = cell.column.columnDef.meta as + | { className?: string; desktopOnly?: boolean; width?: number } + | undefined; + const isDesktopOnly = meta?.desktopOnly; + const percent = meta?.width; + const widthStyle = + cell.column.id === 'select' + ? { width: '32px', maxWidth: '32px', minWidth: '32px' } + : percent && percent >= 1 && percent <= 100 + ? { + width: `${percent}%`, + maxWidth: `${percent}%`, + minWidth: isSmallScreen ? `${Math.max(percent * 0.8, 60)}px` : `${percent}%`, + } + : undefined; + + return ( + + {flexRender(cell.column.columnDef.cell, cell.getContext())} + + ); + })} + + ); +}; type ForwardTableRowComponentType = >( props: TableRowComponentProps & React.RefAttributes,