This implementation adds persistent file and folder locking functionality to the BoltDIY project. When a file or folder is locked, it cannot be modified by either the user or the AI until it is unlocked. All locks are scoped to the current chat/project to prevent locks from one project affecting files with matching names in other projects.
- A dedicated alert component for displaying lock-related error messages
- Features a distinctive amber/yellow color scheme and lock icon
- Provides clear instructions to the user about locked files
- Core functionality for persisting file and folder locks in localStorage
- Provides functions for adding, removing, and retrieving locked files and folders
- Defines the lock modes: "full" (no modifications) and "scoped" (only additions allowed)
- Implements chat ID scoping to isolate locks to specific projects
- Utility functions for checking if a file or folder is locked
- Helps avoid circular dependencies between components and stores
- Provides a consistent interface for lock checking across the application
- Extracts chat ID from URL for project-specific lock scoping
- Updated to use the new LockAlert component for locked file errors
- Maintains backward compatibility with other error types
- Added checks to prevent editing of locked files
- Updated to use the new fileLocks utility
- Displays appropriate tooltips when a user attempts to edit a locked file
- Added safety checks for unsavedFiles to prevent errors
- Improved handling of locked files in the editor panel
- Added visual indicators for locked files and folders in the file tree
- Improved handling of locked files and folders in the file tree
- Added context menu options for locking and unlocking folders
- Added checks to prevent updating locked files
- Improved error handling for locked files
- Added core functionality for locking and unlocking files and folders
- Implemented persistence of locked files and folders across page refreshes
- Added methods for checking if a file or folder is locked
- Added chat ID scoping to prevent locks from affecting other projects
- Added methods for locking and unlocking files and folders
- Improved error handling for locked files and folders
- Fixed issues with alert initialization
- Added support for chat ID scoping of locks
- Added
isLockedFileproperty to the ActionAlert interface - Improved type definitions for locked file alerts
- Persistent File and Folder Locking: Locks are stored in localStorage and persist across page refreshes
- Visual Indicators: Locked files and folders are clearly marked in the UI with lock icons
- Improved Error Messages: Clear, visually distinct error messages when attempting to modify locked items
- Lock Modes: Support for both full locks (no modifications) and scoped locks (only additions allowed)
- Prevention of AI Modifications: The AI is prevented from modifying locked files and folders
- Project-Specific Locks: Locks are scoped to the current chat/project to prevent conflicts
- Recursive Folder Locking: Locking a folder automatically locks all files and subfolders within it
- Enhanced Alert Design: Modern, visually appealing alert design with better spacing and typography
- Contextual Icons: Different icons and colors for different types of alerts
- Improved Error Details: Better formatting of error details with monospace font and left border
- Responsive Buttons: Better positioned and styled buttons with appropriate hover effects