mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 10:00:17 +05:30
Fix print null errors and add main process logging to renderer console
- Added null checks for toolbar, tab-bar, status-bar before accessing .style - Prevents TypeError when elements don't exist - Added executeJavaScript to send main process logs to renderer console - Now we can see main process state in DevTools - Print should now work without errors 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This commit is contained in:
@@ -26,7 +26,14 @@
|
|||||||
"Bash(dir:*)",
|
"Bash(dir:*)",
|
||||||
"Bash(git merge:*)",
|
"Bash(git merge:*)",
|
||||||
"Bash(timeout:*)",
|
"Bash(timeout:*)",
|
||||||
"Bash(findstr:*)"
|
"Bash(findstr:*)",
|
||||||
|
"Bash(git stash:*)",
|
||||||
|
"Bash(npm start:*)",
|
||||||
|
"Bash(gh release delete-asset:*)",
|
||||||
|
"Bash(git rm:*)",
|
||||||
|
"Bash(gh release view:*)",
|
||||||
|
"Bash(npm run build:linux:*)",
|
||||||
|
"Bash(git reset:*)"
|
||||||
],
|
],
|
||||||
"deny": []
|
"deny": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"CurrentProjectSetting": null
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"ExpandedNodes": [
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"SelectedNode": "\\package.json",
|
||||||
|
"PreviewInSolutionExplorer": false
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"Version": 1,
|
||||||
|
"WorkspaceRootPath": "H:\\Development\\pan-converter\\",
|
||||||
|
"Documents": [
|
||||||
|
{
|
||||||
|
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|H:\\Development\\pan-converter\\package.json||{90A6B3A7-C1A3-4009-A288-E2FF89E96FA0}",
|
||||||
|
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:package.json||{90A6B3A7-C1A3-4009-A288-E2FF89E96FA0}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"DocumentGroupContainers": [
|
||||||
|
{
|
||||||
|
"Orientation": 0,
|
||||||
|
"VerticalTabListWidth": 256,
|
||||||
|
"DocumentGroups": [
|
||||||
|
{
|
||||||
|
"DockedWidth": 200,
|
||||||
|
"SelectedChildIndex": 0,
|
||||||
|
"Children": [
|
||||||
|
{
|
||||||
|
"$type": "Document",
|
||||||
|
"DocumentIndex": 0,
|
||||||
|
"Title": "package.json",
|
||||||
|
"DocumentMoniker": "H:\\Development\\pan-converter\\package.json",
|
||||||
|
"RelativeDocumentMoniker": "package.json",
|
||||||
|
"ToolTip": "H:\\Development\\pan-converter\\package.json",
|
||||||
|
"RelativeToolTip": "package.json",
|
||||||
|
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAsAAAAqAAAAAAAAAA==",
|
||||||
|
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001642|",
|
||||||
|
"WhenOpened": "2025-10-11T13:44:30.357Z",
|
||||||
|
"EditorCaption": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$type": "Bookmark",
|
||||||
|
"Name": "ST:0:0:{cce594b6-0c39-4442-ba28-10c64ac7e89f}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"Version": 1,
|
||||||
|
"WorkspaceRootPath": "H:\\Development\\pan-converter\\",
|
||||||
|
"Documents": [
|
||||||
|
{
|
||||||
|
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|H:\\Development\\pan-converter\\package.json||{90A6B3A7-C1A3-4009-A288-E2FF89E96FA0}",
|
||||||
|
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:package.json||{90A6B3A7-C1A3-4009-A288-E2FF89E96FA0}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"DocumentGroupContainers": [
|
||||||
|
{
|
||||||
|
"Orientation": 0,
|
||||||
|
"VerticalTabListWidth": 256,
|
||||||
|
"DocumentGroups": [
|
||||||
|
{
|
||||||
|
"DockedWidth": 200,
|
||||||
|
"SelectedChildIndex": 0,
|
||||||
|
"Children": [
|
||||||
|
{
|
||||||
|
"$type": "Document",
|
||||||
|
"DocumentIndex": 0,
|
||||||
|
"Title": "package.json",
|
||||||
|
"DocumentMoniker": "H:\\Development\\pan-converter\\package.json",
|
||||||
|
"RelativeDocumentMoniker": "package.json",
|
||||||
|
"ToolTip": "H:\\Development\\pan-converter\\package.json",
|
||||||
|
"RelativeToolTip": "package.json",
|
||||||
|
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAsAAAAqAAAAAAAAAA==",
|
||||||
|
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001642|",
|
||||||
|
"WhenOpened": "2025-10-11T13:44:30.357Z",
|
||||||
|
"EditorCaption": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"$type": "Bookmark",
|
||||||
|
"Name": "ST:0:0:{cce594b6-0c39-4442-ba28-10c64ac7e89f}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Binary file not shown.
+9
-92
@@ -1,95 +1,12 @@
|
|||||||
# Push Instructions for Pan Converter
|
# Test Double-Click File Opening
|
||||||
|
|
||||||
## Prerequisites
|
This is a test file to verify double-click functionality.
|
||||||
1. Create a new repository on GitHub: https://github.com/new
|
|
||||||
- Repository name: `pan-converter`
|
|
||||||
- Keep it empty (no README, .gitignore, or license)
|
|
||||||
- Make it public or private as desired
|
|
||||||
|
|
||||||
2. Set up authentication:
|
## Features to Test
|
||||||
- **Option A - SSH Key** (Recommended):
|
- File should load automatically
|
||||||
```bash
|
- Content should display in editor
|
||||||
# Check if you have SSH key
|
- Tab should show filename
|
||||||
ls -la ~/.ssh/id_rsa.pub
|
- Preview should render markdown
|
||||||
|
|
||||||
# If not, generate one:
|
|
||||||
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
|
|
||||||
|
|
||||||
# Add to GitHub: Settings > SSH and GPG keys > New SSH key
|
|
||||||
cat ~/.ssh/id_rsa.pub
|
|
||||||
```
|
|
||||||
|
|
||||||
- **Option B - Personal Access Token**:
|
|
||||||
- Go to GitHub Settings > Developer settings > Personal access tokens
|
|
||||||
- Generate new token with 'repo' scope
|
|
||||||
- Save the token securely
|
|
||||||
|
|
||||||
## Push Commands
|
**This text should be bold**
|
||||||
|
*This text should be italic*
|
||||||
### Using SSH (Recommended)
|
|
||||||
```bash
|
|
||||||
# Set SSH remote
|
|
||||||
git remote set-url origin git@github.com:amitwh/pan-converter.git
|
|
||||||
|
|
||||||
# Push all branches
|
|
||||||
git push -u origin master
|
|
||||||
git push origin linux
|
|
||||||
git push origin macos
|
|
||||||
git push origin windows
|
|
||||||
```
|
|
||||||
|
|
||||||
### Using HTTPS with Token
|
|
||||||
```bash
|
|
||||||
# Set HTTPS remote
|
|
||||||
git remote set-url origin https://github.com/amitwh/pan-converter.git
|
|
||||||
|
|
||||||
# Push all branches (you'll be prompted for username and token)
|
|
||||||
git push -u origin master
|
|
||||||
git push origin linux
|
|
||||||
git push origin macos
|
|
||||||
git push origin windows
|
|
||||||
|
|
||||||
# When prompted:
|
|
||||||
# Username: amitwh
|
|
||||||
# Password: [paste your Personal Access Token]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Using GitHub CLI (if installed)
|
|
||||||
```bash
|
|
||||||
# Login to GitHub CLI
|
|
||||||
gh auth login
|
|
||||||
|
|
||||||
# Create repo and push
|
|
||||||
gh repo create pan-converter --public --source=. --remote=origin --push
|
|
||||||
```
|
|
||||||
|
|
||||||
## Automated Script
|
|
||||||
```bash
|
|
||||||
# Run the provided script
|
|
||||||
./push-to-github.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
## Verify Success
|
|
||||||
After pushing, verify at: https://github.com/amitwh/pan-converter
|
|
||||||
|
|
||||||
You should see:
|
|
||||||
- 4 branches (master, linux, macos, windows)
|
|
||||||
- All project files
|
|
||||||
- Complete commit history
|
|
||||||
|
|
||||||
## Troubleshooting
|
|
||||||
|
|
||||||
### Authentication Failed
|
|
||||||
- For SSH: Ensure your SSH key is added to GitHub
|
|
||||||
- For HTTPS: Use Personal Access Token, not password
|
|
||||||
- Check token has 'repo' scope
|
|
||||||
|
|
||||||
### Repository Not Found
|
|
||||||
- Ensure repository exists on GitHub
|
|
||||||
- Check spelling: `pan-converter`
|
|
||||||
- Verify you're logged into the correct GitHub account
|
|
||||||
|
|
||||||
### Permission Denied
|
|
||||||
- Check repository ownership
|
|
||||||
- Ensure you have write access
|
|
||||||
- Verify authentication method is correct
|
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 41 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 190 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 170 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
@@ -1183,10 +1183,19 @@ ipcMain.on('do-print', (event, { withStyles }) => {
|
|||||||
// Handle renderer ready for file association
|
// Handle renderer ready for file association
|
||||||
ipcMain.on('renderer-ready', (event) => {
|
ipcMain.on('renderer-ready', (event) => {
|
||||||
console.log('[MAIN] renderer-ready received, rendererReady was:', rendererReady);
|
console.log('[MAIN] renderer-ready received, rendererReady was:', rendererReady);
|
||||||
|
if (mainWindow) {
|
||||||
|
mainWindow.webContents.executeJavaScript(`console.log('[MAIN->RENDERER] renderer-ready received, rendererReady was: ${rendererReady}')`);
|
||||||
|
}
|
||||||
rendererReady = true;
|
rendererReady = true;
|
||||||
console.log('[MAIN] app.pendingFile:', app.pendingFile);
|
console.log('[MAIN] app.pendingFile:', app.pendingFile);
|
||||||
|
if (mainWindow) {
|
||||||
|
mainWindow.webContents.executeJavaScript(`console.log('[MAIN->RENDERER] app.pendingFile: ${app.pendingFile}')`);
|
||||||
|
}
|
||||||
if (app.pendingFile) {
|
if (app.pendingFile) {
|
||||||
console.log('[MAIN] Opening pending file:', app.pendingFile);
|
console.log('[MAIN] Opening pending file:', app.pendingFile);
|
||||||
|
if (mainWindow) {
|
||||||
|
mainWindow.webContents.executeJavaScript(`console.log('[MAIN->RENDERER] Opening pending file: ${app.pendingFile}')`);
|
||||||
|
}
|
||||||
openFileFromPath(app.pendingFile);
|
openFileFromPath(app.pendingFile);
|
||||||
app.pendingFile = null;
|
app.pendingFile = null;
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-6
@@ -1185,9 +1185,13 @@ function handlePrintPreview(withStyles) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Hide UI elements
|
// Hide UI elements
|
||||||
document.getElementById('toolbar').style.display = 'none';
|
const toolbar = document.getElementById('toolbar');
|
||||||
document.getElementById('tab-bar').style.display = 'none';
|
const tabBar = document.getElementById('tab-bar');
|
||||||
document.getElementById('status-bar').style.display = 'none';
|
const statusBar = document.getElementById('status-bar');
|
||||||
|
|
||||||
|
if (toolbar) toolbar.style.display = 'none';
|
||||||
|
if (tabBar) tabBar.style.display = 'none';
|
||||||
|
if (statusBar) statusBar.style.display = 'none';
|
||||||
|
|
||||||
const editorPane = document.getElementById(`editor-pane-${activeTabId}`);
|
const editorPane = document.getElementById(`editor-pane-${activeTabId}`);
|
||||||
if (editorPane) {
|
if (editorPane) {
|
||||||
@@ -1221,9 +1225,9 @@ function handlePrintPreview(withStyles) {
|
|||||||
|
|
||||||
// Restore UI after a delay (printer will have captured the output by then)
|
// Restore UI after a delay (printer will have captured the output by then)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
document.getElementById('toolbar').style.display = '';
|
if (toolbar) toolbar.style.display = '';
|
||||||
document.getElementById('tab-bar').style.display = '';
|
if (tabBar) tabBar.style.display = '';
|
||||||
document.getElementById('status-bar').style.display = '';
|
if (statusBar) statusBar.style.display = '';
|
||||||
|
|
||||||
if (editorPane) {
|
if (editorPane) {
|
||||||
editorPane.style.display = '';
|
editorPane.style.display = '';
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# Test Double-Click File Opening
|
||||||
|
|
||||||
|
This is a test file to verify double-click functionality.
|
||||||
|
|
||||||
|
## Features to Test
|
||||||
|
- File should load automatically
|
||||||
|
- Content should display in editor
|
||||||
|
- Tab should show filename
|
||||||
|
- Preview should render markdown
|
||||||
|
|
||||||
|
**This text should be bold**
|
||||||
|
*This text should be italic*
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# Test File Opening
|
||||||
|
|
||||||
|
This is a test file to verify that double-click file opening works correctly.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
- **Bold text**
|
||||||
|
- *Italic text*
|
||||||
|
- `Code`
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
console.log("Hello World");
|
||||||
|
```
|
||||||
|
|
||||||
|
This should appear when you double-click to open the file!
|
||||||
Reference in New Issue
Block a user