fix: polish unified add-stock modal (Edit.razor)
Build CutList image / build-and-push (push) Successful in 24s

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 <noreply@anthropic.com>
This commit is contained in:
aj
2026-08-01 19:32:51 -04:00
co-authored by Claude Sonnet 5
parent 0c5ecf716a
commit ec16dd2c9b
+3 -10
View File
@@ -882,7 +882,7 @@ else
<div class="text-center py-4 text-muted">
<p class="mb-2">No stock configured for this job.</p>
<p class="small">Add stock from your inventory or define custom lengths.</p>
<p class="small">If no stock is selected, the optimizer will use all available stock for the materials in your parts list.</p>
<p class="small">Stock must be explicitly added here before you can optimize — there is no automatic fallback to inventory.</p>
</div>
}
else
@@ -893,7 +893,6 @@ else
</div>
};
private RenderFragment RenderStockTable() => __builder =>
{
<div class="table-responsive">
@@ -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)