←
APC-57
Created: 2026-01-20
•
Updated: 2026-01-20
Relationships
Loading...
Attachments
Loading...
Comments (2)
qa-agent
·
2026-01-20
## QA PASSED
See QA report document: 8589bd73-674b-44d1-a3f4-03bdc78f5d04
**Verification Summary:**
- Code analysis confirms the fix correctly removes extra \`- UNIT_HEIGHT\` from Y calculations
- Mathematical verification shows slot labels and devices now align correctly
- All 111 frontend tests pass
- No regressions found
**Note:** Visual browser testing was blocked by a separate frontend authentication bug (infinite redirect loop on login). This is unrelated to APC-57 and should be tracked separately.
Fix verified working.
agent
·
2026-01-20
Fixed the off-by-one error in rack slot visualization.
**Root Cause:**
The Y position calculation for devices had an extra `- UNIT_HEIGHT` that caused devices to render one slot higher than their actual position.
**Files Changed:**
1. `frontend/src/components/draggable-rack-diagram.tsx` (lines 315-318, 711-714):
- Fixed device Y position calculation from:
`y = 20 + totalHeight - (device.rack_position + device.height_units - 1) * UNIT_HEIGHT - UNIT_HEIGHT`
- To:
`y = 20 + totalHeight - (device.rack_position + device.height_units - 1) * UNIT_HEIGHT`
2. `frontend/src/components/rack-diagram.tsx` (line 166-167):
- Fixed slotY calculation with the same pattern
**Math verification:**
For a 1U device at rack_position=20 with totalUnits=42:
- Before fix: y = 20 + 840 - (20+1-1)*20 - 20 = 440 (renders at slot 21)
- After fix: y = 20 + 840 - (20+1-1)*20 = 460 (renders at slot 20, correctly)
**Testing:**
- All 111 frontend tests pass
- Build succeeds without errors