Fix export view (#19117)

# PR Description

**Export view** command sent { id: { in: [] } } to the server, which
rejects empty arrays. It now falls back to the view's filters instead
when there is no selection, which is the intended behavior.

# Video QA

## Before


https://github.com/user-attachments/assets/3e6263f9-9c66-4f67-a81e-e0571652147d

## After


https://github.com/user-attachments/assets/977a366d-1936-457f-96a1-a5d4fb8ac98e
This commit is contained in:
Raphaël Bosi
2026-03-30 15:07:24 +02:00
committed by GitHub
parent 1109b89cd7
commit b8374f5531
@@ -92,7 +92,11 @@ export const useRecordIndexLazyFetchRecords = ({
recordIndexId,
);
const queryFilter = computeContextStoreFilters({
const isEmptySelection =
contextStoreTargetedRecordsRule.mode === 'selection' &&
contextStoreTargetedRecordsRule.selectedRecordIds.length === 0;
const contextStoreFilter = computeContextStoreFilters({
contextStoreTargetedRecordsRule,
contextStoreFilters,
contextStoreFilterGroups,
@@ -101,6 +105,10 @@ export const useRecordIndexLazyFetchRecords = ({
contextStoreAnyFieldFilterValue,
});
const queryFilter = isEmptySelection
? findManyRecordsParams.filter
: contextStoreFilter;
const visibleRecordFields = useAtomComponentSelectorValue(
visibleRecordFieldsComponentSelector,
recordIndexId,