bolt.diy/app/utils
Stijnus 9a5076d8c6
Some checks failed
Docker Publish / docker-build-publish (push) Has been cancelled
Update Stable Branch / prepare-release (push) Has been cancelled
feat: lock files (#1681)
* Add persistent file locking feature with enhanced UI

* Fix file locking to be scoped by chat ID

* Add folder locking functionality

* Update CHANGES.md to include folder locking functionality

* Add early detection of locked files/folders in user prompts

* Improve locked files detection with smarter pattern matching and prevent AI from attempting to modify locked files

* Add detection for unlocked files to allow AI to continue with modifications in the same chat session

* Implement dialog-based Lock Manager with improved styling for dark/light modes

* Add remaining files for file locking implementation

* refactor(lock-manager): simplify lock management UI and remove scoped lock options

Consolidate lock management UI by removing scoped lock options and integrating LockManager directly into the EditorPanel. Simplify the lock management interface by removing the dialog and replacing it with a tab-based view. This improves maintainability and user experience by reducing complexity and streamlining the lock management process.

Change Lock & Unlock action to use toast instead of alert.

Remove LockManagerDialog as it is now tab based.

* Optimize file locking mechanism for better performance

- Add in-memory caching to reduce localStorage reads
- Implement debounced localStorage writes
- Use Map data structures for faster lookups
- Add batch operations for locking/unlocking multiple items
- Reduce polling frequency and add event-based updates
- Add performance monitoring and cross-tab synchronization

* refactor(file-locking): simplify file locking mechanism and remove scoped locks

This commit removes the scoped locking feature and simplifies the file locking mechanism. The `LockMode` type and related logic have been removed, and all locks are now treated as full locks. The `isLocked` property has been standardized across the codebase, replacing the previous `locked` and `lockMode` properties. Additionally, the `useLockedFilesChecker` hook and `LockAlert` component have been removed as they are no longer needed with the simplified locking system.

This gives the LLM a clear understanding of locked files and strict instructions not to make any changes to these files

* refactor: remove debug console.log statements

---------

Co-authored-by: KevIsDev <zennerd404@gmail.com>
2025-05-08 00:07:32 +02:00
..
buffer.ts fix: remove monorepo 2024-09-25 19:54:09 +01:00
classNames.ts fix: remove monorepo 2024-09-25 19:54:09 +01:00
constants.ts feat(templates): add Vite Shadcn starter template 2025-04-30 11:37:29 +01:00
debounce.ts UI bug fixes 2025-02-18 14:13:13 +01:00
diff.spec.ts [UX] click shortcut in chat to go to source file in workbench 2024-11-19 00:24:14 +01:00
diff.ts [UX] click shortcut in chat to go to source file in workbench 2024-11-19 00:24:14 +01:00
easings.ts fix: remove monorepo 2024-09-25 19:54:09 +01:00
file-watcher.ts feat: fix for push private repo (#1618) 2025-04-08 22:20:54 +02:00
fileLocks.ts feat: lock files (#1681) 2025-05-08 00:07:32 +02:00
fileUtils.ts feat: make user made changes persistent after reload (#1387) 2025-02-27 13:34:57 +05:30
folderImport.ts fix: issue with alternate message when importing from folder and git (#1216) 2025-01-29 22:16:58 +05:30
formatSize.ts Fix ESLint issues 2025-01-28 11:39:12 +01:00
getLanguageFromExtension.ts fix: fix enhance prompt to stop implementing full project instead of enhancing (#1383) #release 2025-03-01 01:34:35 +05:30
logger.ts fix: updated logger and model caching minor bugfix #release (#895) 2024-12-31 22:47:32 +05:30
markdown.ts feat: support for <think></think> tags to allow reasoning tokens formatted in UI (#1205) 2025-01-29 02:33:53 +05:30
mobile.ts fix: remove monorepo 2024-09-25 19:54:09 +01:00
os.ts Bug fix for the Keyboard Shortcuts 2025-02-02 15:51:56 +01:00
path.ts big fixes 2025-01-30 17:17:36 +01:00
projectCommands.ts refactor(chat): improve UI layout, artifact handling, and template naming 2025-04-28 14:03:58 +01:00
promises.ts fix: remove monorepo 2024-09-25 19:54:09 +01:00
react.ts fix: remove monorepo 2024-09-25 19:54:09 +01:00
sampler.ts fix: added more controlled rate for code streaming 2024-12-12 03:13:52 +05:30
selectStarterTemplate.ts feat(chat): add dynamic title support for bundled artifacts 2025-04-29 14:37:17 +01:00
shell.ts refactor: move qrCodeStore to lib/stores for better organization 2025-04-18 11:45:14 +01:00
stacktrace.ts feat: catch errors from web container preview and show in actionable alert so user can send them to AI for fixing (#856) 2024-12-25 03:05:44 +05:30
stripIndent.ts fix: remove monorepo 2024-09-25 19:54:09 +01:00
terminal.ts fix: remove monorepo 2024-09-25 19:54:09 +01:00
types.ts refactor: refactored LLM Providers: Adapting Modular Approach (#832) 2024-12-21 11:45:17 +05:30
unreachable.ts fix: remove monorepo 2024-09-25 19:54:09 +01:00