forked from stackblitz/bolt.new
-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: auto sync Implementation V2 #1092
Open
Stijnus
wants to merge
21
commits into
stackblitz-labs:main
Choose a base branch
from
Stijnus:FEAT_BoltDYI_SYNC_V2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+5,155
−2,814
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here is a Vid : Br, Stijnus |
Stijnus
force-pushed
the
FEAT_BoltDYI_SYNC_V2
branch
from
January 24, 2025 14:33
f79aa01
to
5a0489f
Compare
The sync functionality allows users to synchronize their project files with a local directory. It includes features like persistent project folders, configurable auto-sync, and detailed sync history tracking.
# Sync Implementation ## Overview The sync functionality provides a robust system for synchronizing project files with a local directory. It features intelligent project folder management with timestamp-based naming, automated sync capabilities, comprehensive sync statistics tracking, and a modern UI with trend analysis. ## Key Components ### 1. Project Folder Management - Singleton `ProjectFolderManager` for centralized folder handling - Project name normalization (lowercase, alphanumeric with underscores) - Timestamp-based unique folder naming (e.g., `project_name_a1b2c3`) - Persistent storage of project mappings in localStorage - Smart matching of existing projects (exact match and base name match)
The tooltip should now show: Sync folder name Last sync time Number of files and total size Auto-sync status with interval (if enabled) Sync-on-save status (if enabled) Removed the arbitrary 30-second check interval Added a new syncIntervalId field to track the active interval Updated the sync settings subscription to: Clear any existing interval when settings change Set up a new interval that matches the user's configured interval (in minutes) The interval now directly triggers a sync instead of checking if enough time has passed Added proper cleanup of intervals when settings change
## Sync UI and Persistence Enhancements This PR improves the sync functionality by enhancing the UI and leveraging existing persistence capabilities. ### 🔄 Persistence Layer - Utilizes IndexedDB for storing sync folder handles - Implements permission verification on folder restoration - Automatically restores sync folder settings on app start - Gracefully handles permission revocation ### 🎨 UI Improvements - **Workbench Header** - Streamlined main sync display - Comprehensive tooltip with detailed status - Clear visual indicators for sync states - Organized sync controls - **Settings Panel (SyncTab)** - Enhanced layout and visual hierarchy - Improved folder information display - Clear status indicators - Fixed overlapping elements ### 🛠 Technical Enhancements - Strengthened TypeScript type definitions - Optimized component organization - Enhanced state management - More efficient rendering - Robust persistence implementation ### 🔍 Implementation Details ```typescript // Core persistence functions saveSyncFolderHandle(handle) // Store folder handle loadSyncFolderHandle() // Restore with permission check clearSyncFolderHandle() // Clear stored handle // UI Components - Minimal workbench display - Detailed tooltip overlay - Status indicators - Folder information - Sync controls ``` ### 🎯 Impact These changes significantly improve the user experience by: 1. Maintaining sync settings across sessions 2. Providing a cleaner, more intuitive interface 3. Offering better sync status visibility 4. Ensuring robust permission handling 5. Preserving a professional appearance
# Sync Feature Enhancements ## File Synchronization Improvements - Added initial sync configuration prompt when starting new projects - Improved sync status persistence between sessions - Enhanced sync folder permission handling and verification - Added sync interval configuration (1-60 minutes) ## UI/UX Improvements - Redesigned sync status indicators with clear visual feedback - Green for enabled state - Red for disabled state - Removed misleading "Active" status - Enhanced tooltip content with clearer status information - Improved sync settings dialog layout and organization - Added visual indicators for auto-sync and sync-on-save states ## Project Management - Added project-specific sync preferences - Improved handling of existing projects on reload - Added ability to toggle sync settings per project - Enhanced sync folder selection and management ## Technical Improvements - Improved TypeScript definitions for FileSystem API - Enhanced state management for sync settings - Added debouncing for sync operations - Improved error handling and user feedback
Stijnus
force-pushed
the
FEAT_BoltDYI_SYNC_V2
branch
from
January 26, 2025 23:40
7e19ebc
to
df22067
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
V2 : Sync Implementation is an update for : #1076
Sync UI and Persistence Enhancements
This PR improves the sync functionality by enhancing the UI and leveraging existing persistence capabilities.
🔄 Persistence Layer
🎨 UI Improvements
Workbench Header
Settings Panel (SyncTab)
🛠 Technical Enhancements
🔍 Implementation Details
🎯 Impact
These changes significantly improve the user experience by: