SelectionManager: route furnish-category registry kinds through furnish phase

Shelf clicks in 3D weren't selecting: getSelectionTarget routed shelf
(category='furnish') to the furnish phase, but furnish.isValid hard-
coded `node.type !== 'item'` and rejected shelf. Click switched phase,
nothing selected.

Fix: extend furnish.isValid to also accept registry-driven kinds whose
def.category === 'furnish' AND def.capabilities.selectable. Item's
asset.category door/window special-case stays first.

Future furnish-category kinds (tables, lamps, etc.) are selectable in
furnish phase without further changes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Wassim SAMAD
2026-05-15 17:03:22 -04:00
co-authored by Claude Opus 4.7
parent 9aec943740
commit 95645d8e37
@@ -684,9 +684,19 @@ const SELECTION_STRATEGIES: Record<string, SelectionStrategy> = {
},
isValid: (node) => {
if (!isNodeInCurrentLevel(node)) return false
if (node.type !== 'item') return false
const item = node as ItemNode
return item.asset.category !== 'door' && item.asset.category !== 'window'
// Item: door/window-category items belong to structure phase, not furnish.
if (node.type === 'item') {
const item = node as ItemNode
return item.asset.category !== 'door' && item.asset.category !== 'window'
}
// Registry-driven kinds with `category: 'furnish'` (shelf today,
// future furniture kinds): selectable in furnish phase if their
// definition declares the `selectable` capability. Without this
// branch, shelf clicks routed to furnish phase via getSelectionTarget
// would be rejected here — single-click selection broken.
const def = nodeRegistry.get(node.type)
if (def && def.category === 'furnish' && def.capabilities.selectable) return true
return false
},
},
}