Floorplan image import (opacity, scale calibration, lock & aspect controls) - #7
Open
ecarlson88 wants to merge 1 commit into
Open
Floorplan image import (opacity, scale calibration, lock & aspect controls)#7ecarlson88 wants to merge 1 commit into
ecarlson88 wants to merge 1 commit into
Conversation
…pect controls Introduce a reusable `image` ReactFlow node type for importing floorplan/ reference images on the main schematic canvas and on a new dedicated "Floorplan" page type. - New `image` node (ImageNode): renders an <img> with adjustable opacity, drag to move, NodeResizer to resize, sits behind devices (zIndex -10). - Image Properties modal (ImagePropertiesEditor): opacity slider (mirrors annotation properties), scale calibration sub-modal (draw a line across a known distance to derive pixels-per-unit), lock-aspect-ratio toggle, and lock-position toggle. - Aspect ratio: persistent lock-aspect toggle plus hold-Shift during resize for a temporary constraint (reuses a global shiftHeld flag; no new keybind). - Lock position: mirrors the existing room lock (pinned, non-draggable, handles hidden, pane clicks pass through). - New Floorplan page type: its own isolated ReactFlow canvas storing its own node array; full tab support (add/rename/duplicate/delete) in PageTabs. - Image import util (imageImport.ts): FileReader + canvas downscale, returns natural dimensions; wired into the Insert menu (schematic) and an Add Image button (floorplan). - Exclude image nodes from edge-routing obstacles so backgrounds don't block connections. https://claude.ai/code/session_01JucvboMYPT8ppBUUsVsyXy
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.
Description
Re-applies the floorplan/reference-image import on top of the current upstream
master(02728eb), after the fork was re-synced and the previous commits were discarded.The feature itself is unchanged:
ImageNode), with drag +NodeResizer.Rebase notes
38 upstream commits landed since this feature's previous base, including two changes that are structurally parallel to it — a new
patch-panelpage type and a newTextStubNode. Conflicts were resolved to keep both sides, not to pick one:types.ts—SchematicNodenow carries bothTextStubNodeandImageNode;SchematicPageisRackElevationPage | PrintSheetPage | PatchPanelViewPage | FloorplanPage.store.ts— kept bothmapFloorplanPageand upstream'sstripDeadHops; kept bothpatch-panelandfloorplanguards insyncRackCounters(neither page type has.racks); took upstream's early-return form in the rack-move path.App.tsx/PageTabs.tsx— both the patch-bay and floorplan branches coexist across the render ternary, rename, delete, duplicate, and the add-page buttons.One fix worth calling out: the tab-variant computation had auto-merged into two half-complete versions side by side (upstream's covered
print | patch | rack, this feature's coveredprint | floorplan | rack), so neither handled all four page types. These were collapsed into a singleTabVariantcomputation covering all four, withtabClassswitched to a palette-map lookup — upstream's skypatchcolors and this feature's tealfloorplancolors are both preserved, so no styling changes.Testing
Full local CI-equivalent, all green:
npm run build(incl.tsc -b) — passesnpm run lint— 0 errors (3 warnings, all pre-existing upstream indevices/andDeviceEditor.tsx)npm test— 525 tests across 52 files passnpm run routing:check— 13/13 fixturesok (no changes), no baseline driftnpm run reports:check— 2/2 fixtures OKScreenshots
Generated by Claude Code