The arrow that unbound half of wire(), and openings for the unit's top

Eric: styled buttons look great, but edit-description does nothing.
One missing character — .forEach(b = instead of (b => — turned the
callback into a strict-mode ReferenceError that killed wire() midway:
everything bound before the typo (rename, duplicate) worked,
everything after (edit description, its save, the add-opening submit)
silently never bound, and the throw hid inside an async refresh where
no pageerror fires. Fixed and verified live: description edits save,
add-opening works again.

And Eric's next question answered in code: things live ON the
furniture too. The add-opening form gains an "at the top" checkbox —
new openings (or whole grids) land above the existing rows instead of
below, so "on top of the Kallax" is one labeled opening away. Give it
real width/depth and the height to your ceiling, or no sizes for a
no-limit display spot.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016jXZFSTZQKzAC8fqpWSz9g
This commit is contained in:
Eric Wagoner
2026-08-09 15:22:56 -04:00
co-authored by Claude Fable 5
parent 2f526335e8
commit 4ce7706521
5 changed files with 95 additions and 3 deletions
+31
View File
@@ -978,3 +978,34 @@ def test_rename_unit_keeps_openings_locations_and_description(tmp_path):
).status_code
== 409
)
def test_add_openings_at_top(tmp_path):
"""Things live ON the furniture too: an opening added at_top lands
above the existing rows and renders first in the wall diagram."""
web, cfg = _web(tmp_path, {})
web.post("/api/furniture/add-unit", json={"name": "Kallax"})
web.post(
"/api/furniture/add-openings",
json={
"unit": "Kallax",
"rows": 2,
"cols": 2,
"width_in": 13.25,
"height_in": 13.25,
"depth_in": 15.4,
},
)
web.post(
"/api/furniture/add-openings",
json={
"unit": "Kallax",
"label": "on top",
"zone": "display",
"at_top": True,
},
)
labels = [
o["label"] for o in web.get("/api/shelves").json()["units"][0]["openings"]
]
assert labels == ["on top", "A1", "A2", "B1", "B2"]