mirror of
https://github.com/davidkaya/aryx.git
synced 2026-07-24 13:38:43 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa355197cb | ||
|
|
5f263002f0 | ||
|
|
1376de4148 | ||
|
|
5ce6bb4b0a | ||
|
|
47d3fb0a29 | ||
|
|
4da31cbdd6 | ||
|
|
f15323e37e | ||
|
|
f8fe9d866e |
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "aryx",
|
||||
"version": "0.0.27",
|
||||
"version": "0.0.29",
|
||||
"description": "Orchestrator for Copilot-powered agent workflows across multiple projects.",
|
||||
"private": true,
|
||||
"main": "dist-electron/main/index.js",
|
||||
|
||||
+16
-4
@@ -16,6 +16,12 @@ import { createDefaultQuickPromptSettings } from '@shared/domain/tooling';
|
||||
|
||||
const { app, BrowserWindow } = electron;
|
||||
|
||||
// Enforce single instance — quit immediately if another instance already holds the lock.
|
||||
const gotTheLock = app.requestSingleInstanceLock();
|
||||
if (!gotTheLock) {
|
||||
app.quit();
|
||||
}
|
||||
|
||||
let mainWindow: BrowserWindowType | undefined;
|
||||
let quickPromptWindow: BrowserWindowType | undefined;
|
||||
let appService: AryxAppService | undefined;
|
||||
@@ -63,9 +69,9 @@ async function bootstrap(): Promise<void> {
|
||||
applyTitleBarTheme(mainWindow, workspace.settings.theme);
|
||||
|
||||
systemTray = new SystemTray({
|
||||
onShowWindow: showAndFocusWindow,
|
||||
onShowWindow: () => showAndFocusWindow(mainWindow!),
|
||||
onCreateScratchpad: () => {
|
||||
showAndFocusWindow();
|
||||
showAndFocusWindow(mainWindow!);
|
||||
mainWindow?.webContents.send('tray:create-scratchpad');
|
||||
},
|
||||
onQuit: () => app.quit(),
|
||||
@@ -109,6 +115,12 @@ async function bootstrap(): Promise<void> {
|
||||
autoUpdateService.start();
|
||||
}
|
||||
|
||||
app.on('second-instance', () => {
|
||||
if (mainWindow && !mainWindow.isDestroyed()) {
|
||||
showAndFocusWindow(mainWindow);
|
||||
}
|
||||
});
|
||||
|
||||
app.whenReady().then(bootstrap);
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
@@ -127,8 +139,8 @@ app.on('window-all-closed', () => {
|
||||
app.on('activate', async () => {
|
||||
if (BrowserWindow.getAllWindows().length === 0) {
|
||||
await bootstrap();
|
||||
} else {
|
||||
showAndFocusWindow();
|
||||
} else if (mainWindow && !mainWindow.isDestroyed()) {
|
||||
showAndFocusWindow(mainWindow);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import { join } from 'node:path';
|
||||
|
||||
import type { WorkspaceState } from '@shared/domain/workspace';
|
||||
|
||||
const { app, Menu, Tray, nativeImage, BrowserWindow } = electron;
|
||||
const { app, Menu, Tray, nativeImage } = electron;
|
||||
type TrayType = InstanceType<typeof Tray>;
|
||||
type NativeImageType = ReturnType<typeof nativeImage.createFromPath>;
|
||||
|
||||
@@ -123,10 +123,8 @@ export function setupCloseToTray(
|
||||
/**
|
||||
* Show and focus the main window, restoring from tray if hidden.
|
||||
*/
|
||||
export function showAndFocusWindow(): void {
|
||||
const windows = BrowserWindow.getAllWindows();
|
||||
const mainWindow = windows[0];
|
||||
if (!mainWindow) return;
|
||||
export function showAndFocusWindow(mainWindow: Electron.BrowserWindow): void {
|
||||
if (mainWindow.isDestroyed()) return;
|
||||
|
||||
// On macOS, show the dock icon again
|
||||
if (process.platform === 'darwin') {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { join, resolve } from 'node:path';
|
||||
import { describe, expect, test } from 'bun:test';
|
||||
|
||||
import {
|
||||
@@ -8,6 +9,9 @@ import {
|
||||
type ReleaseDependencies,
|
||||
} from '../../scripts/release';
|
||||
|
||||
const testRepositoryRoot = resolve('/test-workspace/aryx');
|
||||
const testPackageJsonPath = join(testRepositoryRoot, 'package.json');
|
||||
|
||||
function gitSuccess(stdout = '', stderr = ''): GitCommandResult {
|
||||
return {
|
||||
exitCode: 0,
|
||||
@@ -109,8 +113,8 @@ describe('release workflow', () => {
|
||||
|
||||
const result = await runReleaseWorkflow(
|
||||
{
|
||||
repositoryRoot: 'C:\\workspace\\personal\\projects\\aryx',
|
||||
packageJsonPath: 'C:\\workspace\\personal\\projects\\aryx\\package.json',
|
||||
repositoryRoot: testRepositoryRoot,
|
||||
packageJsonPath: testPackageJsonPath,
|
||||
},
|
||||
dependencies,
|
||||
);
|
||||
@@ -148,8 +152,8 @@ describe('release workflow', () => {
|
||||
await expect(
|
||||
runReleaseWorkflow(
|
||||
{
|
||||
repositoryRoot: 'C:\\workspace\\personal\\projects\\aryx',
|
||||
packageJsonPath: 'C:\\workspace\\personal\\projects\\aryx\\package.json',
|
||||
repositoryRoot: testRepositoryRoot,
|
||||
packageJsonPath: testPackageJsonPath,
|
||||
},
|
||||
dependencies,
|
||||
),
|
||||
@@ -173,8 +177,8 @@ describe('release workflow', () => {
|
||||
await expect(
|
||||
runReleaseWorkflow(
|
||||
{
|
||||
repositoryRoot: 'C:\\workspace\\personal\\projects\\aryx',
|
||||
packageJsonPath: 'C:\\workspace\\personal\\projects\\aryx\\package.json',
|
||||
repositoryRoot: testRepositoryRoot,
|
||||
packageJsonPath: testPackageJsonPath,
|
||||
bumpArg: 'minor',
|
||||
},
|
||||
dependencies,
|
||||
@@ -204,8 +208,8 @@ describe('release workflow', () => {
|
||||
await expect(
|
||||
runReleaseWorkflow(
|
||||
{
|
||||
repositoryRoot: 'C:\\workspace\\personal\\projects\\aryx',
|
||||
packageJsonPath: 'C:\\workspace\\personal\\projects\\aryx\\package.json',
|
||||
repositoryRoot: testRepositoryRoot,
|
||||
packageJsonPath: testPackageJsonPath,
|
||||
},
|
||||
dependencies,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user