fix: address code review findings for React Flow UI integration
- Use screenToFlowPosition() for drop coordinates (fixes zoom/pan bug) - Remove duplicate selection border from DeviceNode (BaseNode handles it) - Add w-full to GroupNode for proper container sizing - Remove unused 'selected' destructuring from DeviceNode Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -25,7 +25,7 @@ function TooltipRow({ label, value }: { label: string; value: string | null | un
|
||||
)
|
||||
}
|
||||
|
||||
function DeviceNodeComponent({ data, selected }: NodeProps) {
|
||||
function DeviceNodeComponent({ data }: NodeProps) {
|
||||
const nodeData = data as unknown as DeviceNodeData
|
||||
const { icon: Icon, color } = getDeviceRenderConfig(nodeData.deviceType, nodeData.category)
|
||||
const status = (nodeData.properties?.status || 'unknown') as NodeStatus
|
||||
@@ -38,7 +38,7 @@ function DeviceNodeComponent({ data, selected }: NodeProps) {
|
||||
<NodeStatusIndicator status={status}>
|
||||
<NodeTooltip>
|
||||
<NodeTooltipTrigger>
|
||||
<BaseNode className={`min-w-[120px] group ${selected ? 'border-accent' : ''}`}>
|
||||
<BaseNode className="min-w-[120px] group">
|
||||
<BaseNodeHeader className="flex-col gap-1 items-center py-3 px-4">
|
||||
<Icon size={28} style={{ color }} />
|
||||
<BaseNodeHeaderTitle className="text-center text-xs">
|
||||
|
||||
@@ -45,7 +45,7 @@ export function GroupNode({ data, selected }: NodeProps) {
|
||||
return (
|
||||
<BaseNode
|
||||
className={cn(
|
||||
'h-full min-h-[200px] min-w-[300px] overflow-hidden rounded-lg bg-elevated/30 border-default/50',
|
||||
'h-full w-full min-h-[200px] min-w-[300px] overflow-hidden rounded-lg bg-elevated/30 border-default/50',
|
||||
selected && 'border-accent',
|
||||
)}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user