23 Commits
Author SHA1 Message Date
admin 3fa62d2ce0 feat(02-06): MilestoneForm + PostTypeSheet wiring + ProfileTabs + profile page — Phase 2 complete 2026-06-13 10:22:35 +02:00
admin 9b02d3dc8b feat(02-06): milestone-meta map + MilestoneCard + PostCard MILESTONE routing — MILE-02 2026-06-13 10:21:49 +02:00
admin 9a901e3485 feat(02-05): wire seams — PawRing in PostCard, StoryTray in feed, StoryForm in PostTypeSheet 2026-06-13 10:11:09 +02:00
admin e30531f834 feat(02-05): storiesRouter GREEN + PawRing + StoryViewer + StoryTray + StoryForm 2026-06-13 10:08:23 +02:00
adminandClaude Sonnet 4.6 e4b619671f feat(02-04): post creation flow — MultiImageUpload, PhotoPostForm, PostTypeSheet, + button nav
MultiImageUpload:
- Per-file: validate type(jpg/png/webp) + size(<10MB) with exact UI-SPEC error copy
- Rejects >10 total: "You can upload up to 10 photos per post."
- posts.getPresignedUrl → XHR PUT with exact Content-Type (Pitfall 4 prevention)
- Reorderable thumbnails with remove button and upload progress bar

PhotoPostForm:
- MultiImageUpload + caption Textarea (max 500, error "Caption must be 500 characters or fewer.")
- "Share Post" CTA (bg-orange-500) → posts.create({ petId: activePetId, imageKeys })
- onSuccess: invalidate feed query, close Dialog, router.push('/feed') (D-03)
- Toasts: "Post shared" / "Couldn't share your post. Please try again."

PostTypeSheet:
- Bottom Sheet titled "Create" with 3 options: Photo Post, Story, Milestone (D-01)
- Photo → full-screen Dialog with PhotoPostForm (D-02, no URL change)
- Story/Milestone: TODO(02-05)/TODO(02-06) seams with placeholder dialogs

Sidebar + MobileNav:
- + button opens PostTypeSheet (D-01)
- MobileNav center + button: was Link to /pets, now triggers PostTypeSheet
- Sidebar: New Post button added above owner identity

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 12:48:56 +02:00
adminandClaude Sonnet 4.6 15f51825d9 feat(02-04): full PostCard — carousel + caption clamp + options menu
- Header: Avatar (story ring seam TODO(02-05)), pet name, timestamp, MoreHorizontal
- Single image: object-cover max-h-[560px]; Carousel: Embla for 2–10 images
- Carousel index indicator top-right; dot indicators bg-muted/bg-foreground (NOT orange)
- Caption line-clamp-3 with more/less toggle (instant, no animation per UI-SPEC)
- Own post options: Edit caption (inline Textarea) + Delete post (AlertDialog)
- Other's post options: Report post (ReportSheet) + Block {name} (BlockDialog)
- updateCaption / delete wired to tRPC mutations with exact UI-SPEC copy
- activePetId === post.pet.id determines own-vs-other ownership

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 12:45:32 +02:00
admin 0428cf2a04 feat(02-02): social + safety UI — FollowButton, PetListItem, BlockDialog, ReportSheet, followers/following pages
- FollowButton: optimistic follow/unfollow, revert on error, AlertDialog unfollow confirm (SOCL-01/02)
- PetListItem: avatar + name + species badge + right-aligned FollowButton (SOCL-03)
- BlockDialog: AlertDialog with exact UI-SPEC copy, destructive Block CTA (SAFE-01)
- ReportSheet: 5 RadioGroup reasons, notes Textarea, destructive Submit CTA (SAFE-02)
- followers/page.tsx: RSC shell "{N} Followers" heading + FollowersList client (SOCL-03)
- following/page.tsx: RSC shell "Following {N}" heading + FollowingList client (SOCL-03)
- pets/[petId]/page.tsx: stats row (posts/followers/following) + ProfileActions (SOCL-03)
- ProfileActions: FollowButton + MoreHorizontal options menu + BlockDialog + ReportSheet
- Fix: test prisma cast to `as any` resolving TS2322 type errors (Rule 1 - Bug)
- tsc exits 0; vitest 36 passed
2026-06-07 12:37:45 +02:00
admin e9b286b4df feat(02-03): /feed page + home redirect + nav Home→/feed
- src/app/(app)/feed/page.tsx: RSC shell with StoryTray seam + FeedList, metadata "Home — PawFeed"
- src/app/page.tsx: redirect("/feed") per D-04 (home route → /feed after Phase 2)
- Sidebar.tsx: Home href "/" → "/feed"; active detection handles /feed and / (D-05)
- MobileNav.tsx: Home href "/" → "/feed"; active state updated for /feed (D-05)
- (app)/layout.tsx: unchanged — zero-pets redirect to /onboarding/pet preserved (D-06)
2026-06-07 12:37:04 +02:00
admin fd7dd2d56b feat(02-03): FeedList + SkeletonCard + EmptyFeed + PostCard placeholder
- FeedList: useInfiniteQuery + useInView sentinel, 3 skeleton loading, empty state, end-of-feed copy
- SkeletonCard: animate-pulse 80px header + image + 2 text lines per UI-SPEC
- EmptyFeed: "Your feed is empty" heading + Find Pets CTA to /explore (D-06)
- PostCard: minimal placeholder (header + single image + caption); marked TODO(02-04) for carousel
- feed.test.ts: any-cast for mock prisma (tsc clean on new code; 3 pre-existing errors unrelated)
2026-06-07 12:35:07 +02:00
admin c74fc0d750 feat(02-01): 7 test scaffolds + prisma-mock extension + react-intersection-observer + 7 shadcn components
- Extend src/__tests__/helpers/prisma-mock.ts with post, postImage, milestone, story, storyView, follow, block, report mocks
- Create 7 test scaffold files (21 it.todo stubs covering PHOTO-01..04, STORY-01..03, MILE-01, SOCL-01..03, FEED-01, SAFE-01..02)
- feed.test.ts mocks @/lib/redis — no real Upstash calls in tests
- Install react-intersection-observer ^10.0.3 (slopcheck [OK] per RESEARCH)
- Add shadcn components: carousel, sheet, alert-dialog, scroll-area, tabs, popover, radio-group
- All 7 test files load and run without import errors (21 todo, 0 failures)
2026-06-07 12:26:08 +02:00
admin eeab28e8cb chore: rename project from OnlyPets to PawFeed (domain: pawfeed.org) 2026-06-06 11:51:45 +02:00
admin 95e42f5474 fix(01-04): replace all R2/api-avatar URLs with Supabase Storage CDN via getAvatarUrl() 2026-06-06 11:38:37 +02:00
admin e3c279d6a4 feat(01-04): switch media storage from Cloudflare R2 to Supabase Storage 2026-06-06 11:32:17 +02:00
admin fb8bb5c8fe feat(01-04): wire CDN avatar into profile, edit page, sidebar, and mobile nav
- pets/[petId]/page.tsx: replace /api/avatar stub with NEXT_PUBLIC_R2_PUBLIC_URL CDN URL
- pets/[petId]/edit/page.tsx: pass initialAvatarKey to PetForm so AvatarUpload shows current photo
- Sidebar.tsx: add avatarKey to Pet type; show AvatarImage from CDN for active pet and dropdown list
- MobileNav.tsx: same CDN avatar pattern for mobile pet switcher
- next.config.ts: add images.remotePatterns for R2 CDN hostname (T-4-04 safeguard)
2026-06-06 11:10:28 +02:00
admin 1bd1a89c68 feat(01-04): AvatarUpload five-state component + wire into PetForm
- Create AvatarUpload.tsx: idle/dragging/uploading/error/idle-with-avatar states
- XHR PUT to R2 presigned URL with progress tracking (Content-Type must match presignedUrl)
- Two-step upload: getPresignedUrl -> XHR PUT -> confirmUpload -> CDN URL display
- Client-side validation: size <= 10MB, type jpeg/png/webp
- Disabled state in create mode (no petId) with tooltip
- Drag and drop: dragOver/dragLeave/onDrop handlers; orange border in dragging state
- Wire AvatarUpload into PetForm replacing AvatarUploadZone stub
- Add initialAvatarKey prop and currentAvatarKey state to PetForm
- onUploadComplete invalidates React Query cache (pets.byId + pets.list)
2026-06-06 11:08:56 +02:00
admin 485877a541 feat(01-04): tRPC media router with getPresignedUrl and confirmUpload
- Create src/trpc/routers/media.ts with server-only import (T-4-03)
- getPresignedUrl: ownership assertion, contentType enum (jpeg/png/webp), fileSize <= 10MB, UUID-scoped R2 key
- confirmUpload: ownership assertion, key.startsWith('avatars/') validation (T-4-05)
- Register media: mediaRouter in _app.ts appRouter
- Fix pre-existing TS error in PetForm.tsx: setSelectedSpeciesId(val ?? '') (Rule 1 bug)
2026-06-06 11:07:09 +02:00
admin d7eb00a5a3 feat(01-03): auto-capitalize first letter of pet name on input 2026-06-06 10:45:56 +02:00
admin a0fdc0b9c4 fix(01-03): resolve species/breed name directly from list in trigger — bypass Radix SelectValue bug 2026-06-06 10:42:22 +02:00
admin 9d51003ece fix(01-03): use empty string instead of undefined for Select value — prevents controlled/uncontrolled switch 2026-06-06 10:38:47 +02:00
admin c4588098ca fix(01-03): defer species/breed Select render until data loads — fixes CUID showing in trigger 2026-06-06 10:35:31 +02:00
admin 63d8c06b48 feat(01-03): add PetForm and PetCard components
- PetForm: create/edit mode, species/breed from DB (never hardcoded)
- Species selector wired to listSpecies tRPC query
- Breed selector wired to listBreeds, resets on species change
- Bio (maxLength=150) + adoption story (maxLength=500) with char counters
- Pet name maxLength=30 with Zod validation via react-hook-form
- AvatarUploadZone stub (Plan 04 wires upload; disabled in create mode)
- PetCard: avatar with active orange ring, species badge, hover shadow
2026-06-06 10:11:54 +02:00
admin e7d300f9c2 feat(01-02): protected app shell with sidebar, mobile nav, onboarding redirect
- (app)/layout.tsx: server component with auth() check + pets.list + redirect to /onboarding/pet if no pets
- Sidebar.tsx: 240px desktop nav (lg:), pet switcher with active state, nav links with orange-500 active indicator
- MobileNav.tsx: fixed bottom bar (h-16, lg:hidden), pet switcher above tabs, orange-500 center post button
- onboarding/pet/page.tsx: stub with Plan 03 placeholder (replaces walking skeleton client form)
- Deviation: base-nova shadcn uses @base-ui/react/menu (no asChild support) — used onClick+useRouter
- Deviation: Clerk 7 UserButton no longer accepts afterSignOutUrl
2026-06-06 08:57:38 +02:00
admin dbc074e9ee chore(01-01): scaffold Next.js 16 + install full stack + Vitest test scaffold
- Create-next-app Next.js 16.2.7 with TypeScript 6.0.3, React 19, Tailwind v4, Turbopack
- Install all pinned runtime deps: Clerk 7.4.3, tRPC 11.17.0, Prisma 7.8.0, Zod 4.4.3, AWS SDK 3.1062.0, Sonner 2.0.7, Upstash Redis 1.38.0
- Configure Tailwind v4 (postcss.config.mjs uses @tailwindcss/postcss; globals.css uses @import "tailwindcss")
- Initialize shadcn/ui with default preset; add all Phase 1 components (button, input, form, label, textarea, select, avatar, card, dialog, dropdown-menu, sonner, progress, separator, badge, skeleton)
- Set orange-500 design system: --primary: oklch(0.7024 0.1967 41.45); --background: oklch(0.9882 0 0)
- Load Inter via next/font/google in root layout
- Create vitest.config.ts with jsdom environment and @ path alias
- Create Wave 0 test scaffolds (22 it.todo tests): auth, pet-profile, media-upload + prisma-mock helper
- Create .env.example listing all required service env vars
2026-06-05 19:10:46 +02:00