Skip to content

Global Lantern Lighting & Scheduling โ€” Implementation Summary โ€‹

Implementation Date: January 3, 2026
Feature Status: โœ… Complete

Overview โ€‹

Expanded the Lantern Hub with full multi-step flows for lighting lanterns globally (not just from venue detail view) and scheduling future lights. Refactored existing form components to be reusable and composable.


What Was Built โ€‹

New Components โ€‹

  1. VenuePicker - Venue selection interface

    • List and map view modes
    • Search and category filtering
    • Shows active lantern counts
    • Reusable for both immediate and scheduled lighting
  2. LightLanternForm - Interest & mood form

    • Extracted from Dashboard (was embedded)
    • Reusable for immediate or scheduled lighting
    • Optional venue information display
    • Character counter (140 chars)
    • Three mood options: Conversation, Quiet Company, Activity/Game
  3. ScheduleLightForm - Schedule future light

    • Multi-step wizard (Venue โ†’ Date/Time โ†’ Interest/Mood)
    • Step progress indicators
    • Date/time validation (up to 30 days ahead)
    • Preview of scheduled time
    • Connects to VenuePicker and LightLanternForm

Updated Components โ€‹

  1. LanternHub

    • Now triggers full flows for "Light Lantern" and "Schedule a Light"
    • Added handlers for waves and chats (future navigation)
    • Updated props to support new interactions
  2. Dashboard

    • Removed embedded LightLanternForm (now imported)
    • Added state management for multi-step flows
    • Integrated all new components
    • Maintains existing venue detail โ†’ light flow
    • Added global flows via Lantern Hub

Storybook Stories โ€‹


User Flows โ€‹

Flow 1: Global Light Lantern (from Lantern Hub) โ€‹

Tap Fire Icon โ†’ Lantern Hub Opens
     โ†“
Tap "Light Lantern"
     โ†“
Venue Picker โ†’ Select Venue
     โ†“
Light Lantern Form โ†’ Set Interest & Mood
     โ†“
Confirm โ†’ Lantern Lit โœจ

Steps:

  1. User taps extinguished fire icon
  2. Lantern Hub opens (no active lantern view)
  3. User taps "Light Lantern" primary CTA
  4. VenuePicker opens showing all nearby venues
    • Can search, filter by category, switch list/map view
  5. User selects a venue
  6. LightLanternForm opens with venue info
    • User selects mood
    • User writes interest message (max 140 chars)
  7. User taps "Activate Lantern"
  8. Lantern is lit, fire icon glows
  9. User moved to ActiveLanternView

Flow 2: Schedule a Light (Future) โ€‹

Tap Fire Icon โ†’ Lantern Hub Opens
     โ†“
Tap "Schedule a Light"
     โ†“
Schedule Form Step 1 โ†’ Select Venue
     โ†“
Schedule Form Step 2 โ†’ Pick Date & Time
     โ†“
Light Lantern Form โ†’ Set Interest & Mood
     โ†“
Confirm โ†’ Scheduled Light Saved ๐Ÿ“…

Steps:

  1. User taps fire icon
  2. Lantern Hub opens
  3. User taps "Schedule a Light"
  4. ScheduleLightForm opens (Step 1: Venue)
    • User taps "Select Venue"
    • VenuePicker opens
    • User selects venue
    • Returns to Schedule Form
  5. Step 2: Date & Time
    • User picks date (up to 30 days ahead)
    • User picks time
    • Preview shows formatted date/time
  6. User taps "Continue to Set Interest"
  7. LightLanternForm opens
    • User sets interest and mood
  8. User taps "Activate Lantern"
  9. Scheduled light saved to upcomingLights
  10. Shows in Lantern Hub "Upcoming" section
  11. TODO: Backend saves, push notification at scheduled time

Flow 3: Existing Venue Detail โ†’ Light (Unchanged) โ€‹

Browse Venues โ†’ Tap Venue
     โ†“
Venue Detail View
     โ†“
Tap "Light My Lantern"
     โ†“
Light Lantern Form โ†’ Set Interest & Mood
     โ†“
Confirm โ†’ Lantern Lit โœจ

This flow still works as before, now using the extracted LightLanternForm component.


Component Architecture โ€‹

Component Hierarchy โ€‹

Dashboard
โ”œโ”€โ”€ LanternHub (modal)
โ”‚   โ””โ”€โ”€ Triggers flows โ†’
โ”‚       โ”œโ”€โ”€ VenuePicker
โ”‚       โ”œโ”€โ”€ LightLanternForm
โ”‚       โ””โ”€โ”€ ScheduleLightForm
โ”‚           โ”œโ”€โ”€ VenuePicker (nested)
โ”‚           โ””โ”€โ”€ LightLanternForm (nested)
โ”œโ”€โ”€ VenuePicker (full-screen)
โ”œโ”€โ”€ LightLanternForm (full-screen)
โ”œโ”€โ”€ ScheduleLightForm (full-screen)
โ””โ”€โ”€ ... existing components

State Management in Dashboard โ€‹

javascript
// Form flow states
const [showVenuePicker, setShowVenuePicker] = useState(false)
const [showLightForm, setShowLightForm] = useState(false)
const [showScheduleForm, setShowScheduleForm] = useState(false)
const [venueForLight, setVenueForLight] = useState(null)
const [scheduleData, setScheduleData] = useState(null)

// Upcoming scheduled lights
const [upcomingLights, setUpcomingLights] = useState([])

Component Props โ€‹

VenuePicker:

typescript
{
  venues: Venue[]
  onSelectVenue: (venue: Venue) => void
  onCancel: () => void
  title?: string
  description?: string
}

LightLanternForm:

typescript
{
  venue?: Venue | null
  onCancel: () => void
  onConfirm: (data: { interest, mood, moodId }) => void
  showVenueInfo?: boolean
  initialInterest?: string
  initialMood?: string
}

ScheduleLightForm:

typescript
{
  onCancel: () => void
  onConfirm: (data: { date, time }) => void
  onSelectVenue: () => void
  selectedVenue?: Venue | null
}

Key Features โ€‹

โœ… VenuePicker โ€‹

  • Dual view modes: List and map (radar style)
  • Search: Real-time filtering by venue name/type
  • Category filters: All, Cafe, Bar, Food, Activities
  • Visual indicators: Shows active lantern counts
  • Map visualization: Radar-style with venue dots
  • Responsive: Full-screen mobile optimized

โœ… LightLanternForm โ€‹

  • Reusable: Works for immediate or scheduled lighting
  • Optional venue info: Can hide venue details
  • Three moods: Conversation, Quiet Company, Activity/Game
  • Character limit: 140 characters with counter
  • Auto-focus: Interest textarea focused on open
  • Validation: Disables submit until interest is entered

โœ… ScheduleLightForm โ€‹

  • Multi-step wizard: Clear progress indicators
  • Venue selection: Integrates with VenuePicker
  • Date validation: Min = today, Max = 30 days
  • Time picker: HTML5 time input
  • Preview: Shows formatted scheduled time
  • Flexible: Can change venue during flow

โœ… Integration โ€‹

  • Seamless transitions: Components open/close smoothly
  • Preserved state: Venue selection carries through flow
  • Context-aware: Forms know if immediate or scheduled
  • Backend-ready: TODOs marked for API integration

Future Enhancements โ€‹

Near-Term โ€‹

  • [ ] Backend API integration for scheduled lights
  • [ ] Push notifications at scheduled time
  • [ ] Edit/delete scheduled lights
  • [ ] Auto-light lantern at scheduled time (with confirmation)
  • [ ] Geofence check before lighting

Mid-Term โ€‹

  • [ ] Recurring scheduled lights ("Every Tuesday at 6 PM")
  • [ ] Scheduled light reminders (30 min before)
  • [ ] Friend suggestions for scheduled lights
  • [ ] Venue event integration (auto-fill from venue events)

Long-Term โ€‹

  • [ ] Group scheduled lights (meetup planning)
  • [ ] Calendar app integration (export to Google/Apple Calendar)
  • [ ] Merchant-sponsored scheduled events
  • [ ] AI suggestions for schedule times based on activity

Testing โ€‹

Manual Testing Checklist โ€‹

VenuePicker:

  • [ ] List view displays all venues
  • [ ] Map view shows venue dots correctly
  • [ ] Search filters venues in real-time
  • [ ] Category filters work (All, Cafe, Bar, Food, Activities)
  • [ ] Selecting venue triggers callback
  • [ ] Cancel closes picker
  • [ ] View mode toggle works

LightLanternForm:

  • [ ] Venue info displays correctly
  • [ ] Mood selection works (visual feedback)
  • [ ] Interest textarea accepts input
  • [ ] Character counter updates
  • [ ] Submit disabled when interest empty
  • [ ] Form submits with correct data structure
  • [ ] Cancel triggers callback

ScheduleLightForm:

  • [ ] Step 1: Venue selection works
  • [ ] Can change venue after selection
  • [ ] Step 2: Date/time inputs work
  • [ ] Date validation (min/max)
  • [ ] Preview shows formatted time
  • [ ] Progress indicators update correctly
  • [ ] Continue button enables when valid

Integration:

  • [ ] Hub โ†’ Light Lantern โ†’ Venue Picker โ†’ Form โ†’ Confirm
  • [ ] Hub โ†’ Schedule โ†’ Venue โ†’ Date/Time โ†’ Form โ†’ Save
  • [ ] Scheduled lights show in "Upcoming" section
  • [ ] Existing venue detail flow still works
  • [ ] Fire icon glows when lantern lit
  • [ ] All cancel buttons properly close flows

Storybook Testing โ€‹

bash
npm run storybook

Navigate to:

  • Components โ†’ VenuePicker (4 stories)
  • Components โ†’ LightLanternForm (4 stories)
  • Components โ†’ ScheduleLightForm (3 stories)

Code Organization & Refactoring โ€‹

Before vs. After โ€‹

Before:

  • LightLanternForm embedded in Dashboard.jsx
  • No global light lantern flow
  • No schedule light functionality
  • Lantern Hub just placeholders

After:

  • LightLanternForm extracted to /components
  • VenuePicker new reusable component
  • ScheduleLightForm new multi-step wizard
  • Lantern Hub triggers complete flows
  • Dashboard orchestrates all flows

Benefits of Refactoring โ€‹

  1. Reusability: Components used in multiple contexts
  2. Testability: Individual components in Storybook
  3. Maintainability: Single source of truth for each form
  4. Scalability: Easy to add new flows (e.g., edit scheduled light)
  5. Separation of Concerns: Dashboard orchestrates, components render

API Integration (Future) โ€‹

Endpoints Needed โ€‹

POST   /api/lanterns/schedule     # Schedule a lantern
GET    /api/lanterns/scheduled    # Get user's scheduled lights
PUT    /api/lanterns/scheduled/:id # Edit scheduled light
DELETE /api/lanterns/scheduled/:id # Cancel scheduled light
POST   /api/lanterns/schedule/:id/activate  # Manually activate early

Data Structure for Scheduled Light โ€‹

javascript
{
  id: string,
  userId: string,
  venueId: string,
  venueName: string,
  scheduledDateTime: ISO8601,
  interest: string,
  mood: string,
  moodId: string,
  status: 'pending' | 'active' | 'cancelled' | 'completed',
  createdAt: ISO8601,
  notificationSent: boolean
}

Backend Tasks โ€‹

  • Scheduled task processor (check for lights due to activate)
  • Push notification service (remind user 30min before)
  • Geofence validation (ensure user is near venue)
  • Auto-activate or prompt user at scheduled time


Files Changed โ€‹

New Files Created (7) โ€‹

  • src/components/VenuePicker.jsx
  • src/components/VenuePicker.stories.jsx
  • src/components/LightLanternForm.jsx
  • src/components/LightLanternForm.stories.jsx
  • src/components/ScheduleLightForm.jsx
  • src/components/ScheduleLightForm.stories.jsx
  • docs/features/GLOBAL_LANTERN_FLOWS.md (this file)

Modified Files (2) โ€‹

  • src/components/LanternHub.jsx - Added navigation handlers
  • src/dashboard/Dashboard.jsx - Integrated new components, refactored flows

Conclusion โ€‹

The Lantern Hub now provides complete, production-ready flows for:

  • โœ… Global lantern lighting (not tied to specific venue detail view)
  • โœ… Scheduling future lights
  • โœ… Reusable components for all lighting scenarios

Users can now access all lantern features from the fire icon, making the app more intuitive and the navigation cleaner. The multi-step flows guide users smoothly through venue selection, interest/mood setup, and confirmation.

Next steps include backend integration, push notifications, and advanced features like recurring schedules and friend suggestions.

Built with VitePress