codeant-ai-for-open-source[bot] commented on code in PR #44216:
URL: https://github.com/apache/superset/pull/44216#discussion_r4001469231


##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/useFilterControlFactory.tsx:
##########
@@ -37,9 +39,26 @@ export const useFilterControlFactory = (
   onClearAllComplete?: (filterId: string) => void,
 ) => {
   const filters = useFilters();
+  const dashboardLayout = useSelector<RootState, DashboardLayout>(
+    state => state.dashboardLayout?.present || {},
+  );
+
+  const canvasFilterIds = useMemo(() => {
+    const ids = new Set<string>();
+    Object.values(dashboardLayout).forEach(item => {
+      if (item?.type === FILTER_TYPE && item?.meta?.filterId) {
+        ids.add(String(item.meta.filterId));
+      }
+    });
+    return ids;
+  }, [dashboardLayout]);
+
   const filterValues = useMemo(
-    () => Object.values(filters) as (Filter | Divider)[],
-    [filters],
+    () =>
+      (Object.values(filters) as (Filter | Divider)[]).filter(
+        filter => isFilterDivider(filter) || !canvasFilterIds.has(filter.id),
+      ),

Review Comment:
   ✅ **Customized review instruction saved!**
   
   **Instruction:**
   > Do not flag excluding canvas-bound filters from the FilterBar or omitting 
deleted filters; Redux nativeFilters.filters contains only active, configured 
filters, and deleted filters are intentionally absent.
   
   **Applied to:**
     - 
`superset-frontend/src/dashboard/components/nativeFilters/FilterBar/useFilterControlFactory.tsx`
   
   ---
   💡 *To manage or update this instruction, visit: [CodeAnt AI 
Settings](https://app.codeant.ai/org/settings/learnings)*



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to