Ground News-Style Homepage Redesign
Overviewβ
The homepage has been redesigned to follow the Ground News pattern with trending topics, a featured hero story, and a news grid layout. This creates a more engaging, content-forward experience while maintaining search functionality.
What Changedβ
1. Trending Topics Barβ
Two rows of trending topics at the top of the page with + icons to subscribe/follow:
First Row:
- World Press Freedom Day π°
- Business & Markets πΌ
- Artificial Intelligence π€
- Health & Medicine βοΈ
- Premier League β½
- Soccer β½
Second Row:
- Baseball βΎ
- Donald Trump ποΈ
- IPL π
- Social Media π±
- Trump Administration πΊπΈ
- "Follow Topics" button
Each topic:
- Has an emoji icon
- Shows + sign on hover
- Clickable to search that topic
- Professional pill-shaped design
2. Featured Hero Storyβ
Large banner with:
- 1200x600px hero image with overlay
- Gradient background from black to transparent
- Large headline overlay (3-5xl text)
- Subtitle with context
- Category badge (top left)
- Hover effects (image opacity, text color)
Example:
Category: Civic Engagement
Title: "World Press Freedom Day: 43,726 Nonprofits Fighting for Transparency"
Subtitle: "How local journalism and civic organizations are tracking government decisions..."
3. Top Stories Gridβ
3-column responsive grid with 6 story cards:
- Small image (400x300px) for each story
- Topic badge overlay on image
- Story title (2-line max with line-clamp)
- Hover effects (shadow, scale, color change)
Topics covered:
- Artificial Intelligence
- Health & Medicine
- Sports & Recreation
- Social Media
- Business Development
- Government Transparency
4. Search Section (Moved Lower)β
The original search interface is now in a collapsible section lower on the page:
- Still has both tabs (Search Topics, Find My Community)
- Maintains all functionality
- More subdued background (gray instead of white)
- Search-forward β Content-forward shift
Technical Implementationβ
New Icons Addedβ
import {
PlusIcon, // For "subscribe/follow" buttons
BellIcon, // For "Follow Topics" button
FireIcon // For "Trending" indicator
} from '@heroicons/react/24/outline'
Data Structuresβ
TRENDING_TOPICS array:
{
name: string, // "World Press Freedom Day"
icon: string, // "π°"
category: string // "Global"
}
FEATURED_STORY object:
{
title: string,
subtitle: string,
image: string, // URL to hero image
category: string,
link: string // Internal route
}
TOP_STORIES array:
{
title: string,
topic: string, // Displayed as badge
image: string, // 400x300px thumbnail
link: string
}
Styling Featuresβ
-
Trending Bar:
bg-gray-50 border-bfor subtle separation- Pill-shaped buttons with
rounded-full - Hover state with
border-primary-500
-
Hero Banner:
h-[500px]fixed heightbg-gradient-to-t from-blackfor text readabilitygroup-hover:opacity-50for imagegroup-hover:text-primary-300for headline
-
Story Cards:
hover:shadow-lgfor elevationgroup-hover:scale-105on imagesline-clamp-2for title truncation
Image Generationβ
New Script: scripts/media/generate_topic_images.pyβ
Generates professional banner and square images for topics using Google Gemini AI.
Features:
- AI-powered color scheme generation
- Banner images (1200x600px)
- Square thumbnails (400x400px)
- Gradient backgrounds
- Smart text wrapping
- Batch processing
Usage:
# Single topic
python scripts/media/generate_topic_images.py --topic "World Press Freedom Day"
# Batch from file
python scripts/media/generate_topic_images.py --topics-file topics.txt
# Default trending topics
python scripts/media/generate_topic_images.py
Requirements:
- Google Gemini API key in
.env:GEMINI_API_KEY=your_key - Auto-installs:
google-generativeai,pillow,requests
Output:
data/media/topics/
βββ world_press_freedom_day_banner.png (1200x600)
βββ world_press_freedom_day_square.png (400x400)
βββ artificial_intelligence_banner.png
βββ artificial_intelligence_square.png
βββ metadata.json (color schemes, paths)
Color Scheme Generationβ
Gemini analyzes each topic and suggests:
- Primary color: Main gradient start
- Secondary color: Gradient end
- Text color: High contrast for readability
- Background color: Base tone
- Reasoning: Why these colors fit the topic
Examples:
- Politics: Professional blues (#2563EB) and reds
- Health: Calming greens and blues
- Technology: Modern purples (#7C3AED) and blues
- Sports: Energetic oranges and reds
Using Generated Imagesβ
Update Homepage Dataβ
Replace placeholder Unsplash images with generated ones:
const FEATURED_STORY = {
title: 'World Press Freedom Day...',
image: '/images/topics/world_press_freedom_day_banner.png', // β Use generated
// ...
}
const TOP_STORIES = [
{
title: 'AI Policy Tracking...',
image: '/images/topics/artificial_intelligence_square.png', // β Use generated
// ...
}
]
Integration Stepsβ
-
Generate images:
cd /home/developer/projects/open-navigatorsource .venv/bin/activatepython scripts/media/generate_topic_images.py -
Copy to frontend:
mkdir -p frontend/public/images/topicscp data/media/topics/*.png frontend/public/images/topics/ -
Update Home.tsx:
- Change image URLs from
https://images.unsplash.com/... - To
/images/topics/{topic}_square.pngor{topic}_banner.png
- Change image URLs from
-
Rebuild:
cd frontend && npm run build
Benefitsβ
User Experienceβ
- Content Discovery: Users see trending topics immediately
- Visual Engagement: Large hero image draws attention
- Quick Navigation: Click topics to search instantly
- Personalization: + buttons suggest following/subscribing
- Familiar Pattern: Matches news aggregators users know
Technical Benefitsβ
- SEO: Content-forward design better for crawlers
- Performance: Images lazy-load below fold
- Flexibility: Easy to update trending topics
- Branding: Custom generated images (no stock photo licenses)
- Accessibility: High contrast, semantic HTML
Future Enhancementsβ
Phase 2: Dynamic Contentβ
- Pull trending topics from actual search data
- Featured story from latest government decisions
- Top stories from recent meeting minutes
- Real-time topic popularity tracking
Phase 3: Personalizationβ
- User can follow/subscribe to topics
- Save "+ Follow" state to user preferences
- Customized feed based on followed topics
- Email/push notifications for followed topics
Phase 4: Advanced Image Generationβ
- Use Imagen 2 when available in Gemini API
- Real-time image generation on topic creation
- Video thumbnails from meeting recordings
- Animated topic badges (WebP/GIF)
Design Inspirationβ
Based on Ground News:
- Trending topics bar at top
- Large hero story with image overlay
- Grid of smaller story cards
- Clean, professional news aesthetic
- Content-first approach
Migration Notesβ
Breaking Changesβ
- None! Search functionality preserved
- Existing routes still work
- All components intact
Deprecationsβ
- None
Backward Compatibilityβ
- 100% compatible
- Search moved lower but fully functional
- All existing links work
Examplesβ
Before (Search-First)β
+----------------------------------+
| Open Navigator |
| Search box (prominent) |
| Tabs: Search / Location |
| Quick topic pills |
| Stats section |
+----------------------------------+
After (Content-First)β
+----------------------------------+
| Trending: [Topic] [Topic] [+] |
| [Topic] [Topic] [Topic] [+] |
+----------------------------------+
| [HERO IMAGE WITH HEADLINE] |
| Large featured story |
+----------------------------------+
| Top Stories Grid |
| [img] [img] [img] |
| Story Story Story |
+----------------------------------+
| Search Section (collapsible) |
| Features Grid |
| Stats |
+----------------------------------+
Testingβ
Manual Testsβ
-
Trending Topics
- Click each topic β should navigate to search
- Hover β should show border/background change
-
- icon β should be visible
-
Hero Banner
- Image loads correctly
- Text is readable over image
- Hover effects work
- Link goes to correct search
-
Story Grid
- All 6 stories display
- Images load
- Topic badges visible
- Hover effects (shadow, scale)
-
Search Still Works
- Both tabs functional
- Location lookup works
- Search results correct
Automated Testsβ
Build verification:
cd frontend
npx tsc --noEmit # TypeScript check
npm run build # Vite build
Deploymentβ
HuggingFace Spacesβ
No changes needed! Same deployment process:
./packages/hosting/scripts/huggingface/safe-deploy.sh
The Docker build will include:
- Updated Home.tsx
- Generated topic images (if copied to frontend/public)
- All existing functionality
Local Developmentβ
./start-all.sh # Starts all 3 services
# Visit http://localhost:5173
Resourcesβ
- Script:
scripts/media/generate_topic_images.py - README:
scripts/media/README.md - Component:
frontend/src/pages/Home.tsx - Icons: Heroicons 24 outline
- Images: Unsplash (placeholder) β Generated (production)
Questions?β
See scripts/media/README.md for image generation details.