Editor Persistence, Community Publishing & Data Integrity Fixes
Description
Implemented comprehensive editor persistence with both auto-save and manual save capabilities, alongside a new suite of features for community project publishing and management. Addressed critical data integrity issues regarding Firebase permissions and data overwriting, and refactored the architecture to ensure database precedence over local state.
Changes Made
- Editor Persistence:
- Implemented debounced auto-save functionality.
- Added manual save capability via a toolbar button and
Ctrl+Sshortcut. - Integrated visual "saving/saved" status indicators in the editor header.
- Community & Publishing:
- Added
CommunityServiceto manage public project interactions (publishing, fetching, filtering). - Implemented
PublishModalfor sharing projects to the community feed. - Added
EditPostModalfor updating published project metadata. - Created
CommunityProjectCardto display public projects with save/view statistics. - Overhauled the
Communitypage with a responsive grid layout and updated filtering logic. - Updated the
Profilepage to support new project management and publishing flows.
- Added
- Data Integrity Fixes:
- Resolved
PERMISSION_DENIEDerrors by correcting Firebase update logic to use the authenticated user's ID. - Fixed a critical bug where saving overwrote unrelated metadata by switching from
settoupdateoperations. - Fixed a race condition where
localStoragestate overrode fresh database data on reload.
- Resolved
- Refactoring & UI:
- Refactored
Layoutto separate state initialization from editor loading. - Standardized project data loading to ensure database precedence.
- Updated
MainContentto expose theonCodeChangecallback. - Improved dashboard layout structure and global styles.
- Refactored
How It Works
- Persistence Strategy: The system now utilizes a debounce mechanism for auto-saving to minimize writes.
- Data Safety: Database operations were converted from destructive
setcalls to targetedupdatecalls, ensuring that modifying code does not accidentally wipe project metadata (like timeline info or public status). - State Synchronization: The loading flow was restructured so that remote database data always takes precedence over potentially stale
localStoragecache.
Full Changelog: v3.1.1...v3.2.0