Overview
This update introduces Guest Mode, allowing users to start coding instantly without signing in. Guest projects are stored locally and automatically migrated to the cloud once the user authenticates.
Key Features
Guest Mode
- Editor is accessible without authentication (
/editor/:id) - Guest projects are stored in browser
localStorage - Clicking Launch Editor creates a default starter project
- Uses
generateLocalId()to createlocal-prefixed project IDs
Hybrid Storage
- Projects use:
localStorageforlocal-projects- Firebase Realtime Database for cloud projects
projectService.tsnow supports both storage types- All CRUD operations work for local and cloud projects
getUserProjects()returns a combined list
Automatic Migration
- New
migrationService.ts - Runs automatically when a guest signs in
- Migrates all local projects to Firebase
- Local data is deleted only after successful cloud save
- Redirects user to the cloud version if currently editing
- Toast notifications confirm migration status
Global Toast System
- New
ToastContext - Simple
showToast(message)API - Auto-dismiss after 3 seconds
Bug Fixes
- Fixed auth listener re-subscribing issue in
AuthContext.tsx - Improved sign-in redirect flow (now redirects to dashboard)
- Fixed Monaco Editor red underline issues when switching projects
Files Changed
New
src/utils/idGenerator.tssrc/services/migrationService.tssrc/context/ToastContext.tsx
Updated
App.tsx– Editor no longer protectedprojectService.ts– Hybrid storageAuthContext.tsx– Migration + auth fixesCodeEditor.tsx– Marker cleanup
Security
- Guests cannot write to Firebase
- Only authenticated users can modify cloud projects
- Migration respects ownership rules
User Flow
Guest
- Open site
- Click Launch Editor
- Code immediately
- Sign in later
- Projects auto-migrate
Authenticated
- Sign in → Dashboard
- Access all cloud projects
- No localStorage usage by default
Compatibility
- No breaking changes
- Fully backward compatible
Limitations
- Local projects are device-specific
- Requires sign-in to migrate
- Local projects cannot be shared
Full Changelog: v3.3.0...v3.4.0