feat(electron): create recording through tray (#10526)

- added tray menu for controlling recording status
- recording watcher for monitoring system audio input events
This commit is contained in:
pengx17
2025-03-18 04:12:30 +00:00
parent 05329e96c7
commit a016630a82
29 changed files with 1186 additions and 258 deletions

View File

@@ -29,7 +29,7 @@ const config: PlaywrightTestConfig = {
if (process.env.CI) {
config.retries = 5;
config.workers = 2;
config.workers = 1;
}
if (process.env.DEV_SERVER_URL) {

View File

@@ -1,4 +1,5 @@
import crypto from 'node:crypto';
import { setTimeout } from 'node:timers/promises';
import { Package } from '@affine-tools/utils/workspace';
import { expect, type Page } from '@playwright/test';
@@ -71,7 +72,7 @@ export const test = base.extend<{
return electronApp.windows().length > 1;
},
{
timeout: 50000,
timeout: 10000,
}
)
.toBeTruthy();
@@ -83,7 +84,7 @@ export const test = base.extend<{
return !!page;
},
{
timeout: 50000,
timeout: 10000,
}
)
.toBeTruthy();
@@ -147,12 +148,25 @@ export const test = base.extend<{
});
await use(electronApp);
const pages = electronApp.windows();
for (const page of pages) {
await page.close();
}
await electronApp.close();
await removeWithRetry(clonedDist);
const cleanup = async () => {
const pages = electronApp.windows();
for (const page of pages) {
if (page.isClosed()) {
continue;
}
await page.close();
}
await electronApp.close();
await removeWithRetry(clonedDist);
};
await Promise.race([
// cleanup may stuck and fail the test, but it should be fine.
cleanup(),
setTimeout(10000).then(() => {
// kill the electron app if it is not closed after 10 seconds
electronApp.process().kill();
}),
]);
} catch (error) {
console.log(error);
}