refactor(rack-planner): lift port config modal state to root level to avoid rendering issues within transformed modules

This commit is contained in:
2026-03-22 15:04:53 -05:00
parent e2c5cad8a3
commit 5de001c630
3 changed files with 18 additions and 17 deletions
+10 -1
View File
@@ -18,6 +18,7 @@ import { RackColumn } from './RackColumn';
import { DevicePalette } from './DevicePalette';
import { ConnectionLayer } from './ConnectionLayer';
import { AddModuleModal } from '../modals/AddModuleModal';
import { PortConfigModal } from '../modals/PortConfigModal';
import { RackSkeleton } from '../ui/Skeleton';
import type { ModuleType } from '../../types';
import { MODULE_TYPE_COLORS, MODULE_TYPE_LABELS } from '../../lib/constants';
@@ -85,7 +86,7 @@ const POINTER_SENSOR_OPTIONS = {
};
export function RackPlanner() {
const { racks, loading, fetchRacks, moveModule } = useRackStore();
const { racks, loading, fetchRacks, moveModule, activeConfigPortId, setActiveConfigPortId } = useRackStore();
const canvasRef = useRef<HTMLDivElement>(null);
// Drag state
@@ -295,6 +296,14 @@ export function RackPlanner() {
initialType={pendingDrop.type}
/>
)}
{activeConfigPortId && (
<PortConfigModal
open={!!activeConfigPortId}
portId={activeConfigPortId}
onClose={() => setActiveConfigPortId(null)}
/>
)}
</DndContext>
);
}