Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
e1dcb8c
Merge pull request #61 from jacuzzicoding/release/v0.8.2-alpha
jacuzzicoding May 2, 2026
f28c1a0
docs: add v0.9.0-beta implementation plan
jacuzzicoding May 3, 2026
5aa143e
Merge pull request #62 from jacuzzicoding/docs/v0.9-plan
jacuzzicoding May 3, 2026
b7e04ca
feat(v0.9-phase-1): add Meadow tokens + Fraunces/Inter, retire Varela…
jacuzzicoding May 3, 2026
60f42ce
Merge pull request #63 from jacuzzicoding/feature/v09-phase-1-tokens-…
jacuzzicoding May 3, 2026
42eb180
chore(docs): commit v0.9 design handoffs to docs/design-handoffs/
jacuzzicoding May 3, 2026
a1acdeb
Merge pull request #64 from jacuzzicoding/chore/commit-v09-design-han…
jacuzzicoding May 3, 2026
4ecf3e0
feat(v0.9 phase 2): replace header+tabbar with Sidebar shell
jacuzzicoding May 3, 2026
8aa1ba0
chore: bump version to v0.9.0-beta + doc sweep
jacuzzicoding May 3, 2026
3e6e796
Merge pull request #65 from jacuzzicoding/feature/v09-phase-2-sidebar
jacuzzicoding May 3, 2026
59b9b86
feat(v0.9 phase 3): SettingsPage + reset actions at /settings
jacuzzicoding May 3, 2026
236fde7
Merge pull request #66 from jacuzzicoding/feature/v09-phase-3-settings
jacuzzicoding May 3, 2026
a8f7adc
feat(v0.9 phase 4): TownManager drawer + retire modal CRUD
jacuzzicoding May 3, 2026
28dca1f
Add v0.9 plan baseline + verify repo health commands
Codex May 3, 2026
15ebf42
Merge pull request #67 from jacuzzicoding/feature/v09-phase-4-townman…
jacuzzicoding May 3, 2026
57967fc
Merge pull request #68 from jacuzzicoding/codex/revamp-ui-for-v0-9-0-…
jacuzzicoding May 3, 2026
7ede1f8
Merge pull request #69 from jacuzzicoding/feature/v09-phase-4-townman…
jacuzzicoding May 3, 2026
bcaa211
feat(v0.9 phase 5): restyle CollectibleRow + ItemExpandPanel
jacuzzicoding May 3, 2026
b75b1f1
fix(a11y): announce donated marker via role="img"
jacuzzicoding May 3, 2026
52870f7
fix(sea-creatures): drop duplicate time string from itemNotes
jacuzzicoding May 3, 2026
9fc865c
fix(css): add .ac-list card, focus ring, drop double divider, collaps…
jacuzzicoding May 3, 2026
58567ba
fix(sea-creatures): preserve time in DetailModal; drop dead onToggle …
jacuzzicoding May 4, 2026
ff5ca29
Merge pull request #70 from jacuzzicoding/feature/v09-phase-5-rows
jacuzzicoding May 4, 2026
c430e0d
feat(home): v0.9 Phase 6 — rebuilt HomeTab + ProgressMeter
jacuzzicoding May 4, 2026
a93c450
Merge pull request #72 from jacuzzicoding/feature/v09-phase-6-home
jacuzzicoding May 4, 2026
d029117
feat(v0.9): Phase 7 — CategoryTab sectioning
jacuzzicoding May 4, 2026
c90dd95
Merge pull request #73 from jacuzzicoding/feature/v09-phase-7-category
jacuzzicoding May 4, 2026
1407767
feat(v09-phase-8): GlobalSearchDropdown — unified search
jacuzzicoding May 4, 2026
639b7cb
fix(phase-8): commit query to history; remove duplicate keyframe
jacuzzicoding May 4, 2026
56d3ead
Merge pull request #75 from jacuzzicoding/feature/v09-phase-8-search
jacuzzicoding May 4, 2026
a7b99d7
feat(v0.9 phase 9): rebuild StatsTab with per-category cards + yearly…
jacuzzicoding May 4, 2026
bf2991a
Merge pull request #77 from jacuzzicoding/feature/v09-phase-9-stats
jacuzzicoding May 4, 2026
3ddabbe
feat(data): ACWW + ACCF art data (closes #74)
jacuzzicoding May 4, 2026
a758589
Perfect painting fix
jacuzzicoding May 4, 2026
c8202d7
fix(data-loader): include ACWW + ACCF in GAMES_WITH_ART
jacuzzicoding May 4, 2026
9c67700
fix(stats): make StatsTab card grid data-driven for art/sea
jacuzzicoding May 4, 2026
f5f573a
chore(docs): v0.9 doc sweep through Phase 9
jacuzzicoding May 4, 2026
983d7af
Merge pull request #78 from jacuzzicoding/feature/v09-art-data-ww-cf
jacuzzicoding May 4, 2026
e7a23fa
Merge pull request #79 from jacuzzicoding/chore/v09-doc-sweep
jacuzzicoding May 4, 2026
d551a63
feat(mobile): Phase 10 mobile responsive polish
jacuzzicoding May 4, 2026
f47acce
fix(phase-10): correct iPhone SE viewport in CHANGELOG; backfill PR #…
jacuzzicoding May 4, 2026
d45e0d7
Merge pull request #80 from jacuzzicoding/feature/v09-phase-10-mobile
jacuzzicoding May 4, 2026
6261dfe
fix(#81): convert Art tab to inline ItemExpandPanel
jacuzzicoding May 4, 2026
a5e6509
docs(#81): update DetailModal references after retirement
jacuzzicoding May 4, 2026
7c72fe0
Merge pull request #83 from jacuzzicoding/fix/issue-81-art-inline-expand
jacuzzicoding May 4, 2026
6a169c0
release: stage v0.9.0-beta
jacuzzicoding May 4, 2026
3d16f08
Merge remote-tracking branch 'origin/main' into release/v0.9.0-beta
jacuzzicoding May 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 57 additions & 32 deletions .claude/rules/architecture.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,74 @@
# Architecture Reference (v0.8)
# Architecture Reference (v0.9.0-beta)

## Stack
Vite + React 19 + TypeScript + Tailwind CSS v4 + Zustand (persist middleware) + React Router v6
Vite + React 19 + TypeScript + Tailwind CSS v4 + Zustand (persist + non-persisted UI store) + React Router v6. Meadow design tokens (CSS custom properties in `src/index.css` `@theme`); Fraunces (display) + Inter (UI).

## Key Files
- `src/lib/store.ts` — Zustand store, persist v3, 3-level donation schema
- `src/lib/types.ts` — GameId union, Town, Game interface, GAMES registry
- `src/lib/constants.ts` — MONTH_NAMES, CATEGORY_LABELS, SEASONS (single source of truth)
- `src/lib/colors.ts` — design token hex constants
- `src/lib/categoryMeta.ts` — CATEGORY_META constant (label/Icon/file per category)
- `src/lib/viewTypes.ts` — ViewId and AllData types
- `src/lib/storeMigrations.ts` — Zustand migrate callback (v1→v2→v3; backfills gameId, then hemisphere)
- `src/lib/bootstrapMigration.ts` — one-time localStorage key rename, called in main.tsx before createRoot
- `src/hooks/useHydration.ts` — onFinishHydration guard, prevents flash of empty state
- `src/hooks/useMuseumData.ts` — fetches and caches all category JSONs for the active town's game (including sea creatures for ACNH); accepts `gameId` and fetches from `/data/<game>/`; re-fetches when active town's game changes
- `src/hooks/useSearch.ts` — search history, click-outside, debounce
- `src/hooks/useCategoryStats.ts` — memoized donated counts per category
- `src/components/ErrorBoundary.tsx` — wraps app root, crashes show ErrorState not blank page
- `src/components/ACCanvas.tsx` — ~298-line orchestration shell; decomposition complete (v0.7 PR #25); wires ItemExpandPanel inline-expand and DetailModal bottom-sheet
- `src/components/ItemExpandPanel.tsx` — inline accordion panel for Fish/Bugs/Fossils rows (month grid, bells, habitat, donate toggle)
- `src/components/shared/` — HabitatChip, DonateToggle, CategoryProgress, SearchBar, EmptyState, MonthGrid
- `src/components/modals/` — CreateTownModal (game selector, new town form), EditTownModal, DetailModal (bottom-sheet for Art + Search results)
- `src/components/views/` — AnalyticsView, ActivityFeed, SectionCard
- `src/components/search/` — GlobalSearchBar, GlobalSearchResults, SearchHistoryPopover
- `src/components/CollectibleRow.tsx`, `TownSwitcher.tsx`, `MuseumHeader.tsx`, `TabBar.tsx`
- `public/data/<gameId>/` — item data files for all 5 games: acgcn/, acww/, accf/, acnl/, acnh/ all present

### State + data
- `src/lib/store.ts` — Zustand app store, persist key `ac-web` schema v3, 3-level donation schema. `createTown(name, gameId, hemisphere?)`, `updateTown(id, patch: { name?, hemisphere? })` — `gameId` is intentionally not patchable post-create (Decision 1). Includes `resetActiveTownDonations()` + `resetAll()` for the Phase 3 Settings danger zone.
- `src/lib/uiStore.ts` — non-persisted Zustand store for transient UI state (`townManagerOpen`, `townManagerForceCreate`).
- `src/lib/types.ts` — GameId union, `Town` (no longer has `playerName` — removed in Phase 4 / Decision 5), Game interface, GAMES registry, GAME_LIST.
- `src/lib/constants.ts` — MONTH_NAMES, CATEGORY_LABELS, CATEGORY_ORDER, SEASONS.
- `src/lib/colors.ts` — `meadow` token export (mirrors CSS custom properties), `fontStacks` for Fraunces/Inter, legacy `colors` retained until consumers retire.
- `src/lib/categoryMeta.ts` — CATEGORY_META (label / Icon / file / data presence per game).
- `src/lib/viewTypes.ts` — ViewId union and AllData shape. Phase 8 removed the `'search'` route.
- `src/lib/storeMigrations.ts` — Zustand migrate callback v1→v2 (gameId backfill) and v2→v3 (hemisphere backfill).
- `src/lib/bootstrapMigration.ts` — one-time localStorage key rename, called in main.tsx before createRoot.

### Hooks
- `src/hooks/useHydration.ts` — onFinishHydration guard.
- `src/hooks/useMuseumData.ts` — fetches all category JSONs for the active town's game (sea creatures included for ACNL/ACNH); re-fetches when active town's game changes.
- `src/hooks/useCategoryStats.ts` — memoized donated counts per category.
- `src/hooks/useJumpToRow.ts` — Phase 6 navigation helper. Pushes `/town/:townId/:tab` and sets `highlightId` on the next animation frame; ACCanvas's effect picks up the change and scrolls + pulses the matching row.
- (`useSearch` retired in Phase 8 — search state lives inside GlobalSearchDropdown.)

### Components — shell
- `src/components/Sidebar.tsx` — 280px sticky left sidebar (Phase 2). Brand, active-town card, NavLink nav with per-category counts, Export CSV / Settings footer. "Switch town ›" opens TownManager via useUIStore.
- `src/components/TownManager.tsx` — right-side drawer (bottom sheet ≤720px) mounted at App layout level (Phase 4). Switch / inline-edit / create / delete towns. Edit form is name + (ACNH-only) hemisphere; game is read-only post-create.
- `src/components/SettingsPage.tsx` + `SettingsRoute.tsx` — `/settings` route (Phase 3). About + Danger zone only (no Appearance, Decision 3).
- `src/components/ACCanvas.tsx` — orchestration shell. Owns `highlightId` state. Mounts active tab; wires GlobalSearchDropdown topbar (Home only). All categories (including art) use the inline `ItemExpandPanel` as of v0.9 (#81).
- `src/components/ErrorBoundary.tsx` / `ErrorBanner.tsx` / `ErrorState.tsx`.

### Components — tabs
- `src/components/HomeTab.tsx` — Phase 6 rebuild. Hero stat + ProgressMeter, month strip, "Leaving end of {month}" shelf, "Just arrived" shelf, latest donations. Cards fire `jumpTo`.
- `src/components/CategoryTab.tsx` — Phase 7. Sections: Leaving this month / Available now / Out of season / Already donated. Owns expandedId; reacts to `highlightId`. Hosts per-tab `SearchBar`. All categories (including art) use the inline `ItemExpandPanel` as of v0.9 (#81).
- `src/components/StatsTab.tsx` — Phase 9. Per-category cards (3/4/5 by game) + 12-column yearly rhythm chart. Replaces AnalyticsView.
- `src/components/ProgressMeter.tsx` (+ `progressMeterUtils.ts`, `ProgressMeter.test.ts`) — Phase 6. 4 segments (fish/bugs/fossils/art) for ACGCN/ACWW/ACCF; 5 segments (+ sea) for ACNL/ACNH. `.ac-meter-5` modifier handles responsive wrapping.

### Components — rows + panels
- `src/components/CollectibleRow.tsx` — Phase 5 restyle. Monogram glyph, meta line with `·` separators, leaving/new pills, animated chevron. Stamps `data-row-id`. Donate UI lives in the expand panel only.
- `src/components/ItemExpandPanel.tsx` — Phase 5 rebuild. Two-column grid: MonthGrid + stats stack (bells / shadow / hours / notes) + donate button.
- `src/components/shared/` — DonateToggle, EmptyState, HabitatChip, MonthGrid (Phase 5 re-skin, accepts `current` prop), SearchBar (per-tab, used by CategoryTab). `CategoryProgress.tsx` is dead — file remains pending cleanup.
- `src/components/modals/` — DetailModal **retired in v0.9 (#81)**; file deleted. Art now uses the inline `ItemExpandPanel` like every other category.
- `src/components/views/ActivityFeed.tsx` — recent donations list (consumed by HomeTab). `AnalyticsView` and `SectionCard` retired in Phase 9.
- `src/components/search/GlobalSearchDropdown.tsx` — Phase 8 unified search dropdown (anchored under Home topbar). Grouped category results (5 groups for ACNL/ACNH, 4 elsewhere), keyboard nav (↑↓↵esc), search history at localStorage key `ac-curator-search-history` (max 8). Replaces GlobalSearchBar / GlobalSearchResults / SearchHistoryPopover.

### Data
- `public/data/<gameId>/` — `acgcn/`, `acww/`, `accf/`, `acnl/`, `acnh/` all present. Sea creatures for ACNL + ACNH. Art for ACGCN + ACNH today; ACWW + ACCF art incoming via PR #78 (closes Issue #74).

## Store Schema (v3)
```
donated: Record<townId, Record<gameId, Record<itemId, boolean>>>
donatedAt: Record<townId, Record<gameId, Record<itemId, string>>>
towns: Town[] // each Town has id, name, playerName, gameId, hemisphere ('NH'|'SH'), createdAt
towns: Town[] // Town: id, name, gameId, hemisphere ('NH'|'SH'), createdAt
```
CRITICAL: callers use getActiveTown().gameId to scope donations — store handles the 3rd level.
`hemisphere` defaults to 'NH'; only used for ACNH month display (months_nh / months_sh).
CRITICAL: callers use `getActiveTown().gameId` to scope donations — store handles the 3rd level. `hemisphere` defaults to `'NH'`; only meaningful for ACNH (drives months_nh / months_sh).

## Multi-Game Support
- GameId = 'ACGCN' | 'ACWW' | 'ACCF' | 'ACNL' | 'ACNH'
- Data files use game-local IDs (sea-bass in ACGCN == sea-bass in ACWW — schema handles scoping)
- Only show games with data files present in CreateTownModal
- Data files use game-local IDs; the schema scopes by gameId.
- Game is **immutable post-create** (Decision 1). Only display games with data files in TownManager's create form.

## Scroll-to + highlight (Decision 10)
`ACCanvas` owns `highlightId`. Setters: HomeTab (via `useJumpToRow`) and `GlobalSearchDropdown.onJump` both `setTab + setHighlightId`. `CategoryTab` opens the matching row, scrolls (`block: 'center'`, smooth) on the next animation frame, and adds `.ac-row-pulse` (1.4s `@keyframes ac-row-pulse`). Rows stamp `data-row-id={item.id}`. The state clears after the pulse so re-jumping the same id retriggers.

## Dev Preview
https://development-animalcrossingwebapp.vercel.app/ — auto-deploys from `development` branch via Vercel GitHub integration. Never run `vercel` CLI manually.
https://development-animalcrossingwebapp.vercel.app/ — auto-deploys from `development` via Vercel GitHub integration. Never run `vercel` CLI manually.

## Reference Docs
- docs/v0.7-audit.md — full ranked audit (P0/P1/P2)
- docs/v0.7-architecture-proposal.md — approved design decisions
- docs/dev-process.md — full dev process (this is the .claude/rules/ version)
- `docs/v0.9-plan.md` — canonical v0.9 implementation plan + locked decisions
- `docs/decisions.md` — reverse-chronological decision log
- `docs/design-handoffs/` — v0.9 / v0.9.1 / v0.9.2 design specs
- `docs/v0.7-audit.md` / `docs/v0.7-architecture-proposal.md` — multi-game foundation history
- `docs/dev-process.md` — full dev process
2 changes: 1 addition & 1 deletion .claude/rules/dev-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Every feature, fix, or change must follow this checklist before the PR is comple
3. CHANGELOG.md updated with entry under the current version section
4. CLAUDE.md updated if any of these changed: file structure, new components/hooks/utils, architecture, commands, known issues, version number
5. Tests pass — run `npm run build` and `npm test` before pushing
6. Dev preview tested at https://animalcrossingwebapp-git-development-jacuzzicodings-projects.vercel.app for any user-visible changes
6. Dev preview tested at https://development-animalcrossingwebapp.vercel.app for any user-visible changes
7. Version references kept current (CLAUDE.md, README.md)

## PR Description Requirements
Expand Down
Loading
Loading