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/searchcollection results link to/domains/tara/collections?collection=<search-id>. Search IDs such ascol-002are resolved through the collection alias map to the shippedtara-coll-*fixture IDs. - Direct URL / bookmark —
/domains/tara/collectionsopens the browser;/domains/tara/collections?collection=tara-coll-008opens the canonical Focus Mastery detail. - Unknown collection id —
/domains/tara/collections?collection=col-missingkeeps 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
/tarahub 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, anddata-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-002resolves totara-coll-002and renders Deep Sleep Collection with four real simulated meditation rows. - Detail view from canonical id —
?collection=tara-coll-008renders Focus Mastery Series. - Unknown deep-link fallback —
?collection=col-missingleaves 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-typeandaria-pressed. - Collection card click / keyboard — card activation opens detail; Enter
on
tara-coll-007opens 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_MEDITATIONSfrom@/lib/tara/tara-simulation-dataSIMULATED_COLLECTIONSinapps/oshun/web/src/components/domains/tara/TaraCollections.tsx
- Search ID aliases:
col-001..004map onto shippedtara-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-002opens Deep Sleep Collection detail.
- Existing search states remain covered, and the route handoff now verifies
that
Cross-References#
- Sibling Tara routes:
- Component sources:
apps/oshun/web/src/components/domains/tara/TaraCollections.tsxapps/oshun/web/src/components/domains/tara/TaraSearchEngine.tsxapps/oshun/web/src/lib/tara/tara-simulation-data.ts
- Feature spec:
V1/features.md#tara
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/collectionsshould be linked from the polished/tarahub 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.