diff --git a/.claude/memory/MEMORY.md b/.claude/memory/MEMORY.md new file mode 100644 index 0000000..54337bf --- /dev/null +++ b/.claude/memory/MEMORY.md @@ -0,0 +1,5 @@ +# Memory Index + +- [Project: Daiting App Frontend](project_daiting.md) — Vue 3 + Vite + Tauri v2 dating app, stack, conventions, active views +- [Feedback: API types](feedback_api_types.md) — **ALWAYS CHECK FIRST** — use types from `src/api/api.ts`, never invent local interfaces; ask user to add missing fields to backend +- [Feedback: SCSS architecture](feedback_scss.md) — Use @use per-file, separate Tailwind CSS file from SCSS diff --git a/.claude/memory/feedback_api_types.md b/.claude/memory/feedback_api_types.md new file mode 100644 index 0000000..63de7c6 --- /dev/null +++ b/.claude/memory/feedback_api_types.md @@ -0,0 +1,27 @@ +--- +name: feedback-api-types +description: Always use types from src/api/api.ts — never invent local interfaces for API shapes +metadata: + node_type: memory + type: feedback + originSessionId: 427527bf-bce1-4b1e-9bf1-b5f08ff29055 +--- + +Always use types directly from `src/api/api.ts` (auto-generated typed client) for any data that comes from or goes to the API. Never define local interfaces that duplicate or reinterpret API shapes. + +**Why:** We hit this exact bug in `MatchesView.vue` — a hand-rolled `Match` interface drifted from the real `MatchDto`, causing `partnerProfile` to always be `undefined` at runtime. The generated client already has correct, schema-backed types. + +**How to apply:** +- Before writing any interface for API data, grep `src/api/api.ts` for an existing type (`MatchDto`, `ProfileResponseDto`, `ChatDto`, etc.). +- Compose with `&` or extend when enrichment is needed: `type EnrichedMatch = MatchDto & { partnerProfile: ProfileResponseDto }`. +- If a field is missing from a DTO (e.g. `partnerProfile` wasn't part of `MatchDto`), do NOT add it locally — ask the user to add it to the backend response so the generated client picks it up. +- The same rule applies to request params: use generated `*Params` types, not hand-written `{ profileId: string }` objects. + +**Pattern for enriched data:** +```ts +import type { MatchDto, ProfileResponseDto } from '@/api/api' +type EnrichedMatch = MatchDto & { partnerProfile: ProfileResponseDto } +``` + +**When something is missing from the schema — say so:** +> "MatchDto doesn't include partnerProfile. Should I ask you to add it to the backend endpoint so the generated client has it?" diff --git a/.claude/memory/feedback_scss.md b/.claude/memory/feedback_scss.md new file mode 100644 index 0000000..0adfcb4 --- /dev/null +++ b/.claude/memory/feedback_scss.md @@ -0,0 +1,16 @@ +--- +name: feedback-scss +description: SCSS architecture patterns that work in this project +metadata: + node_type: memory + type: feedback + originSessionId: 46f569a9-d561-4376-8644-c0a07c47905c +--- + +Each SCSS partial (`_typography.scss`, `_animations.scss`) must have its own `@use 'variables' as *;` at the top to access mixins, even when `main.scss` also imports it. + +**Why:** Sass module system (`@use`) scopes imports per-file. Vite's `additionalData` only runs for component `