codeant-ai-for-open-source[bot] commented on code in PR #37445:
URL: https://github.com/apache/superset/pull/37445#discussion_r2792821254
##########
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/ConfigModalSidebar/ConfigModalSidebar.tsx:
##########
@@ -100,8 +113,105 @@ const ConfigModalSidebar: FC<ConfigModalSidebarProps> = ({
restoreItem,
onCollapseChange,
onCrossListDrop,
+ formValuesVersion,
itemTitles,
}) => {
+ const [isDragging, setIsDragging] = useState(false);
+
+ const sensor = useSensor(PointerSensor, {
+ activationConstraint: { distance: 10 },
+ });
+
+ const handleDragStart = useCallback(() => {
+ setIsDragging(true);
+ }, []);
+
+ const handleDragEnd = useCallback(
+ (event: DragEndEvent) => {
+ const { active, over } = event;
+
Review Comment:
**Suggestion:** The `isDragging` state is set to true on drag start but
never reset to false on drag end, so after the first successful drag the
sidebar remains in a "dragging" visual state (e.g., collapse content overflow
stays hidden) and can break scrolling and layout until the component is
remounted. [logic error]
<details>
<summary><b>Severity Level:</b> Critical 🚨</summary>
```mdx
- ❌ Filter config sidebar becomes unscrollable after first drag.
- ⚠️ Users cannot access filters beyond visible viewport.
```
</details>
```suggestion
setIsDragging(false);
```
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Open a dashboard and launch the native filters configuration sidebar,
which renders
`ConfigModalSidebar`
(`superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/ConfigModalSidebar/ConfigModalSidebar.tsx`).
2. Start dragging any filter title within the sidebar; this triggers the
`DndContext`
`onDragStart` handler wired to `handleDragStart` (lines ~125–127), which
calls
`setIsDragging(true)`.
3. Drop the filter to complete the drag; `DndContext` calls `handleDragEnd`
(lines
129–209), which performs reordering / cross-list logic but never calls
`setIsDragging(false)` on successful drags.
4. Observe that `StyledCollapse` (lines ~47–58) now always receives
`isDragging={true}`,
so its `.ant-collapse-content-box` has `overflow: hidden`; the
filters/customizations list
in the config sidebar can no longer scroll after the first successful drag
until the
component is remounted.
```
</details>
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:**
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/ConfigModalSidebar/ConfigModalSidebar.tsx
**Line:** 132:132
**Comment:**
*Logic Error: The `isDragging` state is set to true on drag start but
never reset to false on drag end, so after the first successful drag the
sidebar remains in a "dragging" visual state (e.g., collapse content overflow
stays hidden) and can break scrolling and layout until the component is
remounted.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F37445&comment_hash=b2a15428d4a1ff8977b31c8362d1d6d58a3d57ffaa8b76d2f8ea4b4f9847464d&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F37445&comment_hash=b2a15428d4a1ff8977b31c8362d1d6d58a3d57ffaa8b76d2f8ea4b4f9847464d&reaction=dislike'>👎</a>
--
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]