Skip to content

feat: add IPC handlers for app.getPath and app.getVersion#858

Merged
belnadris merged 3 commits intomainfrom
feat/ipc-app-info
Feb 27, 2026
Merged

feat: add IPC handlers for app.getPath and app.getVersion#858
belnadris merged 3 commits intomainfrom
feat/ipc-app-info

Conversation

@belnadris
Copy link
Owner

@belnadris belnadris commented Feb 27, 2026

Summary

  • app is main-process only — accessing it via window.require('electron').app in the renderer returns undefined
  • Adds ipcMain.handle('app:get-version', ...) in app/main.ts
  • Demonstrates usage in AppComponent via ipcRenderer.invoke('app:get-version')

Test plan

  • Run npm start and check DevTools console — "App version: x.x.x" should appear
  • Lint passes: npm run lint
  • Unit tests pass: npm test

Closes #822

🤖 Generated with Claude Code

belnadris and others added 2 commits February 27, 2026 10:05
`app` is main-process only and undefined in the renderer. Expose
`app:get-path` and `app:get-version` via ipcMain.handle so renderer
code can call them with ipcRenderer.invoke.

Demo in AppComponent logs the app version on startup via IPC.

Closes #822

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 27, 2026 10:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds main-process IPC endpoints to expose app.getPath(...) and app.getVersion() to the Angular renderer, addressing the fact that electron.app is not available in the renderer.

Changes:

  • Register ipcMain.handle('app:get-path', ...) and ipcMain.handle('app:get-version', ...) in the Electron main process.
  • Demonstrate renderer-side usage by invoking app:get-version from AppComponent.
  • Minor cleanup: remove empty HomeComponent constructor and ignore .worktrees.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
app/main.ts Adds IPC handlers for app path/version access from renderer.
src/app/app.component.ts Calls ipcRenderer.invoke('app:get-version') and logs version.
src/app/home/home.component.ts Removes no-op constructor.
.gitignore Ignores .worktrees directory.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@belnadris belnadris merged commit 33155bc into main Feb 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

I cant get app (getPath and getVersion)

2 participants