Skip to content

Self-hosted homelab infrastructure visualizer — interactive network diagram with live status monitoring

feat: reduce snap grid from 16px to 8px for finer node positioning

Pouzor00d44abfad46
diff --git a/frontend/src/components/canvas/CanvasContainer.tsx b/frontend/src/components/canvas/CanvasContainer.tsx
index 997aa8f..5c80571 100644
--- a/frontend/src/components/canvas/CanvasContainer.tsx
+++ b/frontend/src/components/canvas/CanvasContainer.tsx
@@ -90,7 +90,7 @@ export function CanvasContainer({ onConnect: onConnectProp, onEdgeDoubleClick, o
selectionMode={SelectionMode.Partial}
multiSelectionKeyCode={['Meta', 'Control']}
snapToGrid
- snapGrid={[16, 16]}
+ snapGrid={[8, 8]}
colorMode={theme.colors.reactFlowColorMode}
elevateNodesOnSelect={false}
connectionMode={ConnectionMode.Loose}
diff --git a/frontend/src/components/canvas/__tests__/CanvasContainer.test.tsx b/frontend/src/components/canvas/__tests__/CanvasContainer.test.tsx
index 721e588..a80ced1 100644
--- a/frontend/src/components/canvas/__tests__/CanvasContainer.test.tsx
+++ b/frontend/src/components/canvas/__tests__/CanvasContainer.test.tsx
@@ -142,9 +142,9 @@ describe('CanvasContainer', () => {
expect(rfProps.snapToGrid).toBe(true)
})
- it('sets snapGrid to [16, 16]', () => {
+ it('sets snapGrid to [8, 8]', () => {
render(<CanvasContainer />)
- expect(rfProps.snapGrid).toEqual([16, 16])
+ expect(rfProps.snapGrid).toEqual([8, 8])
})
// ── Delete key ────────────────────────────────────────────────────────────