Memory: session-log 2026-04-23c + registry catch-up; retire NearbyPackageCard

Session log entry for today (2026-04-23c) covers the 8-commit demo
update pass: MiniCard-based nearby-verified grid, package fixtures
cleanup (drop 'unknown' treatment) + 10 new verified packages, Vite
envDir fix for Google Maps, always-recommended Comparison route,
responsive PackageDetail CTAs, ComparisonTable tier-aware Unknown
rendering, and info-card un-stick.

Plus the pre-drafted 2026-04-23b session-log entry (extractions,
CompareBar pattern, PackageDetail toggle, basket persistence) and the
matching component-registry updates for those prior-session changes.

Registry today: NearbyPackageCard row removed (now orphaned and deleted
— no consumers after MiniCard swap). PackagesStep, PackageDetail, and
ComparisonTable rows updated for this session's changes.

Decisions-log D052–D056 live locally; decisions-log.md is gitignored so
those additions aren't in this commit. Flagging the gitignore mismatch
— the session log references decision IDs that won't resolve for anyone
pulling from the remote until that's sorted.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-23 14:23:45 +10:00
parent a3d4427190
commit 826f888e87
5 changed files with 94 additions and 206 deletions

View File

@@ -26,6 +26,91 @@ Each entry follows this structure:
## Sessions
### Session 2026-04-23c — Nearby-verified MiniCard grid, package fixtures + dashes, recommended column, map env fix
**Agent(s):** Claude Opus 4.7 (1M context)
**Context:** User walked through a series of demo-visible issues after reviewing `https://parsons.tensordesign.com.au/arrangement/`. Each landed as its own commit + deploy; total 8 commits.
**Work completed:**
- **Nearby-verified section on PackagesStep now surfaces providers, not packages (D052):** the `nearby-verified` `SecondaryList` arm was rebuilt around `MiniCard`. Data shape renamed `NearbyVerifiedPackage``NearbyVerifiedProvider` (`id, name, imageUrl, location, startingPrice, rating?, reviewCount?`); `verified` is implicit, not a data field, since the section is verified-only by definition. Callback `onNearbyPackageClick``onNearbyProviderClick`, routing directly on provider id. **Layout**: 2-col CSS grid (`repeat(2, 1fr)`) on sm+, 1-col on xs; capped at 4 via `NEARBY_VERIFIED_LIMIT`. Heading changed "Similar packages from verified providers nearby" → "Similar packages from verified providers" (dropped "nearby"). Heading icon aligned to top line of multi-line text via `alignItems: flex-start` + `mt: '3px'` (FA icon convention). Demo fixture `nearbyVerifiedSamples` replaced by `nearbyVerifiedProviders` derived from the main `providers` fixture filtered to `tier === 'verified' && imageUrl`. `NearbyPackageCard` molecule is orphaned and retired in the same pass (registry row + folder deleted).
- **Packages fixtures cleanup + 10 new verified packages:**
- **Dashes (D053):** removed all 10 fixture entries with `treatment: 'unknown'` from Optionals. Narrowed `Optional['treatment']` from `IncludedTreatment | 'unknown'` to `IncludedTreatment`. Simplified `optionalsForStep` / `optionalsForComparison` helpers — the `'unknown'` branches are gone. PackageDetail no longer renders bare em-dash rows; ComparisonTable's `lookupValue` already returned `unavailable` (→ "Not Included") for missing items via the section cross-join.
- **New packages:** distribution randomised, max 5 per verified provider. Parsons 3 → 5 (+ Traditional Burial, Memorial Service), Rankins 2 → 3 (+ Direct Cremation), Killick 2 → 3 (+ Traditional Burial), Mackay 1 → 4 (+ Premium, Simple Cremation, Memorial Service), Mannings 1 → 4 (+ Premium, Simple Cremation, Direct Cremation). Each new package follows the canonical-Essentials rule (same 9 line items, per-package prices/treatments). Mackay + Mannings comparison maps rewritten from the single-package `.map(pkg => ({...}))` shape to the indexed-array pattern used by parsons/rankins/killick. Their `packagesByProvider` entries now `slice(0,1)`/`slice(1)` so "Other packages from this provider" renders.
- **PackagesStep selection lookup** bug fix — `selectedPackage` was derived only from the primary `packages` array, so clicking a package in "Other packages from X" updated `selectedPackageId` but the detail panel stayed empty. Added a fallback to the `same-provider-more` secondary list.
- **Vite demo config: `envDir = __dirname` (D056).** The demo's Google Maps API key was never in the production bundle. `vite.demo.config.ts` sets `root: src/demo/apps/<slice>/`, and Vite's default envDir is that `root` — no env files there, so `.env.local` at the repo root was silently ignored and `VITE_GOOGLE_MAPS_API_KEY` came out undefined. ProviderMap fell through to its "no API key" empty state on prod. Adding `envDir: __dirname` fixes it for every current and future slice.
- **Comparison route: always include a recommended column (D055).** Demo's Comparison.tsx resolves a static `DEMO_RECOMMENDED_KEY = 'parsons:deluxe'` and passes it as `recommendedPackage`. Dedupes against basket so if the user has Parsons Deluxe selected it only appears once (as the recommended column). Basket mechanics unchanged — `useComparisonBasket` still caps user selections at 3; the recommended is layered as an editorial suggestion. Empty state demoted to defensive (now only fires when both `packages` AND `recommendedPackage` miss).
- **PackageDetail CTAs side-by-side on mobile.** Buttons stacked on xs because of `flexDirection: { xs: 'column', sm: 'row' }` + `size="large"` — labels couldn't fit a ~360px column side by side. Fixed `flexDirection: 'row'` for all viewports and `size: isMobile ? 'medium' : 'large'` (40px/48px). `useMediaQuery(theme.breakpoints.down('sm'))` drives the switch.
- **ComparisonTable: unverified providers show "Unknown" (D054).** `lookupValue` now checks `pkg.provider.verified` — unverified missing cells return `{ type: 'unknown' }` (existing "Unknown" + info-icon render), verified missing cells keep `{ type: 'unavailable' }` (→ "Not Included" in Optionals/Extras; em-dash in Essentials as the safety net — canonical-essentials rule means that path shouldn't fire in practice). Dropped the "* Some providers have not provided an itemised pricing breakdown. Their items are shown as '—' above." footer and the now-unused `Z_HEADER_ROW` constant.
- **ComparisonTable info card un-stuck.** The top-left "Package Comparison" info card had `position: sticky, left: 0` which pinned it over the leftmost package column (the recommended one since D040) on horizontal scroll. Dropped the sticky positioning — info card scrolls with the package headers; row-label column below stays sticky on its own (those labels genuinely help orient the reader).
**Decisions made:** D052, D053, D054, D055, D056.
**Verified visually (user eyes, Playwright not used):**
- MiniCard grid renders 2-col desktop / 1-col mobile, max 4; icon aligns with heading top line on mobile.
- New packages visible in each provider's "Other packages from X" section; "Other from Rankins → Premium" selection now surfaces PackageDetail.
- Dashes gone from verified-provider PackageDetail Optionals.
- Google Maps loads on prod (grep of built bundle confirmed `AIzaSy` key baked in).
- ComparisonPage shows Parsons Deluxe as leftmost recommended column with the filled-brand + star badge on every visit.
- CTAs side-by-side on mobile at medium size.
- Botanical (tier2) comparison cells render "Unknown" — no more em-dashes except the canonical-Essentials safety-net path (which verified providers never trigger in practice).
- Info card scrolls away on horizontal scroll; recommended card fully visible.
**Preflight + deploy:** Each commit preflighted (TS + ESLint + Prettier clean; Storybook built once) and deployed via `npm run demo:publish` to `https://parsons.tensordesign.com.au/arrangement/`. Hardcoded-hex warnings all pre-existing in HomePage / FuneralFinderV2-4 / PackageDetail — none introduced this session.
**Open questions:**
- None.
**Next steps:**
- Push commits to `backup` + `fa-dev` git remotes at `git.tensordesign.com.au`.
---
### Session 2026-04-23b — Extractions, CompareBar pattern, PackageDetail toggle, basket persistence
**Agent(s):** Claude Opus 4.7 (1M context)
**Context:** Continuation of 2026-04-23 work. User asked for a polish + cleanup pass on the comparison feature and its surrounding components, ending with a deploy. Several discrete changes delivered across component + demo layers.
**Work completed:**
- **Three molecule extractions (D048)** from ProvidersStep, each with its own barrel export + Storybook stories:
- `LocationSearchInput` (`src/components/molecules/LocationSearchInput/`) — committed-chip location search. Owns the subtle endAdornment absolute-anchor CSS so future Autocomplete-with-custom-endAdornment users don't rediscover it.
- `HelpBar` (`src/components/molecules/HelpBar/`) — promoted from a WizardLayout-internal component so WizardLayout and ProvidersStep's mobile-map branch share one source of truth (prevents the phone/styling drift that had already crept in).
- `SortMenu` (`src/components/molecules/SortMenu/`) — trigger Button + anchored Menu with `variant: 'compact' \| 'verbose'`. Intended for VenueStep / CoffinsStep reuse; today only ProvidersStep consumes it.
ProvidersStep shed ~240 lines net (1087 → ~850) and now reads as a composition of small molecules.
- **CompareBar**:
- Sized up: Badge large (32px), body1 text, Button medium (40px) on desktop; responsive size-down on xs.
- Compare icon removed — label alone at the larger size.
- Horizontal centering fixed — was 171px off-centre on desktop because Slide's internal transform was clobbering `translateX(-50%)`. Switched to `left:0; right:0; mx:auto; width:fit-content` which Slide doesn't fight.
- `bottom` bumped from `theme.spacing(9)` to `theme.spacing(16)` — the FA theme uses a 4px spacing base, so 9 was only 36px (overlapping the ~40px HelpBar). 16 = 64px with clean 25px gap.
- **Mobile collapse with auto-peek on add (D049)**: single-Paper width-animation approach. Right-anchored on xs, middle content (status + CTA) animates to `max-width: 0` while the pill's right edge stays pinned — visually retracts to the corner as one unit. Grey-filled chevron swaps between right (collapse) and left (expand) in place. Auto-peek: new add while collapsed → bar peeks back in for 3s. Collapsed badge shows just `count` (not `count/3`) with pinned min-width for circular look.
- z-index dropped from `snackbar` (1400) to `drawer` (1200). `MapProviderDrawer` raised from `3` to `modal` (1300). Drawer now visually covers CompareBar on mobile map view when a pin/cluster is active.
- **PackageDetail `inCart` toggle (D050)**: new `inCart?: boolean` prop. Both states share the same soft/secondary chrome + "Compare" label; added state adds a trailing `CheckRoundedIcon`. Click is a toggle (caller wires to `basket.toggle(key)`). Two earlier patterns were implemented then rejected by the user: an inert brand-tinted pill (too much space) and an "Added" label swap (cognitive overhead). `aria-pressed` + `aria-label` carry state for SR. Threaded via `PackagesStep.isSelectedPackageInCart``Packages.tsx` computes `basket.has(key)`.
- **Basket URL-sync sticky (D051)**: `useBasketUrlSync` pre-fix silently wiped the basket on back-navigation from `/providers/:id/packages?compare=foo` to `/` because the new empty `?compare=` was treated as a "set to empty" signal. Fix: when in-app navigation drops the param but the store still has items, re-attach the store's keys to the new URL instead of wiping. Shared links + manual URL edits still hydrate the store. Demo-only change.
- **Minor polish**:
- MapProviderDrawer cluster rows: verified-icon alignment fix + 1.25 lineHeight on name + px:2 header padding aligns heading with row content (was px:1.5).
- Deployed checkpoint mid-session (commit `6434d113`) and end-of-session.
**Decisions made:** D048, D049, D050, D051.
**Verified visually (Playwright):**
- Basket persists across provider → map → provider → map (URL carries `?compare=...` through every route).
- Mobile CompareBar collapses/expands as one unit; collapsed badge is circular; grey chevron visible; auto-peek fires on add; HelpBar overlap gone.
- Drawer z-index: drawer covers CompareBar when active; CompareBar reappears when drawer dismissed.
- PackageDetail toggle: chrome identical between default and added states; trailing tick on right when `inCart`.
**Preflight + deploy (early checkpoint):** all critical checks pass (TS, Storybook build, token sync, ESLint, Prettier). Deployed to `https://parsons.tensordesign.com.au/arrangement/`.
**Open questions:**
- None blocking. If slide/peek on mobile feels wrong after user testing, the pattern is one `git revert` away.
**Next steps:**
- Memory / registry catch-up pass (in progress at session end), then a second deploy.
---
### Session 2026-04-23 — ProvidersStep polish + mobile map-first layout + deploy
**Agent(s):** Claude Opus 4.7 (1M context)