---
path: /domains/tara/collections
surface: customer
domain: tara
auth: signed-in
source: apps/oshun/web/src/app/domains/tara/collections/page.tsx
status: walked
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'
---

# Tara — collections browser

## 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

- [x] **Browser (no selection)** — root selected id is empty; daily widget,
      search, filters, count, and eight collection cards render.
- [x] **Detail view from search id** — `?collection=col-002` resolves to
      `tara-coll-002` and renders Deep Sleep Collection with four real simulated
      meditation rows.
- [x] **Detail view from canonical id** — `?collection=tara-coll-008` renders
      Focus Mastery Series.
- [x] **Unknown deep-link fallback** — `?collection=col-missing` leaves selected
      id empty and returns to the full browser.
- [x] **Search active** — "sleep" narrows the list to Deep Sleep Collection and
      exposes the clear control.
- [x] **Filter active** — "seasonal" narrows to Winter Stillness and Spring
      Renewal with `aria-pressed="true"`.
- [x] **Empty result** — seasonal + "sleep" renders count 0, no cards, and "No
      collections match your search".
- [x] **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

- [x] **Header back** — from `/domains/tara`, open collections, click
      `[data-tara-collections-back]`, and return to `/domains/tara`.
- [x] **Search input** — typing filters live; clear resets the query and result
      count.
- [x] **Type filters** — filter buttons update `data-filter-type` and
      `aria-pressed`.
- [x] **Collection card click / keyboard** — card activation opens detail; Enter
      on `tara-coll-007` opens Heart Opening Series.
- [x] **Detail back** — `[data-tara-collection-detail-back]` clears selected
      collection and restores the browser grid.
- [x] **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.
- [x] **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

- Sibling Tara routes:
  - [`tara.md`](./tara.md),
    [`domains-tara-analytics.md`](./domains-tara-analytics.md),
    [`domains-tara-courses-id.md`](./domains-tara-courses-id.md),
    [`domains-tara-programs.md`](./domains-tara-programs.md),
    [`domains-tara-search.md`](./domains-tara-search.md),
    [`domains-tara-sounds.md`](./domains-tara-sounds.md),
    [`domains-tara-teachers.md`](./domains-tara-teachers.md),
    [`domains-tara-teachers-id.md`](./domains-tara-teachers-id.md)
- Component sources:
  - `apps/oshun/web/src/components/domains/tara/TaraCollections.tsx`
  - `apps/oshun/web/src/components/domains/tara/TaraSearchEngine.tsx`
  - `apps/oshun/web/src/lib/tara/tara-simulation-data.ts`
- Feature spec: [`V1/features.md#tara`](../../../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/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.
