From ec16dd2c9bb2d0b723b3ab15344c0f7181da3a73 Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Sat, 1 Aug 2026 19:32:51 -0400 Subject: [PATCH] fix: polish unified add-stock modal (Edit.razor) Apply four low-risk fixes from final code review of the consolidated add-stock modal: reset newStock on modal close, dedupe stock-item loading through the existing helper, correct stale empty-state copy about inventory fallback, and remove a stray blank line left from the old form deletion. Co-Authored-By: Claude Sonnet 5 --- CutList.Web/Components/Pages/Jobs/Edit.razor | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/CutList.Web/Components/Pages/Jobs/Edit.razor b/CutList.Web/Components/Pages/Jobs/Edit.razor index bea84a5..73f4fed 100644 --- a/CutList.Web/Components/Pages/Jobs/Edit.razor +++ b/CutList.Web/Components/Pages/Jobs/Edit.razor @@ -882,7 +882,7 @@ else

No stock configured for this job.

Add stock from your inventory or define custom lengths.

-

If no stock is selected, the optimizer will use all available stock for the materials in your parts list.

+

Stock must be explicitly added here before you can optimize — there is no automatic fallback to inventory.

} else @@ -893,7 +893,6 @@ else }; - private RenderFragment RenderStockTable() => __builder => {
@@ -1251,6 +1250,7 @@ else { showStockModal = false; editingStock = null; + newStock = new(); importCandidates.Clear(); stockErrorMessage = null; importErrorMessage = null; @@ -1268,14 +1268,7 @@ else { newStock.MaterialId = stockSelectedMaterialId; newStock.StockItemId = null; - if (stockSelectedMaterialId > 0) - { - availableStockItems = await JobService.GetAvailableStockForMaterialAsync(stockSelectedMaterialId); - } - else - { - availableStockItems.Clear(); - } + await LoadAvailableStockItemsAsync(stockSelectedMaterialId); } private async Task EditStock(JobStock stock)