fix(grid): persist visual table filters across restart

This commit is contained in:
onenewcode authored and GitHub committed 2026-09-11 16:56:50 +08:00
1 parent 19be861c49
commit 8f29273653
3 files changed
+271 -16

No files matched your search

@@ -1496,9 +1496,11 @@ function loadStructuredFilterStateForScope() {
const cacheKey = structuredFilterCacheKey.value;
const scopeKey = structuredFilterScopeKey.value;
structuredFilterRules.value = cloneDataGridStructuredFilterRules(cached.rules);
whereFilterInput.value = cached.manualWhereInput;
appliedStructuredWhereInput.value = cached.appliedWhereInput;
serverColumnFilters.value = structuredClone(cached.serverColumnFilters ?? {});
appliedStructuredWhereInput.value = "";
// Restore the applied SQL before the manual input so the whereInput watcher
// emits the combined condition instead of a brief empty WHERE (#8831).
whereFilterInput.value = cached.manualWhereInput;
void buildStructuredWhereFromRules(structuredFilterRules.value)
.then((whereInput) => {
if (requestId !== structuredFilterHydrationRequestId || structuredFilterCacheKey.value !== cacheKey || structuredFilterScopeKey.value !== scopeKey) return;
@@ -1521,7 +1523,6 @@ function loadStructuredFilterStateForScope() {
appliedStructuredWhereInput.value = "";
serverColumnFilters.value = {};
structuredFilterRules.value = filterBuilderColumnOptions.value.length > 0 ? [defaultStructuredFilterRule()] : [];
persistStructuredFilterState();
markConditionInputsApplied();
structuredFilterHydrationReady.value = true;
}