V1 Web PWA · Surface walkthrough

Tara — collections browser

A per-surface walkthrough of the V1 Web PWA customer surface: layout, states, interactions, data, and cross-references.

walked
9sections5 minread

On this page

Context. surface customer · domain tara · route /domains/tara/collections · auth signed-in · source apps/oshun/web/src/app/domains/tara/collections/page.tsx

Last walked. 2026-06-29 focused automated walk (Playwright + real dev infra) — browser, search, filters, empty state, daily widget hydration, collection cards, detail view, search-result deep links, canonical deep links, unknown-id fallback, keyboard card activation, route back-stack, reduced motion, scoped axe scans, and Tara search handoff assertion. Evidence: apps/oshun/web/e2e/tara-collections.spec.ts and apps/oshun/web/e2e/tara-scoped-search.spec.ts

Purpose#

The /domains/tara/collections browser lists themed Tara meditation collections (curated, seasonal, challenge, series), shows a daily inspiration widget above the browser, and opens collection detail views with the meditations in each set. This route is still fixture-backed, but it is a real signed-in web route and Tara search now lands in a concrete collection detail instead of stopping at the page shell.

Entry points#

  • Tara search/domains/tara/search collection results link to /domains/tara/collections?collection=<search-id>. Search IDs such as col-002 are resolved through the collection alias map to the shipped tara-coll-* fixture IDs.
  • Direct URL / bookmark/domains/tara/collections opens the browser; /domains/tara/collections?collection=tara-coll-008 opens the canonical Focus Mastery detail.
  • Unknown collection id/domains/tara/collections?collection=col-missing keeps the browser open and exposes no detail panel.
  • Domain back-stack — the sticky header back button calls router.back(); Playwright verifies the route returns to /domains/tara.
  • Tara hub — no direct /tara hub link to this depth route was found in the current source.

Layout Regions#

page.tsx reads the browser search param via useBrowserSearchParams() and renders:

<TaraCollectionsBrowserPage onBack={() => router.back()} initialCollectionId={collection} />.

Inside TaraCollectionsBrowserPage:

  • Route root[data-tara-collections-browser] records selected collection id, initial collection id, active search, filter type, and result count.
  • Sticky header — back button [data-tara-collections-back], "Collections" heading, "Curated meditation collections and themed journeys" subtitle, and Layers icon.
  • Daily content widget[data-tara-daily-content] resolves after mount with a date, recommendation meditation id, quote, intention, activity, and recommended meditation row.
  • Search input[data-tara-collections-search-input] filters by title or description; [data-tara-collections-search-clear] clears the query.
  • Type filters — All / curated / seasonal / challenge / series buttons with aria-pressed, data-selected, and data-tara-collections-filter.
  • Result count and grid — result-count text plus [data-tara-collections-grid] collection cards. Each card exposes collection id, type, and item count.
  • Collection detail[data-tara-collection-detail="<id>"] replaces the browser grid, shows the collection hero, description, and [data-tara-collection-item] rows with meditation id, duration, teacher, and rating.

States Checked#

  • Browser (no selection) — root selected id is empty; daily widget, search, filters, count, and eight collection cards render.
  • Detail view from search id?collection=col-002 resolves to tara-coll-002 and renders Deep Sleep Collection with four real simulated meditation rows.
  • Detail view from canonical id?collection=tara-coll-008 renders Focus Mastery Series.
  • Unknown deep-link fallback?collection=col-missing leaves selected id empty and returns to the full browser.
  • Search active — "sleep" narrows the list to Deep Sleep Collection and exposes the clear control.
  • Filter active — "seasonal" narrows to Winter Stillness and Spring Renewal with aria-pressed="true".
  • Empty result — seasonal + "sleep" renders count 0, no cards, and "No collections match your search".
  • Reduced motion — the shared reduced-motion media block collapses collection card animation duration to <= 1 ms; the Tara search highlight no longer uses a decorative pulse animation.
  • Daily content midnight refresh — the route schedules a local-browser midnight refresh, but the E2E covers post-mount hydration only, not a fake clock rollover.

Interactions Checked#

  • Header back — from /domains/tara, open collections, click [data-tara-collections-back], and return to /domains/tara.
  • Search input — typing filters live; clear resets the query and result count.
  • Type filters — filter buttons update data-filter-type and aria-pressed.
  • Collection card click / keyboard — card activation opens detail; Enter on tara-coll-007 opens Heart Opening Series.
  • Detail back[data-tara-collection-detail-back] clears selected collection and restores the browser grid.
  • Search-to-collection handoff — Tara scoped search now asserts that Better Sleep Collection navigation opens [data-tara-collection-detail="tara-coll-002"], not just the route shell.
  • Scoped accessibility — browser and detail roots pass focused axe scans; the shared suite-level axe fixture also runs.
  • Item row start / completion actions — collection item rows are display-only today; there is no start, complete, save, or share action in this component.

Data & Contracts#

  • Reads:
    • SIMULATED_MEDITATIONS from @/lib/tara/tara-simulation-data
    • SIMULATED_COLLECTIONS in apps/oshun/web/src/components/domains/tara/TaraCollections.tsx
  • Search ID aliases: col-001..004 map onto shipped tara-coll-* ids so Tara search result links hydrate real collection details.
  • Writes: none.
  • Realtime: none.
  • Caching: client-only; no fetch in this view.
  • Auth/role check: authenticated shell/session setup, not route-local middleware.
  • Daily content clock: refresh timer uses the browser's local midnight; displayed widget date currently comes from the generated content's ISO date.

Current E2E Evidence#

  • apps/oshun/web/e2e/tara-collections.spec.ts
    • Browser state, daily widget hydration, eight cards, card types/counts, search, clear, type filters, empty result, reduced motion, detail deep links, unknown-id fallback, keyboard card activation, header/detail back, and scoped browser/detail axe scans.
  • apps/oshun/web/e2e/tara-scoped-search.spec.ts
    • Existing search states remain covered, and the route handoff now verifies that /domains/tara/collections?collection=col-002 opens Deep Sleep Collection detail.

Cross-References#

Open Questions / Known Gaps#

  • Confirm the live data source for collections once a Tara collections BFF contract lands; today the route honestly uses local simulated content.
  • Decide whether /domains/tara/collections should be linked from the polished /tara hub or remain an internal depth route reached from Tara search and direct URLs.
  • Define whether daily-content date and refresh semantics should be local user time, server time, or UTC; the current implementation mixes a local midnight timer with ISO date generation.
  • Add item-row actions if collections are meant to start sits, save practices, or persist completion from this browser.