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): hide the last screenshot while the next step is captured

Luis Ortiz1c2b02a44b1f
diff --git a/apps/desktop/scripts/check-overlay.ts b/apps/desktop/scripts/check-overlay.ts
index faf7701..1a85a1c 100644
--- a/apps/desktop/scripts/check-overlay.ts
+++ b/apps/desktop/scripts/check-overlay.ts
@@ -253,11 +253,13 @@ app.whenReady().then(async () => {
const whileBusy = await windowWithHash('controls')?.webContents.executeJavaScript(
"document.querySelector('#primary').disabled",
);
- const veil = await card("text: document.querySelector('#veilText').textContent, remove: document.querySelector('#remove').hidden");
+ const veil = await card(
+ "text: document.querySelector('#veilText').textContent, remove: document.querySelector('#remove').hidden, shot: document.querySelector('#shot').hidden",
+ );
check(
- 'a capture in flight shows the mascot over the last screenshot',
- veil.text === 'Capturing step 2…' && veil.remove === true,
- `veil: ${veil.text}, remove hidden: ${veil.remove}`,
+ 'a capture in flight shows the mascot instead of the last screenshot',
+ veil.text === 'Capturing step 2…' && veil.remove === true && veil.shot === true,
+ `veil: ${veil.text}, remove hidden: ${veil.remove}, last screenshot hidden: ${veil.shot}`,
);
overlay.setBusy(false);
await settle();
diff --git a/apps/desktop/src/renderer/overlay/controls.ts b/apps/desktop/src/renderer/overlay/controls.ts
index 03adf21..b7af4d4 100644
--- a/apps/desktop/src/renderer/overlay/controls.ts
+++ b/apps/desktop/src/renderer/overlay/controls.ts
@@ -121,7 +121,7 @@ export function controls(): void {
if (step && shot.getAttribute('src') !== step.src) shot.src = step.src;
preview.hidden = armed || !(busy || step);
- shot.hidden = !step;
+ shot.hidden = !step || busy;
veil.hidden = !(busy || paused);
veilMascot.hidden = !busy;
veilPause.hidden = busy || !paused;