feat: Lead Master — column show/hide toggle, resizable table, remove dead filter/sort buttons

- ColumnToggle component with checkbox dropdown for column visibility
- useColumnVisibility hook for state management
- Campaign/Ad/FirstContact/Spam/Dups hidden by default (mostly empty)
- ResizableTableContainer wrapping Table for column resize support
- Column defaultWidth/minWidth props
- Removed non-functional Filter and Sort buttons

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-31 13:31:12 +05:30
parent c36802864c
commit 1e64760fd1
4 changed files with 175 additions and 60 deletions

View File

@@ -17,7 +17,9 @@ import {
Cell as AriaCell,
Collection as AriaCollection,
Column as AriaColumn,
ColumnResizer as AriaColumnResizer,
Group as AriaGroup,
ResizableTableContainer as AriaResizableTableContainer,
Row as AriaRow,
Table as AriaTable,
TableBody as AriaTableBody,
@@ -115,9 +117,9 @@ const TableRoot = ({ className, size = "md", ...props }: TableRootProps) => {
return (
<TableContext.Provider value={{ size: context?.size ?? size }}>
<div className="flex-1 overflow-auto min-h-0">
<AriaResizableTableContainer className="flex-1 overflow-auto min-h-0">
<AriaTable className={(state) => cx("w-full", typeof className === "function" ? className(state) : className)} {...props} />
</div>
</AriaResizableTableContainer>
</TableContext.Provider>
);
};
@@ -168,9 +170,10 @@ TableHeader.displayName = "TableHeader";
interface TableHeadProps extends AriaColumnProps, Omit<ThHTMLAttributes<HTMLTableCellElement>, "children" | "className" | "style" | "id"> {
label?: string;
tooltip?: string;
allowsResizing?: boolean;
}
const TableHead = ({ className, tooltip, label, children, ...props }: TableHeadProps) => {
const TableHead = ({ className, tooltip, label, children, allowsResizing, ...props }: TableHeadProps) => {
const { selectionBehavior } = useTableOptions();
return (
@@ -186,8 +189,8 @@ const TableHead = ({ className, tooltip, label, children, ...props }: TableHeadP
}
>
{(state) => (
<AriaGroup className="flex items-center gap-1">
<div className="flex items-center gap-1">
<AriaGroup className="flex items-center gap-1" role="presentation">
<div className="flex items-center gap-1 flex-1 min-w-0">
{label && <span className="text-xs font-semibold whitespace-nowrap text-quaternary">{label}</span>}
{typeof children === "function" ? children(state) : children}
</div>
@@ -206,6 +209,10 @@ const TableHead = ({ className, tooltip, label, children, ...props }: TableHeadP
) : (
<FontAwesomeIcon icon={faSort} className="text-fg-quaternary" />
))}
{allowsResizing && (
<AriaColumnResizer className="absolute top-0 right-0 bottom-0 w-1 cursor-col-resize bg-transparent hover:bg-brand data-[resizing]:bg-brand" />
)}
</AriaGroup>
)}
</AriaColumn>