Skip to content
Shell
7.1 KB
Raw Blame

Plan: Desktop Perplexity-Style Discover Page

Objective

Create a full-page desktop Discover experience inspired by Perplexity's Discover page, with mixed card layouts and a market-focused sidebar.

Design Reference

Based on Perplexity Discover desktop layout:

  • Hero card at top (featured article with large image)
  • 3-column grid of cards below hero
  • Horizontal cards for additional articles
  • Right sidebar with Weather, Market Outlook, Trending Companies

Architecture

┌──────────────────────────────────────────────────────────────────┐
│                        Discover Page                              │
├────────────────────────────────────┬─────────────────────────────┤
│           Main Content (2/3)       │      Sidebar (1/3)          │
│  ┌──────────────────────────────┐  │  ┌───────────────────────┐  │
│  │        Hero Card             │  │  │   Weather Widget      │  │
│  │   (Featured Article)         │  │  └───────────────────────┘  │
│  └──────────────────────────────┘  │  ┌───────────────────────┐  │
│  ┌────────┐ ┌────────┐ ┌────────┐  │  │  Market Outlook       │  │
│  │ Grid   │ │ Grid   │ │ Grid   │  │  │  - S&P 500 sparkline  │  │
│  │ Card   │ │ Card   │ │ Card   │  │  │  - NASDAQ sparkline   │  │
│  └────────┘ └────────┘ └────────┘  │  └───────────────────────┘  │
│  ┌──────────────────────────────┐  │  ┌───────────────────────┐  │
│  │  Horizontal Card (img+text)  │  │  │  Trending Companies   │  │
│  └──────────────────────────────┘  │  │  - AAPL +2.3%        │  │
│  ┌──────────────────────────────┐  │  │  - NVDA +1.8%        │  │
│  │  Horizontal Card (img+text)  │  │  └───────────────────────┘  │
│  └──────────────────────────────┘  │                              │
└────────────────────────────────────┴─────────────────────────────┘

Implementation Steps

Phase 1: Route & Layout

1.1 Create Discover Route

File: web/src/app/(app)/discover/page.tsx

  • Full-page Discover layout
  • Uses DiscoverLayout component

1.2 Create DiscoverLayout

File: web/src/components/discover/DiscoverLayout.tsx

  • 2-column flex layout: main content (flex-1) + sidebar (w-80)
  • Responsive: sidebar hidden on mobile/tablet

Phase 2: Header & Navigation

2.1 Create DiscoverHeader

File: web/src/components/discover/DiscoverHeader.tsx

  • "Discover" title
  • Tabs: "For You", "Top", "Tech", "Markets"
  • Reuse tab styling from NewsPanel

Phase 3: Card Components

3.1 DiscoverHeroCard

File: web/src/components/discover/DiscoverHeroCard.tsx

  • Full-width featured article
  • Large image (aspect-[21/9])
  • Headline overlay at bottom with gradient
  • Source + time + sentiment badge

3.2 DiscoverGridCard

File: web/src/components/discover/DiscoverGridCard.tsx

  • Square-ish card for 3-column grid
  • Image (aspect-[4/3])
  • Title below, source + time meta

3.3 DiscoverHorizontalCard

File: web/src/components/discover/DiscoverHorizontalCard.tsx

  • Image on left (w-48), content on right
  • Summary text included
  • Good for longer headlines

Phase 4: Feed Component

4.1 DiscoverFeed

File: web/src/components/discover/DiscoverFeed.tsx

  • Mixed layout pattern:
    1. Hero card (article 0)
    2. 3-column grid (articles 1-3)
    3. Horizontal cards (articles 4-5)
    4. Another grid row (articles 6-8)
    5. Repeat pattern...
  • Uses existing news-store for data
  • Infinite scroll with intersection observer

Phase 5: Sidebar Widgets

5.1 WeatherWidget

File: web/src/components/discover/widgets/WeatherWidget.tsx

  • Current temp + conditions icon
  • Location (default or geolocation)
  • Uses OpenWeather API or mock data

5.2 MarketOutlookWidget

File: web/src/components/discover/widgets/MarketOutlookWidget.tsx

  • S&P 500, NASDAQ, DOW mini sparklines
  • Use existing MiniChartWidget pattern
  • % change with color coding

5.3 TrendingCompaniesWidget

File: web/src/components/discover/widgets/TrendingCompaniesWidget.tsx

  • Top 5 trending stocks from news mentions
  • Company name + ticker + % change
  • Click to filter news by that stock

5.4 DiscoverSidebar

File: web/src/components/discover/DiscoverSidebar.tsx

  • Combines all sidebar widgets
  • Sticky positioning (top-4)
  • Gap spacing between widgets

Phase 6: Navigation Integration

6.1 Update DeepStackLayout

File: web/src/components/layout/DeepStackLayout.tsx

  • Add "Discover" link to sidebar navigation
  • Use Sparkles or Newspaper icon

Critical Files

File Action Lines
app/(app)/discover/page.tsx CREATE ~25
components/discover/DiscoverLayout.tsx CREATE ~50
components/discover/DiscoverHeader.tsx CREATE ~60
components/discover/DiscoverHeroCard.tsx CREATE ~90
components/discover/DiscoverGridCard.tsx CREATE ~70
components/discover/DiscoverHorizontalCard.tsx CREATE ~80
components/discover/DiscoverFeed.tsx CREATE ~130
components/discover/DiscoverSidebar.tsx CREATE ~45
components/discover/widgets/WeatherWidget.tsx CREATE ~70
components/discover/widgets/MarketOutlookWidget.tsx CREATE ~110
components/discover/widgets/TrendingCompaniesWidget.tsx CREATE ~90
components/layout/DeepStackLayout.tsx MODIFY ~5

Total: ~825 lines of new code

Existing Assets to Reuse

  • DiscoverCard.tsx - Already created for mobile (can reference patterns)
  • news-store.ts - Data source for articles
  • MiniChartWidget.tsx - Sparkline chart pattern
  • cn() utility for className merging
  • Shadcn components (Card, Badge, ScrollArea)

Execution Order

  1. Create route + layout structure
  2. Build card components (hero, grid, horizontal)
  3. Create DiscoverFeed with mixed layout
  4. Build sidebar widgets
  5. Integrate sidebar into layout
  6. Add navigation link
  7. Test + polish responsive behavior