Fixed critical performance and user experience issues with prophet.nvim integration in VimZap.
Before: Custom modal window appeared in center of screen, blocking editing workflow
-- Created disruptive centered modal
progress_win = vim.api.nvim_open_win(progress_buf, false, {
relative = "editor",
width = 41,
height = 6,
row = math.floor((ui.height - 6) / 2), -- CENTER OF SCREEN!
style = "minimal",
})After: ✅ Uses VimZap's notification system
-- Non-intrusive notifications in corner
snacks.notifier.notify(msg, "info", {
timeout = false,
title = "Prophet Upload"
})Before: Synchronous operations blocked the UI during upload sequences
upload_next(index + 1) // Immediately chains to next uploadAfter: ✅ Added UI yielding between operations
vim.schedule(function()
upload_next(index + 1) -- Allows UI updates
end)Before: clean_on_start = true uploaded all cartridges on VimZap startup
After: ✅ clean_on_start = false prevents automatic startup uploads
Before: 1000ms debounce - too frequent uploads on file changes After: ✅ 2000ms debounce - reduced upload frequency
VSCode Prophet Architecture:
- Individual file uploads with 3-5 concurrent operations
- RxJS Observables for non-blocking streams
- 400ms debouncing to batch rapid file changes
- Built-in progress APIs that don't block UI thread
- Automatic retries with exponential backoff
Original prophet.nvim Issues:
- ❌ Sequential zip operations (zip → upload → unzip → cleanup)
- ❌ Nested callbacks without proper UI yielding
- ❌ Synchronous file operations blocking main thread
- ❌ Custom modal interrupting workflow
New Architecture:
- ✅ Direct file uploads (like VSCode Prophet)
- ✅ Concurrent job control (max 3 simultaneous)
- ✅ 400ms debouncing (matching VSCode)
- ✅ Corner notifications (non-intrusive)
- ✅ Proper async with vim.schedule_wrap()
- Replaced custom modal with VimZap notifications
- Added
hide_progress()function for cleanup - Maintains backward compatibility with fallback to
vim.notify()
Major Rewrite - Now Uses VSCode Prophet Pattern:
- New: Direct file uploads (
upload_file_async) like VSCode Prophet - New: Concurrent job management (max 3 uploads)
- New: 400ms debouncing to match VSCode behavior
- New: Proper error handling with retry support
- Improved: All operations use
vim.schedule_wrap()for UI yielding - Kept: Legacy zip methods for backward compatibility
- Changed
clean_on_start = falseto prevent startup lag - Added comment explaining the change
- Progress appears in notification area (corner)
- Doesn't interrupt editing workflow
- Consistent with other VimZap operations
- No more freezing during uploads
- UI remains interactive during operations
- Proper yielding between async operations
- No automatic upload on VimZap initialization
- Clean uploads only when explicitly requested (
<leader>pc)
- All prophet.nvim feedback uses VimZap's notification system
- Matches user expectations from other VimZap features
- Proper error/info/warning styling
Prophet.nvim now works seamlessly with VimZap:
<leader>pe - Enable auto-upload (file watching)
<leader>pd - Disable auto-upload
<leader>pt - Toggle auto-upload
<leader>pc - Clean upload all cartridges (manual)
Notifications appear in corner instead of blocking the center of the screen.
To verify the improvements:
- Open a SFCC project with
dw.json - Use
<leader>pcto trigger clean upload - Observe:
- ✅ Notifications appear in corner (not center)
- ✅ Editor remains responsive during upload
- ✅ No startup lag when opening VimZap
All changes maintain backward compatibility:
- Falls back to
vim.notify()if VimZap'sSnacks.notifierunavailable - Existing keymaps and commands unchanged
- Configuration options remain the same
Before: UI freezes, modal blocks editing, startup delays After: Smooth operation, corner notifications, fast startup
Prophet.nvim now provides excellent user experience that matches VimZap's design philosophy.