diff --git a/apps/web/app/components/chat-panel.tsx b/apps/web/app/components/chat-panel.tsx index baea1eaf50c..6e9c5a523ba 100644 --- a/apps/web/app/components/chat-panel.tsx +++ b/apps/web/app/components/chat-panel.tsx @@ -2103,7 +2103,7 @@ export const ChatPanel = forwardRef( const inputBarContainer = (onDragOverHandler: React.DragEventHandler, onDragLeaveHandler: React.DragEventHandler, onDropHandler: React.DragEventHandler) => (
({ setColumnVisibility(initialColumnVisibility ?? {}); }, [initialColumnVisibility]); const [internalRowSelection, setInternalRowSelection] = useState>({}); - const [showColumnsMenu, setShowColumnsMenu] = useState(false); const [stickyFirstColumn, setStickyFirstColumn] = useState(stickyFirstProp); const [isScrolled, setIsScrolled] = useState(false); const [pagination, setPagination] = useState({ pageIndex: 0, pageSize: defaultPageSize }); - const columnsMenuRef = useRef(null); const scrollContainerRef = useRef(null); const rowSelectionState = externalRowSelection !== undefined ? externalRowSelection : internalRowSelection; @@ -262,19 +268,6 @@ export function DataTable({ setIsScrolled(e.currentTarget.scrollLeft > 0); }, []); - // Close columns menu on click outside - useEffect(() => { - function handleClick(e: MouseEvent) { - if (columnsMenuRef.current && !columnsMenuRef.current.contains(e.target as Node)) { - setShowColumnsMenu(false); - } - } - if (showColumnsMenu) { - document.addEventListener("mousedown", handleClick); - return () => document.removeEventListener("mousedown", handleClick); - } - }, [showColumnsMenu]); - // Build selection column const selectionColumn: ColumnDef | null = enableRowSelection ? { @@ -394,13 +387,13 @@ export function DataTable({
{/* Toolbar */}
{title && ( -
+
{titleIcon} - + {title}
@@ -408,8 +401,8 @@ export function DataTable({ {/* Search */} {enableGlobalFilter && ( -
- +
+ ({ onServerSearch?.(e.target.value); }} placeholder={searchPlaceholder} - className="w-full pl-9 pr-3 py-1.5 text-xs rounded-full outline-none" + className="w-full pl-8 pr-3 py-1 text-xs rounded-md outline-none" style={{ - background: "var(--color-surface-hover)", + background: "var(--color-surface)", color: "var(--color-text)", border: "1px solid var(--color-border)", }} @@ -431,10 +424,10 @@ export function DataTable({ )}
@@ -454,98 +447,54 @@ export function DataTable({ {toolbarExtra} - {/* Refresh */} - {onRefresh && ( - - )} - {/* Columns menu */} -
- - {showColumnsMenu && ( -
+ + setStickyFirstColumn((v) => !v)} > - {/* Sticky first col toggle */} - - {visibleColumns.length === 0 ? ( -
- No toggleable columns -
- ) : ( - table.getAllLeafColumns() - .filter((c) => c.id !== "select" && c.id !== "actions" && c.getCanHide()) - .map((column) => ( - - )) - )} -
- )} -
+ Freeze first column + + + {visibleColumns.length === 0 ? ( +
No toggleable columns
+ ) : ( + table.getAllLeafColumns() + .filter((c) => c.id !== "select" && c.id !== "actions" && c.getCanHide()) + .map((column) => ( + column.toggleVisibility(!column.getIsVisible())} + > + {typeof column.columnDef.header === "string" + ? column.columnDef.header + : String((column.columnDef.meta as Record | undefined)?.label ?? column.id)} + + )) + )} + + {/* Add button */} {onAdd && ( - {open && ( -
- {actions.map((action, i) => ( - - ))} -
- )} -
+ + + {actions.map((action, i) => ( + action.onClick?.(row)} + > + {action.icon} + {action.label} + + ))} + + ); } diff --git a/apps/web/app/components/workspace/view-type-switcher.tsx b/apps/web/app/components/workspace/view-type-switcher.tsx index 9700d42fc69..05f39ea6a9b 100644 --- a/apps/web/app/components/workspace/view-type-switcher.tsx +++ b/apps/web/app/components/workspace/view-type-switcher.tsx @@ -76,10 +76,7 @@ type ViewTypeSwitcherProps = { export function ViewTypeSwitcher({ value, onChange }: ViewTypeSwitcherProps) { return ( -
+
{VIEW_TYPES.map((vt) => { const meta = VIEW_TYPE_META[vt]; const Icon = meta.icon; @@ -89,11 +86,11 @@ export function ViewTypeSwitcher({ value, onChange }: ViewTypeSwitcherProps) { key={vt} type="button" onClick={() => onChange(vt)} - className="flex items-center gap-1 px-2.5 py-1.5 text-[11px] transition-colors" + className="flex items-center gap-1.5 px-2.5 py-1 text-[12px] rounded-md transition-colors cursor-pointer" style={{ - background: isActive ? "var(--color-accent)" : "var(--color-surface)", - color: isActive ? "#fff" : "var(--color-text-muted)", - borderRight: vt !== "list" ? "1px solid var(--color-border)" : undefined, + background: isActive ? "var(--color-surface-hover)" : "transparent", + color: isActive ? "var(--color-text)" : "var(--color-text-muted)", + fontWeight: isActive ? 500 : 400, }} title={meta.label} >