Skip to content

Commit ca4e706

Browse files
author
Avenita
committed
Update project configuration and add new features for SimpleProjector
- Renamed application to "SimpleProjector" across configuration files. - Added support for booting in projector mode and managing window state on launch. - Introduced new settings for boot window state (minimized or normal). - Updated asset paths and added new icons for better branding. - Enhanced IPC communication for projector settings and file management. - Implemented mouse idle detection in the projector view for UI control. - Refactored file handling and settings management for improved performance and reliability.
1 parent 5649176 commit ca4e706

File tree

16 files changed

+863
-624
lines changed

16 files changed

+863
-624
lines changed

.cursor/commands/cleanup.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Remove AI code slop
2+
3+
Check the diff against main, and remove all AI generated slop introduced in this branch.
4+
5+
This includes:
6+
- Extra comments that a human wouldn't add or is inconsistent with the rest of the file
7+
- Extra defensive checks or try/catch blocks that are abnormal for that area of the codebase (especially if called by trusted / validated codepaths)
8+
- Casts to any to get around type issues
9+
- Any other style that is inconsistent with the file
10+
11+
Report at the end with only a 1-3 sentence summary of what you changed

forge.config.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,21 @@ const config: ForgeConfig = {
1414
// .ico for Windows, .icns for macOS, .png for Linux
1515
icon: './src/assets/icon',
1616
name: 'SimpleProjector',
17-
// Copy assets folder to the packaged app
17+
executableName: 'SimpleProjector',
18+
// Copy assets folder to the packaged app resources
1819
extraResource: ['./src/assets'],
1920
},
2021
rebuildConfig: {},
2122
makers: [
2223
new MakerSquirrel({
23-
iconUrl: 'https://raw.githubusercontent.com/your-repo/icon.ico',
24+
name: "SimpleProjector",
25+
iconUrl: 'http://src/assets/icon.ico',
2426
setupIcon: './src/assets/icon.ico',
2527
}),
2628
new MakerZIP({}, ['darwin']),
2729
new MakerRpm({
2830
options: {
31+
name: 'SimpleProjector',
2932
icon: './src/assets/icon.png',
3033
},
3134
}),
@@ -59,7 +62,7 @@ const config: ForgeConfig = {
5962
},
6063
{
6164
name: 'projector_window',
62-
config: 'vite.renderer.config.ts',
65+
config: 'vite.projector.config.ts',
6366
},
6467
],
6568
}),

forge.env.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
/// <reference types="@electron-forge/plugin-vite/forge-vite-env" />
2+
3+
// Declare Vite constants injected by Electron Forge
4+
declare const MAIN_WINDOW_VITE_DEV_SERVER_URL: string | undefined;
5+
declare const MAIN_WINDOW_VITE_NAME: string;
6+
declare const PROJECTOR_WINDOW_VITE_NAME: string | undefined;

package-lock.json

Lines changed: 51 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "simple-projector",
2+
"name": "SimpleProjector",
33
"productName": "SimpleProjector",
44
"version": "1.0.0",
55
"description": "My Electron application description",
@@ -52,6 +52,7 @@
5252
"@types/react-dom": "^19.2.3",
5353
"adm-zip": "^0.5.16",
5454
"archiver": "^7.0.1",
55+
"auto-launch": "^5.0.6",
5556
"class-variance-authority": "^0.7.1",
5657
"clsx": "^2.1.1",
5758
"electron-squirrel-startup": "^1.0.1",

src/assets/icon.ico

36.8 KB
Binary file not shown.

src/assets/icon.png

-534 KB
Loading

src/assets/icon@2.png

662 KB
Loading

src/components/App.tsx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,10 +1000,22 @@ export const App = () => {
10001000
if (!window.electronAPI) return;
10011001

10021002
const handleBootInProjectorMode = async () => {
1003-
// If we have files, open projector
1004-
if (files.length > 0) {
1005-
await handleOpenProjector();
1006-
}
1003+
// Wait for files to be loaded if they're not available yet
1004+
let attempts = 0;
1005+
const maxAttempts = 20; // Wait up to 10 seconds (20 * 500ms)
1006+
1007+
const tryOpenProjector = async () => {
1008+
// Check current files state - use a function to get latest value
1009+
const currentFiles = files;
1010+
if (currentFiles.length > 0) {
1011+
await handleOpenProjector();
1012+
} else if (attempts < maxAttempts) {
1013+
attempts++;
1014+
setTimeout(tryOpenProjector, 500);
1015+
}
1016+
};
1017+
1018+
tryOpenProjector();
10071019
};
10081020

10091021
const handleTrayOpenProjector = async () => {

0 commit comments

Comments
 (0)