From dcfbfc97ce902ebb96b7c4d3c8736e87f358a2bd Mon Sep 17 00:00:00 2001 From: Richie Date: Thu, 23 Apr 2026 13:56:08 +1000 Subject: [PATCH] PackagesStep: look up selected package in both primary + same-provider-more lists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clicking a package in the "Other packages from [Provider]" section set the selectedPackageId correctly but the detail panel stayed on the empty state — `selectedPackage` was derived only from the primary `packages` array, so secondary-list ids never resolved. Now falls back to the secondary list when the primary miss. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/components/pages/PackagesStep/PackagesStep.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/pages/PackagesStep/PackagesStep.tsx b/src/components/pages/PackagesStep/PackagesStep.tsx index 7758be0..e4d541c 100644 --- a/src/components/pages/PackagesStep/PackagesStep.tsx +++ b/src/components/pages/PackagesStep/PackagesStep.tsx @@ -214,7 +214,14 @@ export const PackagesStep: React.FC = ({ sx, }) => { const copy = TIER_COPY[providerTier]; - const selectedPackage = packages.find((p) => p.id === selectedPackageId); + // Look up the selected package across BOTH the primary list and the + // same-provider-more secondary list — tapping "Premium Funeral Service" + // in the "Other packages from X" section should surface its detail too. + const selectedPackage = + packages.find((p) => p.id === selectedPackageId) ?? + (secondaryList?.kind === 'same-provider-more' + ? secondaryList.packages.find((p) => p.id === selectedPackageId) + : undefined); // Mobile drill-in: on mobile, the list is the default view — only when the // user explicitly taps a package do we swap in the detail panel. This