mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-03 02:11:07 +05:30
Fix print preview to show content and improve file loading timing
Print Preview Fixes:
- Fixed print preview to show actual preview content instead of formatting menu
- Changed from generic 'preview' ID to active tab's 'preview-{tabId}' element
- Added CSS positioning to make preview fixed and full-screen during print
- Hide all dialog overlays (export, batch, PDF, converter) during print
- Restore dialogs after print completes
- Enhanced print-mode CSS with z-index and positioning for proper display
File Loading Timing Improvements:
- Increased renderer-ready delay from 500ms to 1000ms for slower first loads
- Increased openFileFromPath delay from 100ms to 300ms
- Ensures UI fully initializes before files are displayed
- Files now render correctly on first double-click launch
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+3
-3
@@ -1668,11 +1668,11 @@ function openFileFromPath(filePath) {
|
||||
currentFile = filePath;
|
||||
const content = fs.readFileSync(filePath, 'utf-8');
|
||||
if (mainWindow && mainWindow.webContents && rendererReady) {
|
||||
// Add a small delay to ensure renderer is fully prepared to display the file
|
||||
// This prevents timing issues where file opens before UI is ready
|
||||
// Add delay to ensure renderer is fully prepared to display the file
|
||||
// Increased delay for first-time load when UI is still initializing
|
||||
setTimeout(() => {
|
||||
mainWindow.webContents.send('file-opened', { path: filePath, content });
|
||||
}, 100);
|
||||
}, 300);
|
||||
} else {
|
||||
// Store file to open after renderer is ready
|
||||
app.pendingFile = filePath;
|
||||
|
||||
Reference in New Issue
Block a user