diff --git a/src/widgets/DataGrid/DataGrid.tsx b/src/widgets/DataGrid/DataGrid.tsx index 098d4e93..f95baea2 100644 --- a/src/widgets/DataGrid/DataGrid.tsx +++ b/src/widgets/DataGrid/DataGrid.tsx @@ -35,13 +35,13 @@ const DataGrid: Widget = () => { const [scrollbarWidth] = getScrollbarSize(); - const defaultVisibleColumnKeys = useMemo( - () => - allColumns - .filter((column) => columnVisibleByDefault(column)) - .map(({ key }) => key), - [allColumns] - ); + const defaultVisibleColumnKeys = useMemo(() => { + const visibleColumnKeys = allColumns + .filter((column) => columnVisibleByDefault(column)) + .map(({ key }) => key); + if (visibleColumnKeys.length) return visibleColumnKeys; + return allColumns.filter((col) => !col.hidden).map(({ key }) => key); + }, [allColumns]); const [tableView, setTableView] = useWidgetConfig('tableView', 'full'); const [visibleColumns, setVisibleColumns] = useWidgetConfig( diff --git a/src/widgets/Inspector/store.tsx b/src/widgets/Inspector/store.tsx index 4b3af284..75e33b8b 100644 --- a/src/widgets/Inspector/store.tsx +++ b/src/widgets/Inspector/store.tsx @@ -64,7 +64,11 @@ const StoreProvider = ({ children }: ProviderProps): JSX.Element => { const allColumns = useDataset((d) => d.columns); const lenses = useComponentsStore((d) => d.lensesByKey); const defaultLenses = useMemo(() => { - const defaultColumns = allColumns.filter((c) => c.type.binary && !c.hidden); + const visibleColumns = allColumns.filter( + (c) => !c.hidden && c.type.kind !== 'Embedding' + ); + const binaryColumns = visibleColumns.filter((c) => c.type.binary); + const defaultColumns = binaryColumns.length ? binaryColumns : visibleColumns; return _.compact( defaultColumns.map((column) => { const lens = Object.values(lenses).filter((lens) =>