diff --git a/apps/client/src/features/base/components/property/create-property-popover.tsx b/apps/client/src/features/base/components/property/create-property-popover.tsx index dea9d3882..33d87891e 100644 --- a/apps/client/src/features/base/components/property/create-property-popover.tsx +++ b/apps/client/src/features/base/components/property/create-property-popover.tsx @@ -234,7 +234,15 @@ export function CreatePropertyPopover({ baseId, properties, onPropertyCreated }: )} {panel === "configure" && selectedType === "formula" && ( - + + setName(e.currentTarget.value)} + /> > + >({ queryKey: ["base-rows", baseId] }); + let touchesCache = false; + outer: for (const [, data] of caches) { + if (!data) continue; + for (const page of data.pages) { + for (const row of page.items) { + if (updatedIds.has(row.id)) { + touchesCache = true; + break outer; + } + } + } + } + if (touchesCache) { + queryClient.invalidateQueries({ queryKey: ["base-rows", baseId] }); + } break; } case "base:formula:recompute:started": { diff --git a/apps/client/src/features/base/hooks/use-view-draft.ts b/apps/client/src/features/base/hooks/use-view-draft.ts index d9eb786c3..2bd4d3bb7 100644 --- a/apps/client/src/features/base/hooks/use-view-draft.ts +++ b/apps/client/src/features/base/hooks/use-view-draft.ts @@ -64,7 +64,14 @@ export function useViewDraft(args: UseViewDraftArgs): ViewDraftState { (next: FilterGroup | undefined) => { if (!ready) return; const current = storedDraft ?? null; - const mergedFilter = next; + // If the baseline has a filter, clearing to `undefined` would fall + // back to the baseline in effectiveFilter. Persist an empty AND-group + // instead so the draft explicitly overrides the baseline with no + // predicates. + const mergedFilter = + next === undefined && baselineFilter !== undefined + ? ({ op: "and", children: [] } as FilterGroup) + : next; const mergedSorts = current?.sorts; if (mergedFilter === undefined && (mergedSorts === undefined || mergedSorts === null)) { setDraft(RESET); @@ -76,7 +83,7 @@ export function useViewDraft(args: UseViewDraftArgs): ViewDraftState { updatedAt: new Date().toISOString(), }); }, - [ready, storedDraft, setDraft], + [ready, storedDraft, setDraft, baselineFilter], ); const setSorts = useCallback(