Skip to content
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
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

Stijnus
Copy link
Collaborator

@Stijnus Stijnus commented Jan 14, 2025

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

  • 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

// 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

@Stijnus
Copy link
Collaborator Author

Stijnus commented Jan 15, 2025

@Stijnus Stijnus closed this Jan 24, 2025
@Stijnus Stijnus force-pushed the FEAT_BoltDYI_SYNC_V2 branch from f79aa01 to 5a0489f Compare January 24, 2025 14:33
@Stijnus Stijnus reopened this Jan 24, 2025
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 Stijnus force-pushed the FEAT_BoltDYI_SYNC_V2 branch from 7e19ebc to df22067 Compare January 26, 2025 23:40
@Stijnus Stijnus closed this Jan 28, 2025
@leex279 leex279 reopened this Jan 30, 2025
@leex279 leex279 requested review from leex279 and thecodacus January 30, 2025 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants