π¬ A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots π
TypeScript browser-extensionchrome-extensiondocumentationfirefox-extensionguide-generatorlocal-firstmanifest-v3privacy-firstproductivityreactscreenshotstep-by-step-guidetutorialtypescriptworkflowwxt
fix(desktop): keep whether the mic was on before a pause on the state machine
Luis Ortizfccd01719d5c
diff --git a/apps/desktop/src/main/ipc.ts b/apps/desktop/src/main/ipc.tsindex b057e73..5894b00 100644--- a/apps/desktop/src/main/ipc.ts+++ b/apps/desktop/src/main/ipc.ts@@ -4,6 +4,7 @@ import type { OverlayCommand } from './overlay';export interface DesktopStateUpdate extends CaptureStateUpdate {command: OverlayCommand | null;+ narrationWasLive: boolean;}export type DesktopCaptureStepData = CaptureStepData & {diff --git a/apps/desktop/src/main/overlay/index.ts b/apps/desktop/src/main/overlay/index.tsindex 25dcc8c..5127a60 100644--- a/apps/desktop/src/main/overlay/index.ts+++ b/apps/desktop/src/main/overlay/index.ts@@ -513,7 +513,11 @@ export class CaptureOverlay {if (this.starting) return;if (command === 'pause' && state === CaptureState.RECORDING) {const area = this.mode() === 'area';- this.capture.send({ type: 'PAUSE_CAPTURE', reason: area ? 'area' : 'manual' });+ this.capture.send({+ type: 'PAUSE_CAPTURE',+ reason: area ? 'area' : 'manual',+ narrationWasLive: this.narration !== null && !this.narration.reason,+ });this.onCommand(command);if (area) this.edit();} else if (command === 'resume' && state === CaptureState.PAUSED) {diff --git a/packages/core/src/capture/machine.ts b/packages/core/src/capture/machine.tsindex 2325d1a..9728bed 100644--- a/packages/core/src/capture/machine.ts+++ b/packages/core/src/capture/machine.ts@@ -110,7 +110,7 @@ export const captureMachine = setup({on: {RESUME_CAPTURE: {target: CaptureState.RECORDING,- actions: assign({ pauseReason: null, narrationWasLive: false }),+ actions: assign({ pauseReason: null }),},STEP_REMOVED: { actions: 'removeStep' },STOP_RECORDING: {diff --git a/src/entrypoints/background/__tests__/pause-narration.test.ts b/src/entrypoints/background/__tests__/pause-narration.test.tsindex c77fa8c..777c3b6 100644--- a/src/entrypoints/background/__tests__/pause-narration.test.ts+++ b/src/entrypoints/background/__tests__/pause-narration.test.ts@@ -80,10 +80,12 @@ describe('remembering that narration was on', () => {expect(stopVoiceNarration).not.toHaveBeenCalled();});- it('clears the flag on resume so a later pause starts clean', async () => {+ it('records the mic afresh at the next pause, so an old value never carries over', async () => {voicePhase = 'recording';await pauseCapture('manual');await resumeCapture(vi.fn().mockResolvedValue(true));+ voicePhase = 'idle';+ await pauseCapture('manual');expect(actor.getSnapshot().context.narrationWasLive).toBe(false);});