@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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rebasepro/app",
3
3
  "type": "module",
4
- "version": "0.16.0",
4
+ "version": "0.16.1-canary.g767fc35",
5
5
  "description": "Rebase core — framework-agnostic runtime for data-driven admin panels",
6
6
  "funding": {
7
7
  "url": "https://github.com/sponsors/rebaseco"
@@ -52,12 +52,12 @@
52
52
  "magic-string": "^0.30.0",
53
53
  "notistack": "^3.0.2",
54
54
  "react-i18next": "^17.0.11",
55
- "@rebasepro/admin-types": "0.16.0",
56
- "@rebasepro/forms": "0.16.0",
57
- "@rebasepro/common": "0.16.0",
58
- "@rebasepro/types": "0.16.0",
59
- "@rebasepro/ui": "0.16.0",
60
- "@rebasepro/utils": "0.16.0"
55
+ "@rebasepro/admin-types": "0.16.1-canary.g767fc35",
56
+ "@rebasepro/forms": "0.16.1-canary.g767fc35",
57
+ "@rebasepro/common": "0.16.1-canary.g767fc35",
58
+ "@rebasepro/types": "0.16.1-canary.g767fc35",
59
+ "@rebasepro/ui": "0.16.1-canary.g767fc35",
60
+ "@rebasepro/utils": "0.16.1-canary.g767fc35"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "react": ">=19.2.7",
@@ -210,7 +210,26 @@ export function useDataTableController<M extends Record<string, any> = any, USER
210
210
  const [dataLoadingError, setDataLoadingError] = useState<Error | undefined>();
211
211
  const [noMoreToLoad, setNoMoreToLoad] = useState<boolean>(false);
212
212
 
213
- const clearFilter = useCallback(() => setFilterValues(fixedFilter ?? defaultFilter ?? undefined), [fixedFilter, defaultFilter]);
213
+ /**
214
+ * Clear the user's filters. `fixedFilter` survives — it is the collection
215
+ * forcing a scope, not something the user chose — but `defaultFilter` does
216
+ * not: a default is where the view *opens*, not a floor it can never go
217
+ * below.
218
+ *
219
+ * It used to reset to `defaultFilter`, which made "clear" unable to clear
220
+ * whenever a collection defined one, and every caller here wanted the
221
+ * opposite. `ClearFilterSortButton` is labelled "clear filter" and left one
222
+ * set. `EditorCollectionActionStart` calls this and then re-applies
223
+ * `collection.defaultFilter` on the next line — redundant under the old
224
+ * behaviour, and the clearest statement of what it expected.
225
+ * `FilterPresetsButton` documents "clearing all filters deactivates all
226
+ * chips", which was false: it derives a chip's active state from the
227
+ * filters, so a preset whose values equalled `defaultFilter` switched
228
+ * itself straight back on. That chip could not be turned off at all — click
229
+ * it, the keys are removed, the filter resets to the identical default, and
230
+ * the chip lights up again.
231
+ */
232
+ const clearFilter = useCallback(() => setFilterValues(fixedFilter ?? undefined), [fixedFilter]);
214
233
 
215
234
  const updateFilterValues = useCallback((updatedFilter: FilterValues<Extract<keyof M, string> | (string & {})> | undefined) => {
216
235
  if (fixedFilter) {