Skip to content

Add social, collaborative, and gift-registry wishlist capabilities#28

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/add-social-sharing-features
Draft

Add social, collaborative, and gift-registry wishlist capabilities#28
Copilot wants to merge 3 commits into
mainfrom
copilot/add-social-sharing-features

Conversation

Copy link
Copy Markdown

Copilot AI commented May 27, 2026

This change introduces first-class wishlist sharing and collaboration: public/unlisted links, gift registry workflows, collaborator editing, and social distribution surfaces. It also adds privacy/security controls and analytics so shared wishlists are safe to expose and measurable.

  • Backend data model + API surface

    • Added Wishlist, WishlistItem, and WishlistShare models with sharing, collaborator, and registry fields.
    • Added /api/wishlists endpoints for create/list/update/delete, sharing, collaborator management, reserve/purchase/unreserve, registry stats, item comments, and activity feed.
    • Added share-token based public view endpoint and OG image generation endpoint for social previews.
  • Registry + collaboration behavior

    • Added reservation/purchase state transitions (reservedBy, reservedUntil, isPurchased, purchasedBy, purchasedAt).
    • Added collaborator edit paths (add/remove collaborators, item add/remove, item comments).
    • Added activity tracking for collaborative updates.
  • Security, privacy, and governance

    • Added UUID share token validation and owner-triggered share revocation.
    • Added per-link public view rate limiting.
    • Added reservation cleanup for expired holds.
    • Added public-view redaction behavior (sensitive item fields + optional hidden prices).
    • Added CAPTCHA-token requirement gates for registry actions.
    • Escaped user-controlled values in generated SVG OG image output.
  • Frontend wishlist feature set

    • Added WishlistManager, WishlistSettingsModal, ShareWishlist, PublicWishlistView, GiftRegistryView, and CollaborativeWishlist.
    • Added social sharing UX: copy link, QR code (react-qr-code), email share, and Facebook/Twitter/WhatsApp entry points.
    • Added public shared page with Open Graph/Twitter/Pinterest metadata handling and “copy to my wishlist”.
    • Added navigation support for multi-wishlist access, item-count badge, quick-add, and quick list creation.
    • Added frontend/src/api/wishlists.ts client and wired routes in App.tsx.
  • Documentation

    • Updated README with wishlist social feature coverage and behavior summary.
// Example: share + public retrieval contract
POST /api/wishlists/:id/share
{
  "userId": "owner-1",
  "shareMethod": "social",
  "expiresAt": "2026-12-31T23:59:59.000Z"
}

GET /api/wishlists/shared/:token
// -> { wishlist: <public-redacted>, shareAnalytics: { totalViews, shareCount } }
Original prompt

Add social and sharing features to wishlists: public URLs, gift registry mode, collaborative wishlists, and social sharing.

Goal: Enable users to share wishlists, create gift registries, and collaborate with others on product lists.

Requirements:

  1. Enhanced Data Model:

    interface Wishlist {
      wishlistId: number;
      userId: string;
      name: string;                 // Custom wishlist name
      description?: string;         // Wishlist description
      visibility: 'private' | 'public' | 'unlisted';
      shareToken: string;           // UUID for sharing
      isGiftRegistry: boolean;      // Gift registry mode
      eventDate?: string;           // For gift registries
      collaborators: string[];      // User IDs with edit access
      createdAt: string;
      updatedAt: string;
    }
    
    interface WishlistItem {
      // ... existing fields
      isPurchased: boolean;         // For gift registry
      purchasedBy?: string;         // User ID who bought it
      purchasedAt?: string;         // Purchase timestamp
      reservedBy?: string;          // Temporary reservation
      reservedUntil?: string;       // Reservation expiry
    }
    
    interface WishlistShare {
      shareId: number;
      wishlistId: number;
      shareToken: string;
      sharedBy: string;
      sharedWith?: string;          // Optional recipient
      shareMethod: 'link' | 'email' | 'social';
      createdAt: string;
      expiresAt?: string;
      views: number;
    }
  2. Backend API Endpoints:

    • Wishlist Management:

      • POST /api/wishlists - Create named wishlist
      • GET /api/wishlists/:userId - Get user's wishlists
      • PATCH /api/wishlists/:id - Update wishlist settings
      • DELETE /api/wishlists/:id - Delete wishlist
    • Sharing:

      • POST /api/wishlists/:id/share - Generate share link
      • GET /api/wishlists/shared/:token - View shared wishlist (public)
      • POST /api/wishlists/:id/collaborators - Add collaborator
      • DELETE /api/wishlists/:id/collaborators/:userId - Remove collaborator
    • Gift Registry:

      • POST /api/wishlists/:id/items/:itemId/reserve - Reserve item
      • POST /api/wishlists/:id/items/:itemId/purchase - Mark as purchased
      • DELETE /api/wishlists/:id/items/:itemId/unreserve - Cancel reservation
      • GET /api/wishlists/:id/registry-stats - Get purchase status
  3. Frontend Components:

    • Components/WishlistManager.tsx:

      • List all user's wishlists
      • Create new wishlist with name/description
      • Switch between wishlists
      • Set default wishlist
    • Components/ShareWishlist.tsx:

      • Generate shareable link (copy to clipboard)
      • QR code for easy sharing
      • Share via email (opens mailto)
      • Share to social media (Facebook, Twitter, WhatsApp)
      • Set expiration date for share links
      • View share analytics (views, clicks)
    • Components/PublicWishlistView.tsx:

      • Public-facing wishlist view (no edit)
      • Show items with prices
      • Hide sensitive info (notes, target prices)
      • "Buy as Gift" buttons (external links)
      • Visitor counter
      • Option to copy list to own wishlist
    • Components/GiftRegistryView.tsx:

      • Show purchased vs available items
      • Reserve item button (24-hour hold)
      • "I bought this" button (marks as purchased)
      • Show who purchased (optional)
      • Progress bar (X of Y items purchased)
      • Thank you message from list owner
    • Components/CollaborativeWishlist.tsx:

      • Add collaborators by email
      • Show who added each item
      • Real-time updates (websocket or polling)
      • Activity feed (X added Y, Z removed W)
      • Collaborator permissions (view/edit)
      • Comments on items
  4. Wishlist Settings Modal:

    • Wishlist name and description
    • Visibility toggle (private/public/unlisted)
    • Gift registry mode toggle
    • Event date picker (for registries)
    • Thank you message customization
    • Share link management
    • Collaborator management
  5. Navigation Updates:

    • Multiple wishlist selector in nav
    • Badge showing total items across all lists
    • Quick-add to specific wishlist
    • "Create new list" shortcut
  6. Social Sharing Integration:

    • Open Graph meta tags for link previews
    • Twitter Card support
    • WhatsApp preview optimization
    • Pinterest Rich Pins
    • Generate og:image with wishlist preview
  7. Security & Privacy:

    • Validate share tokens
    • Rate limit public wishlist views
    • Allow owners to revoke share links
    • Hide user emails in public views
    • Option to hide prices in public view
    • CAPTCHA for gift registry actions (prevent abuse)
  8. Analytics:

    • Track share method usage
    • Track wishlist views
    • Track items purchased through registry
    • Most shared products
    • Conversion rate (view → purchase)

Technical Notes:

  • Generate UUIDs for share tokens (use crypto.randomUUID())
  • Implem...

Copilot AI and others added 2 commits May 27, 2026 18:07
Co-authored-by: thomasiverson <12767513+thomasiverson@users.noreply.github.com>
Co-authored-by: thomasiverson <12767513+thomasiverson@users.noreply.github.com>
Copilot AI changed the title [WIP] Add social and sharing features to wishlists Add social, collaborative, and gift-registry wishlist capabilities May 27, 2026
Copilot AI requested a review from thomasiverson May 27, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants