bito-code-review[bot] commented on code in PR #41879:
URL: https://github.com/apache/superset/pull/41879#discussion_r3544059118
##########
superset-frontend/src/explore/components/ExploreContainer/ExploreDndContext.tsx:
##########
@@ -229,6 +266,30 @@ export const ExploreDndContextProvider:
FC<ExploreDndContextProps> = ({
</ActiveDragContext.Provider>
</DraggingContext.Provider>
</DropzoneContext.Provider>
+ {/*
+ @dnd-kit has no native drag image (unlike react-dnd's HTML5 backend),
+ so the item following the cursor must be rendered explicitly here.
+ Reorder drags leave activeData null on purpose, so only external
+ DatasourcePanel drags (which carry a value) get a preview.
+ */}
+ <DragOverlay dropAnimation={null}>
+ {activeData?.value ? (
+ <DragOverlayContainer align="center" justify="space-between">
+ {activeData.type === DndItemType.Column ? (
+ <StyledColumnOption
+ column={activeData.value as ColumnOptionProps['column']}
+ showType
+ />
+ ) : (
+ <StyledMetricOption
+ metric={activeData.value as MetricOptionProps['metric']}
+ showType
+ />
+ )}
+ <Icons.Drag iconSize="xl" />
+ </DragOverlayContainer>
+ ) : null}
+ </DragOverlay>
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Missing test coverage for DragOverlay</b></div>
<div id="fix">
The new DragOverlay drag-preview feature has no test coverage in
`ExploreDndContext.test.tsx`. While the implementation is correct (verified
`ColumnOptionProps`/`MetricOptionProps` support `showType`, `Flex` supports
`align`/`justify`, `dropAnimation={null}` disables animation per @dnd-kit
docs), missing tests could allow this functionality to break unnoticed during
future refactoring.
</div>
</div>
<small><i>Code Review Run #a67fbb</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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]