From d88d8375fde4ed55ef4904ce87d3db30535e6f9d Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 24 Mar 2026 16:35:33 +0800 Subject: [PATCH] fix(frontend): pre-select active unit when opening new equipment modal When a unit is selected in the sidebar, the create-equipment modal now pre-fills the unit dropdown with that unit. Previously it always reset to empty, so newly created equipment got unit_id=null and was hidden by the unit filter after save. Co-Authored-By: Claude Sonnet 4.6 --- web/js/equipment.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/js/equipment.js b/web/js/equipment.js index 0f4c58c..b046fa2 100644 --- a/web/js/equipment.js +++ b/web/js/equipment.js @@ -94,6 +94,9 @@ export function closeEquipmentModal() { export function openCreateEquipmentModal() { resetEquipmentForm(); + if (state.selectedUnitId && dom.equipmentUnitId) { + dom.equipmentUnitId.value = state.selectedUnitId; + } openEquipmentModal(); }