Polygon creation workflow is unfinished and relies on global state #2
Labels
No labels
bug
documentation
enhancement
in-progress
test
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/kimi_agent_home_assistant#2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem: The polygon tool in
src/components/editor/FloorplanCanvas.tsxstores clicked points inpolygonPoints, but finalizing the polygon uses awindow.__pendingPolyglobal hack and does not correctly update the newly created room shape. The parentApp.tsxpasses anonAddRoomcallback that returns a room ID but then tries to set polygon shape viasetTimeoutandupdateShape, which is fragile and may race.Files to modify:
src/components/editor/FloorplanCanvas.tsxsrc/hooks/useFloorplan.ts(optional: add anaddPolygonRoomhelper)Acceptance criteria:
window.__pendingPolyusage entirely.polygonPointsinto a room withtype: polygon.polygonPointsafter creating the room.Fixed in
1c0a244. The polygon double-click handler now passes the finished polygon shape directly to onAddRoom. Removed the dummy zero-size rect, the window.__pendingPoly global, and the App-side setTimeout shape-swap; double-click includes the final vertex. Verified in the browser: 4 clicks create a polygon room with the correct points, the tool auto-returns to Select, and __pendingPoly is never set.