From dd4785b0481250206565abaa87978b0373f10b38 Mon Sep 17 00:00:00 2001 From: Scott Pouliot Date: Mon, 18 May 2026 18:49:23 -0400 Subject: [PATCH] Fix empty-state button/text on list pages when search returns no results Show 'Add Your First X' and onboarding copy only when the list is truly empty. When a search or filter is active with no results, show 'Add X' and 'No X match your search/filters' instead. Affected: Customers (table + mobile views), Equipment, Inventory. Co-Authored-By: Claude Sonnet 4.6 --- src/PowderCoating.Web/Views/Customers/Index.cshtml | 9 +++++---- src/PowderCoating.Web/Views/Equipment/Index.cshtml | 5 +++-- src/PowderCoating.Web/Views/Inventory/Index.cshtml | 5 +++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/PowderCoating.Web/Views/Customers/Index.cshtml b/src/PowderCoating.Web/Views/Customers/Index.cshtml index d83dc1d..b29d248 100644 --- a/src/PowderCoating.Web/Views/Customers/Index.cshtml +++ b/src/PowderCoating.Web/Views/Customers/Index.cshtml @@ -52,12 +52,13 @@
@if (!Model.Items.Any()) { + var isCustomerListFiltered = !string.IsNullOrEmpty(ViewBag.SearchTerm as string);
No customers found
-

Get started by adding your first customer

+

@(isCustomerListFiltered ? "No customers match your search." : "Get started by adding your first customer.")

- Add Your First Customer + @(isCustomerListFiltered ? "Add Customer" : "Add Your First Customer")
} @@ -187,9 +188,9 @@
No customers found
-

Get started by adding your first customer

+

@(isCustomerListFiltered ? "No customers match your search." : "Get started by adding your first customer.")

- Add Your First Customer + @(isCustomerListFiltered ? "Add Customer" : "Add Your First Customer")
} diff --git a/src/PowderCoating.Web/Views/Equipment/Index.cshtml b/src/PowderCoating.Web/Views/Equipment/Index.cshtml index 8de2d9a..c0a11a1 100644 --- a/src/PowderCoating.Web/Views/Equipment/Index.cshtml +++ b/src/PowderCoating.Web/Views/Equipment/Index.cshtml @@ -61,12 +61,13 @@
@if (!Model.Items.Any()) { + var isEquipmentListFiltered = !string.IsNullOrEmpty(ViewBag.SearchTerm as string) || ViewBag.StatusFilter != null;
No equipment found
-

Get started by adding your first equipment

+

@(isEquipmentListFiltered ? "No equipment matches your search." : "Get started by adding your first equipment.")

- Add Your First Equipment + @(isEquipmentListFiltered ? "Add Equipment" : "Add Your First Equipment")
} diff --git a/src/PowderCoating.Web/Views/Inventory/Index.cshtml b/src/PowderCoating.Web/Views/Inventory/Index.cshtml index b8ffda2..ae9e9bf 100644 --- a/src/PowderCoating.Web/Views/Inventory/Index.cshtml +++ b/src/PowderCoating.Web/Views/Inventory/Index.cshtml @@ -191,12 +191,13 @@
@if (!Model.Items.Any()) { + var isInventoryFiltered = !string.IsNullOrEmpty(ViewBag.SearchTerm as string) || !string.IsNullOrEmpty(ViewBag.Category as string) || lowStockOnly;
No inventory items found
-

Get started by adding your first inventory item

+

@(isInventoryFiltered ? "No items match your current filters." : "Get started by adding your first inventory item.")

- Add Your First Item + @(isInventoryFiltered ? "Add Item" : "Add Your First Item")
}