@rebasepro/app 0.16.0 → 0.16.1-canary.g767fc35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -2922,7 +2922,26 @@ function useDataTableController({ path, collection, scrollRestoration, entitiesD
2922
2922
  const [dataLoading, setDataLoading] = useState(false);
2923
2923
  const [dataLoadingError, setDataLoadingError] = useState();
2924
2924
  const [noMoreToLoad, setNoMoreToLoad] = useState(false);
2925
- const clearFilter = useCallback(() => setFilterValues(fixedFilter ?? defaultFilter ?? void 0), [fixedFilter, defaultFilter]);
2925
+ /**
2926
+ * Clear the user's filters. `fixedFilter` survives — it is the collection
2927
+ * forcing a scope, not something the user chose — but `defaultFilter` does
2928
+ * not: a default is where the view *opens*, not a floor it can never go
2929
+ * below.
2930
+ *
2931
+ * It used to reset to `defaultFilter`, which made "clear" unable to clear
2932
+ * whenever a collection defined one, and every caller here wanted the
2933
+ * opposite. `ClearFilterSortButton` is labelled "clear filter" and left one
2934
+ * set. `EditorCollectionActionStart` calls this and then re-applies
2935
+ * `collection.defaultFilter` on the next line — redundant under the old
2936
+ * behaviour, and the clearest statement of what it expected.
2937
+ * `FilterPresetsButton` documents "clearing all filters deactivates all
2938
+ * chips", which was false: it derives a chip's active state from the
2939
+ * filters, so a preset whose values equalled `defaultFilter` switched
2940
+ * itself straight back on. That chip could not be turned off at all — click
2941
+ * it, the keys are removed, the filter resets to the identical default, and
2942
+ * the chip lights up again.
2943
+ */
2944
+ const clearFilter = useCallback(() => setFilterValues(fixedFilter ?? void 0), [fixedFilter]);
2926
2945
  const updateFilterValues = useCallback((updatedFilter) => {
2927
2946
  if (fixedFilter) {
2928
2947
  console.warn("Filter is not compatible with the force filter. Ignoring filter");