Component Refactoring & Organization Notes โ
Recent Changes (January 7, 2026) โ
Dashboard UI extracted โ
- Dashboard UI primitives moved to
src/components/dashboard/Primitives.jsx(sharedDashboardButton,DashboardCard,DashboardBadge). - Offer promo components moved to
src/components/dashboard/OfferCards.jsx(HeroOfferCard,OfferPill). - View components moved to
src/components/dashboard/(HomeView,VenueView,ActiveLanternView,ScheduleConfirmationView,DashboardNavigation). - Dashboard now imports these instead of inlining, reducing file size and clarifying ownership.
- Screen wrappers added in
src/screens/dashboard/(PlacesScreen.jsx,VenueDetailScreen.jsx,ActiveLanternScreen.jsx,LanternSuccessScreen.jsx) so Dashboard renders screens instead of inline views.
Recent Changes (January 3, 2026) โ
Components Extracted from Dashboard โ
The following components were previously embedded in Dashboard.jsx and have been extracted into standalone, reusable components:
- LightLanternForm โ
src/components/LightLanternForm.jsx- Previously: 70 lines embedded in Dashboard
- Now: Standalone component, reusable for immediate and scheduled lighting
- Storybook: 4 stories showcasing different configurations
New Components Created โ
VenuePicker โ
src/components/VenuePicker.jsx- Purpose: Global venue selection interface
- Features: List/map views, search, category filtering
- Use cases: Light lantern, schedule light, future features
ScheduleLightForm โ
src/components/ScheduleLightForm.jsx- Purpose: Multi-step wizard for scheduling future lights
- Steps: Venue โ Date/Time โ Interest/Mood
- Integrates with: VenuePicker, LightLanternForm
Future Refactoring Considerations โ
Potential Component Extractions โ
Based on the conversation about "potentially moving places and lantern lights into their own components or screens," here are recommendations:
1. Places/Venues Screen โ
Current State:
- Venue list and map are rendered via
PlacesScreen.jsx(wrapsHomeView) - Venue detail lives in
VenueDetailScreen.jsx(wrapsVenueView)
Remaining Recommendation:
- Extract venue map view โ
src/components/VenuesMap.jsx - Extract venue list โ
src/components/VenuesList.jsx - Keep
VenueViewbut consider renaming toVenueDetail.jsxfor clarity
2. Active Lantern Screen โ
Current State:
ActiveLanternViewcomponent inside Dashboard.jsx (lines ~632-695)
Recommendation:
- Extract โ
src/screens/ActiveLanternScreen.jsxorsrc/components/ActiveLantern.jsx
Benefits:
- Standalone testing
- Easier to add features (edit lantern, view waves, etc.)
- Could become a full "My Lantern" screen with tabs
Current File Structure (as of January 7, 2026) โ
Note: Screens have been migrated to
src/screens/{domain}/. See SCREENS_ORGANIZATION.md.
src/
components/ # Reusable UI components
Button.jsx
Card.jsx
Badge.jsx
LanternBeacon.jsx
LanternHub.jsx
LightLanternForm.jsx
VenuePicker.jsx
ScheduleLightForm.jsx
WaveManager.jsx
Chat.jsx
VenuesMap.jsx # FUTURE - extracted map view
VenuesList.jsx # FUTURE - extracted list view
VenueCard.jsx # FUTURE - individual venue card
ActiveLantern.jsx # FUTURE - active lantern view
screens/ # Full-screen views (routes)
auth/
SignupFlow.jsx
dashboard/
Dashboard.jsx # Orchestrates dashboard flows
PlacesScreen.jsx # Wraps HomeView
VenueDetailScreen.jsx
ActiveLanternScreen.jsx
LanternSuccessScreen.jsx
merchant/
MerchantDashboard.jsx
OfferForm.jsx
profile/
ProfileSettings.jsx
CreateNewProfile.jsxBenefits of Further Refactoring โ
Current State (Partially Refactored) โ
โ Forms are reusable โ Picker is standalone โ Hub triggers flows cleanly โ ๏ธ Dashboard.jsx still ~1100 lines โ ๏ธ HomeView, VenueView, ActiveLanternView embedded
After Full Refactoring โ
- Dashboard.jsx โ ~400 lines (orchestration only)
- Each screen โ 100-300 lines (focused, testable)
- Components โ 50-200 lines (highly reusable)
- Storybook coverage for all screens
- Easier onboarding for new developers
- Simpler unit testing
Recommended Next Steps โ
Phase 1: Extract Screens (High Impact, Low Risk) โ
- Extract
HomeViewโPlacesScreen.jsx - Extract
VenueViewโVenueDetailScreen.jsx - Extract
ActiveLanternViewโActiveLanternScreen.jsx - Update Dashboard to import and render screens
- Create Storybook stories for each screen
Phase 2: Break Down Places Screen (Medium Impact) โ
- Extract map view โ
VenuesMap.jsx - Extract list view โ
VenuesList.jsx - Extract individual venue card โ
VenueCard.jsx - PlacesScreen uses these components
Phase 3: Advanced Organization (Lower Priority) โ
- Create
src/features/directory - Group related components by feature:
features/venues/(map, list, detail, picker)features/lantern/(hub, form, active view)features/social/(waves, chat, beacon)
- Update imports across codebase
Trade-offs to Consider โ
โ Pros of Refactoring โ
- Better code organization
- Easier testing and maintenance
- Smaller, focused files
- Better for team collaboration
- Clearer dependencies
โ ๏ธ Cons to Watch For โ
- Initial time investment
- Need to update all imports
- Risk of breaking existing flows
- More files to navigate
When to Refactor โ
- โ Do it now if planning to add more features
- โ Do it if team is growing
- โ ๏ธ Wait if launching pilot soon (defer until after)
- โ ๏ธ Wait if no immediate pain points
Current Status โ
As of this refactoring session:
- โ Forms are extracted and reusable
- โ Multi-step flows work smoothly
- โ Storybook coverage good for new components
- โ ๏ธ Dashboard still contains screen views
- โ ๏ธ Could benefit from screen/component split
Recommendation: The current state is production-ready for the pilot. Further refactoring can be done iteratively as new features are added.