Skip to content

Bug Fixes - Lantern Global Flows ​

Date: January 3, 2026
Status: βœ… Fixed

Bugs Identified and Fixed ​

Bug 1: Schedule Form Not Transitioning to Date/Time Step ​

Symptom: User clicks "Schedule a Light" β†’ Opens schedule form β†’ Clicks "Select Venue" β†’ VenuePicker opens and closes, but form doesn't progress to date/time step.

Root Cause:

  • handleContinue() in ScheduleLightForm only handled the datetimeβ†’complete transition
  • Button logic didn't call setStep('datetime') when venue was selected
  • VenuePicker and ScheduleForm weren't properly coordinated

Fix Applied:

  1. Updated handleContinue() to handle both transitions:
    • If step === 'venue' and venue selected β†’ move to 'datetime'
    • If step === 'datetime' and date/time valid β†’ confirm
  2. Fixed button logic to check step state instead of component props
  3. Added useEffect in ScheduleLightForm to auto-advance when venue is selected
  4. Updated Dashboard handlers to properly set showScheduleForm = true when returning from venue picker in schedule context

Files Changed:

  • src/components/ScheduleLightForm.jsx - Updated handleContinue(), button logic, added useEffect
  • src/dashboard/Dashboard.jsx - Updated handleVenuePickerSelect() to check context

Bug 2: Light Lantern Form Not Submitting in Global Flow ​

Symptom: User taps "Light Lantern" β†’ VenuePicker β†’ LightLanternForm opens but has no working submit button or the flow doesn't complete.

Root Cause:

  • LightLanternForm was properly rendering but the onConfirm handler in Dashboard had conflicting logic
  • handleLightFormConfirm() wasn't using venueForLight (it might have referenced selectedVenue which wasn't set in global flow)
  • After confirmation, selectedVenue might not be set, causing ActiveLanternView to not render properly

Fix Applied:

  1. Updated handleLightFormConfirm() to explicitly set selectedVenue after lantern is lit
  2. Ensured venueName is properly saved to myLantern state
  3. Made sure state cleanup happens after confirmation

Files Changed:

  • src/dashboard/Dashboard.jsx - Updated handleLightFormConfirm() to set selectedVenue for compatibility with ActiveLanternView

How to Test the Fixes ​

Test 1: Light Lantern Global Flow βœ… ​

Steps:

  1. App is on home view (places screen)
  2. Tap the extinguished fire icon (bottom center)
  3. Lantern Hub opens β†’ Tap "Light Lantern"
  4. VenuePicker opens
  5. Select any venue (e.g., "The Midnight Bean")
  6. LightLanternForm appears with venue info
  7. Select a mood (Conversation, Quiet Company, or Activity)
  8. Type an interest message (e.g., "Looking for a coding buddy")
  9. Tap "Activate Lantern" button
  10. βœ… Form submits, fire icon glows, ActiveLanternView shows your lit lantern

Expected Result: Lantern is lit, fire icon shows glow animation, view switches to active lantern display.


Test 2: Schedule Light Flow βœ… ​

Steps:

  1. App is on home view
  2. Tap the extinguished fire icon (bottom center)
  3. Lantern Hub opens β†’ Tap "Schedule a Light"
  4. ScheduleLightForm opens showing Step 1: Venue Selection
  5. Tap "Select Venue" button
  6. VenuePicker opens
  7. Select a venue (e.g., "Yoga Studio" or any venue)
  8. VenuePicker closes, ScheduleLightForm reappears at Step 2: Date & Time
  9. βœ… Form now shows date/time inputs (was bug - previously didn't advance)
  10. Select a date in the future (within 30 days)
  11. Select a time
  12. Tap "Continue to Set Interest" button
  13. LightLanternForm appears
  14. Select mood and write interest message
  15. Tap "Activate Lantern" button
  16. βœ… Scheduled light is saved, shows in "Upcoming" section of Lantern Hub

Expected Result: Scheduled light is saved with venue, date, time, interest, and mood. Shows in upcoming lights list.


Test 3: Existing Venue Detail Flow (Regression Test) βœ… ​

Steps:

  1. App on home view (places screen)
  2. Browse venues and click on one (e.g., "The Midnight Bean")
  3. VenueView opens with venue details
  4. Tap "Light My Lantern" button
  5. LightLanternForm opens with venue pre-filled
  6. Select mood and write interest
  7. Tap "Activate Lantern"
  8. βœ… Lantern lights, fire icon glows, ActiveLanternView shows

Expected Result: Existing flow still works, no regressions.


Test 4: Extinguish Lantern ​

Steps:

  1. Lantern is lit (fire icon glowing)
  2. Tap glowing fire icon
  3. Lantern Hub shows active lantern view
  4. Scroll down, tap "Extinguish Lantern"
  5. βœ… Lantern goes out, fire icon returns to gray, view goes back to home

Expected Result: Lantern extinguished, fire icon dims, hub closes.


Test 5: Lantern Hub Navigation ​

Steps:

  1. Tap glowing fire icon (when lantern is lit)
  2. Lantern Hub opens showing:
    • Current lantern status card
    • Any waves received (if any)
    • Any active chats (if any)
    • Upcoming scheduled lights (if any)
  3. βœ… All sections display correctly based on state

Expected Result: Hub shows accurate info for lit lantern.


Technical Details of Fixes ​

ScheduleLightForm Transition Logic ​

javascript
// OLD - Didn't handle venue→datetime transition
const handleContinue = () => {
  if (step === 'datetime' && date && time) {
    onConfirm({ date, time })
  }
}

// NEW - Handles both transitions
const handleContinue = () => {
  if (step === 'venue' && selectedVenue) {
    setStep('datetime')  // ← NEW: Move to next step
  } else if (step === 'datetime' && date && time) {
    onConfirm({ date, time })
  }
}

// Added useEffect to auto-advance when venue is selected
useEffect(() => {
  if (selectedVenue && step === 'venue') {
    setStep('datetime')
  }
}, [selectedVenue, step])

Dashboard Context Handling ​

javascript
// OLD - Didn't distinguish between light and schedule contexts
const handleVenuePickerSelect = (venue) => {
  setVenueForLight(venue)
  setShowVenuePicker(false)
  setShowLightForm(true)  // Always opened light form
}

// NEW - Checks context to open appropriate next form
const handleVenuePickerSelect = (venue) => {
  setVenueForLight(venue)
  setShowVenuePicker(false)
  // Check if we're coming from schedule form or direct light
  if (scheduleData || showScheduleForm) {
    setShowScheduleForm(true)  // Go back to schedule
  } else {
    setShowLightForm(true)     // Go to light form
  }
}

Light Form Confirmation ​

javascript
// Fixed to ensure selectedVenue is set for ActiveLanternView
const handleLightFormConfirm = (data) => {
  setMyLantern({
    ...data,
    venueId: venueForLight.id,
    venueName: venueForLight.name,
    startTime: new Date()
  })
  setShowLightForm(false)
  setVenueForLight(null)
  setSelectedVenue(venueForLight) // ← NEW: For compatibility
  setView('active')
}

Verification Checklist ​

  • [x] Schedule form transitions from venue β†’ datetime β†’ interest
  • [x] Light lantern form submits properly in global flow
  • [x] Scheduled lights are saved to upcoming list
  • [x] Existing venue detail β†’ light flow still works
  • [x] Fire icon glows when lantern is lit
  • [x] Fire icon dims when lantern is extinguished
  • [x] Hub displays correct info based on lantern state
  • [x] All cancel buttons work
  • [x] Date validation works (min=today, max=30 days)
  • [x] No console errors

Edge Cases to Consider ​

  1. User cancels at any step

    • βœ… Cancel buttons work at all steps
    • βœ… State is properly cleaned up
  2. User selects venue, then changes mind

    • βœ… Can tap "Change" to re-open venue picker
    • βœ… Flow resumes correctly
  3. Schedule form with no upcoming lights

    • βœ… "Upcoming" section doesn't show
    • βœ… User can still add first scheduled light
  4. Time validation

    • βœ… Can't select past dates
    • βœ… Can't select more than 30 days ahead
    • βœ… Submit disabled until both date and time selected

Built with VitePress