Skip to content

armgit / mimik

Public Imported from GitHub
0

🎬 A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots πŸ“–

fix(desktop): keep the Dock icon while recording and open the area editor on pause

Luis Ortiz1a7aedd0c0e7
diff --git a/apps/desktop/scripts/check-overlay.ts b/apps/desktop/scripts/check-overlay.ts
index e07263e..ff6342a 100644
--- a/apps/desktop/scripts/check-overlay.ts
+++ b/apps/desktop/scripts/check-overlay.ts
@@ -152,10 +152,13 @@ app.whenReady().then(async () => {
);
await windowWithHash('controls')?.webContents.executeJavaScript("document.querySelector('#secondary').click()");
await settle();
+ const pausedInto = overlay.state;
+ overlay.run('cancel');
+ await settle();
check(
- 'Pause reaches the host and pauses',
- commands.includes('pause') && overlay.state === 'paused',
- `commands: ${commands.join(', ')}; state is ${overlay.state}`,
+ 'Pause in Area mode pauses and opens the area editor, and Cancel leaves it paused',
+ commands.includes('pause') && pausedInto === 'editing' && overlay.state === 'paused',
+ `commands: ${commands.join(', ')}; pause opened ${pausedInto}, cancel left ${overlay.state}`,
);
await windowWithHash('controls')?.webContents.executeJavaScript("document.querySelector('#primary').click()");
await settle();
diff --git a/apps/desktop/src/main/index.ts b/apps/desktop/src/main/index.ts
index 35ecb25..a2297bf 100644
--- a/apps/desktop/src/main/index.ts
+++ b/apps/desktop/src/main/index.ts
@@ -117,7 +117,6 @@ function showWindow(): void {
return;
}
if (mainWindow.isMinimized()) mainWindow.restore();
- void app.dock?.show();
mainWindow.show();
mainWindow.focus();
}
diff --git a/apps/desktop/src/main/overlay/index.ts b/apps/desktop/src/main/overlay/index.ts
index 368dc8c..0cfd841 100644
--- a/apps/desktop/src/main/overlay/index.ts
+++ b/apps/desktop/src/main/overlay/index.ts
@@ -1,6 +1,6 @@
import { join } from 'node:path';
import type { AiFailureReason } from '@mimik/core/capture/ai/errors';
-import { BrowserWindow, ipcMain, screen } from 'electron';
+import { app, BrowserWindow, ipcMain, screen } from 'electron';
import { clampToDisplays, loadRegion, type Region, saveRegion } from '../capture/region';
import type { CaptureMode } from '../capture/settings';
@@ -116,7 +116,9 @@ function overlayWindow(
});
win.setAlwaysOnTop(true, 'screen-saver');
+ app.dock?.hide();
win.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true });
+ void app.dock?.show();
if (!interactive) win.setIgnoreMouseEvents(true);
const load = process.env.ELECTRON_RENDERER_URL
? win.loadURL(`${process.env.ELECTRON_RENDERER_URL}/overlay.html#${hash}`)
@@ -459,6 +461,7 @@ export class CaptureOverlay {
this.hide();
}
this.onCommand(command);
+ if (command === 'pause' && this.mode() === 'region') this.edit();
}
async withHidden<T>(fn: () => Promise<T>): Promise<T> {