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:
2025-10-26 14:19:59 +05:30
co-authored by Claude
parent 2ab8deffeb
commit 3f3bdf5637
3 changed files with 37 additions and 7 deletions
+3 -3
View File
@@ -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;