Claude at it again, fixing the rack diagram he broke himself - #26
Merged
AzertoxHDW merged 6 commits intoNov 20, 2025
Merged
Conversation
Created a shared rack-data.ts file to centralize rack device configuration, ensuring the rack diagram on infrastructure detail pages stays in sync with the main rack configuration page. Changes: - Created src/lib/rack-data.ts with shared RackDevice interfaces and configuration - Updated /rack page to import from shared data file - Updated /infra/[machineId] page to import from shared data file - Now both pages show consistent rack positions (e.g., Sierra at U6, TrueNAS at U8) This fixes the issue where the mini rack diagram on machine detail pages showed outdated/different positions than the main rack page.
Fixed two issues with the mini rack visualization on infrastructure detail pages: 1. Removed flex-col-reverse to display rack correctly (U18 at top, U1 at bottom) 2. Corrected device positioning logic to properly handle uPosition as the bottom U slot - Now correctly calculates device range: uPosition to (uPosition + uHeight - 1) - Properly renders multi-U devices and skips occupied slots - Fixed device detection to check if each U slot falls within device range The mini rack now accurately reflects the same layout as the main rack page.
Changed mini rack to display U1 at the top and U18 at the bottom: - Updated uNumber calculation from (TOTAL_U_SLOTS - i) to (i + 1) - Fixed device start detection to use d.uPosition directly - Now correctly displays racks with U1 at top, matching typical rack numbering This ensures the mini rack shows the proper orientation where lower U numbers appear at the top.
Changed d.uPosition to device.uPosition to fix ReferenceError. The variable 'd' only exists within the find() callback scope.
Changed the mini rack logic so uPosition represents the topmost (lowest U number) slot: - For a device at uPosition: 6 with uHeight: 4 - It now occupies U6, U7, U8, U9 (6 is at top) - Previously it was treating these values differently Updated calculations: - deviceTop = uPosition (now the start position) - deviceBottom = uPosition + uHeight - 1 - Render device at deviceTop position
Removed substring truncation to show complete device names. Added px-1 padding and truncate class for better text display.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.