feat: add IPC handlers for app.getPath and app.getVersion#858
Merged
feat: add IPC handlers for app.getPath and app.getVersion#858
Conversation
`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>
Contributor
There was a problem hiding this comment.
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', ...)andipcMain.handle('app:get-version', ...)in the Electron main process. - Demonstrate renderer-side usage by invoking
app:get-versionfromAppComponent. - Minor cleanup: remove empty
HomeComponentconstructor 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
appis main-process only — accessing it viawindow.require('electron').appin the renderer returnsundefinedipcMain.handle('app:get-version', ...)inapp/main.tsAppComponentviaipcRenderer.invoke('app:get-version')Test plan
npm startand check DevTools console — "App version: x.x.x" should appearnpm run lintnpm testCloses #822
🤖 Generated with Claude Code