Skip to content

Editor Persistence, Community Publishing & Data Integrity Fixes

Choose a tag to compare

@CyberSphinxxx CyberSphinxxx released this 02 Jan 21:43
· 10 commits to main since this release

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+S shortcut.
    • Integrated visual "saving/saved" status indicators in the editor header.
  • Community & Publishing:
    • Added CommunityService to manage public project interactions (publishing, fetching, filtering).
    • Implemented PublishModal for sharing projects to the community feed.
    • Added EditPostModal for updating published project metadata.
    • Created CommunityProjectCard to display public projects with save/view statistics.
    • Overhauled the Community page with a responsive grid layout and updated filtering logic.
    • Updated the Profile page to support new project management and publishing flows.
  • Data Integrity Fixes:
    • Resolved PERMISSION_DENIED errors by correcting Firebase update logic to use the authenticated user's ID.
    • Fixed a critical bug where saving overwrote unrelated metadata by switching from set to update operations.
    • Fixed a race condition where localStorage state overrode fresh database data on reload.
  • Refactoring & UI:
    • Refactored Layout to separate state initialization from editor loading.
    • Standardized project data loading to ensure database precedence.
    • Updated MainContent to expose the onCodeChange callback.
    • Improved dashboard layout structure and global styles.

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 set calls to targeted update calls, 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 localStorage cache.

Full Changelog: v3.1.1...v3.2.0