# OSHUN V1 Nyx Event Actions Audit

## Task

- `V1-NYX-009` Build save/follow/remind actions for sky events.

## Research And Existing Implementations Reviewed

Before implementation, the following existing Nyx save, follow, reminder, and
event-detail surfaces were reviewed:

- `libs/oshun/domain-nyx/src/types.ts`
- `libs/oshun/domain-nyx/src/domain-adapter.ts`
- `libs/oshun/domain-nyx/src/card-model.ts`
- `apps/oshun/web/src/components/domains/nyx/nyxEventPageModels.ts`
- `apps/oshun/web/src/components/domains/nyx/NyxEventDetailWorkspace.tsx`
- `apps/oshun/web/src/components/domains/nyx/EventCalendarOverlay.tsx`
- `apps/oshun/mobile/src/components/NyxObservationCompanionSection.tsx`
- `apps/oshun/mobile/src/navigation/mobileNyxObservationCompanion.ts`

That review showed Nyx already had canonical reminder types and saved-object
patterns, but event-specific save and follow behavior was still missing from the
domain model and from the web event surfaces.

## Implementation

- Added canonical event action state helpers in
  `libs/oshun/domain-nyx/src/event-actions.ts` for save, follow, and reminder
  behavior, including reminder lead-time derivation and user-facing action
  summary chips.
- Exported those helpers from `libs/oshun/domain-nyx/src/index.ts` so web and
  other Nyx surfaces can consume a single canonical event engagement model.
- Added `apps/oshun/web/src/components/domains/nyx/useNyxEventActionState.ts` to
  persist event action state in `localStorage`, synchronize updates across Nyx
  surfaces, and expose a stable hook for UI usage.
- Extended `apps/oshun/web/src/components/domains/nyx/nyxEventPageModels.ts` so
  event list items carry `startsAtIso`, which the action system uses for
  reminder timing.
- Updated
  `apps/oshun/web/src/components/domains/nyx/NyxEventDetailWorkspace.tsx` to
  render a dedicated action bar with save, follow, and reminder toggles plus
  visible action-summary chips in the event hero.
- Updated `apps/oshun/web/src/components/domains/nyx/EventCalendarOverlay.tsx`
  so each event card exposes the same save, follow, and reminder controls
  directly from the calendar surface.

## Coverage

- Added canonical domain coverage in
  `libs/oshun/domain-nyx/src/event-actions.test.ts`.
- Expanded event-detail UI coverage in
  `apps/oshun/web/src/components/domains/nyx/__tests__/NyxEventDetailWorkspace.test.tsx`.
- Expanded event-calendar coverage in
  `apps/oshun/web/src/components/domains/nyx/__tests__/EventCalendarOverlayNavigation.test.tsx`.
- Extended browser automation in `apps/oshun/web/e2e/nyx-event-pages.spec.ts`
  for save, follow, and reminder interaction on Nyx event pages.

## Verification

- Passed:
  `pnpm exec prettier --check libs/oshun/domain-nyx/src/event-actions.ts libs/oshun/domain-nyx/src/event-actions.test.ts libs/oshun/domain-nyx/src/index.ts apps/oshun/web/package.json apps/oshun/web/src/components/domains/nyx/useNyxEventActionState.ts apps/oshun/web/src/components/domains/nyx/nyxEventPageModels.ts apps/oshun/web/src/components/domains/nyx/NyxEventDetailWorkspace.tsx apps/oshun/web/src/components/domains/nyx/EventCalendarOverlay.tsx apps/oshun/web/src/components/domains/nyx/__tests__/NyxEventDetailWorkspace.test.tsx apps/oshun/web/src/components/domains/nyx/__tests__/EventCalendarOverlayNavigation.test.tsx apps/oshun/web/e2e/nyx-event-pages.spec.ts apps/oshun/web/tsconfig.json apps/oshun/web/vitest.config.ts`
- Passed:
  `pnpm exec eslint --no-warn-ignored libs/oshun/domain-nyx/src/event-actions.ts apps/oshun/web/src/components/domains/nyx/useNyxEventActionState.ts apps/oshun/web/src/components/domains/nyx/nyxEventPageModels.ts apps/oshun/web/src/components/domains/nyx/NyxEventDetailWorkspace.tsx apps/oshun/web/src/components/domains/nyx/EventCalendarOverlay.tsx apps/oshun/web/src/components/domains/nyx/__tests__/NyxEventDetailWorkspace.test.tsx apps/oshun/web/src/components/domains/nyx/__tests__/EventCalendarOverlayNavigation.test.tsx apps/oshun/web/e2e/nyx-event-pages.spec.ts apps/oshun/web/vitest.config.ts`
- Passed:
  `pnpm exec vitest run libs/oshun/domain-nyx/src/event-actions.test.ts apps/oshun/web/src/components/domains/nyx/__tests__/NyxEventDetailWorkspace.test.tsx apps/oshun/web/src/components/domains/nyx/__tests__/EventCalendarOverlayNavigation.test.tsx`
- Passed:
  `pnpm exec tsc --noEmit --pretty false -p libs/oshun/domain-nyx/tsconfig.lib.json`
- Passed: filtered
  `pnpm exec tsc --noEmit --pretty false -p apps/oshun/web/tsconfig.json` check
  returned no matches for the touched Nyx event-action source files and tests.

## Blockers

- `pnpm exec playwright test e2e/nyx-event-pages.spec.ts --project=chromium`
  could not start because the configured Playwright web server boot path hit the
  host watcher limit:
  `ENOSPC: System limit for number of file watchers reached, watch '/root/workspace/oshun-v1/apps/oshun/bff/src/server.ts'`.
- The session did not include the `frontend-skill` or `playwright-interactive`
  skills referenced by `AGENTS.md`, so the task used the strongest available
  equivalent workflow: repo-local UI review, targeted Vitest coverage, and
  updated Playwright automation in-repo.
