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(recording): say narration is paused, not waiting for the next recording

davbio6503b2a0ee86
diff --git a/src/ui/sidepanel/VoiceStatus.tsx b/src/ui/sidepanel/VoiceStatus.tsx
index c4632fd..fa7fbb8 100644
--- a/src/ui/sidepanel/VoiceStatus.tsx
+++ b/src/ui/sidepanel/VoiceStatus.tsx
@@ -7,9 +7,10 @@ import { voiceErrorKey } from './voice-status';
interface VoiceStatusProps {
update: PanelVoiceUpdate;
enabled: boolean;
+ paused?: boolean;
}
-export default function VoiceStatus({ update, enabled }: VoiceStatusProps) {
+export default function VoiceStatus({ update, enabled, paused = false }: VoiceStatusProps) {
if (update.phase === 'error') {
return (
<div className="px-4 pt-2.5 flex items-start gap-2" role="status">
@@ -35,7 +36,9 @@ export default function VoiceStatus({ update, enabled }: VoiceStatusProps) {
return (
<div className="px-4 pt-2.5" role="status">
- <p className="text-[10px] leading-relaxed text-muted-foreground">{i18n.t('voice.nextRecording')}</p>
+ <p className="text-[10px] leading-relaxed text-muted-foreground">
+ {i18n.t(paused ? 'voice.pausedWithCapture' : 'voice.nextRecording')}
+ </p>
</div>
);
}
diff --git a/src/ui/sidepanel/__tests__/voice-status-paused.test.tsx b/src/ui/sidepanel/__tests__/voice-status-paused.test.tsx
new file mode 100644
index 0000000..010dafa
--- /dev/null
+++ b/src/ui/sidepanel/__tests__/voice-status-paused.test.tsx
@@ -0,0 +1,32 @@
+// @vitest-environment jsdom
+import { render, screen } from '@testing-library/react';
+import { describe, expect, it, vi } from 'vitest';
+import type { PanelVoiceUpdate } from '@/lib/port';
+
+vi.mock('../MicMeter', () => ({ default: () => null }));
+
+import VoiceStatus from '../VoiceStatus';
+
+const idle: PanelVoiceUpdate = { type: 'VOICE_UPDATE', phase: 'idle' };
+
+describe('the narration line under a paused recording', () => {
+ it('says narration is paused, not that it starts with the next recording', () => {
+ render(<VoiceStatus update={idle} enabled paused />);
+
+ expect(screen.getByText('voice.pausedWithCapture')).toBeTruthy();
+ expect(screen.queryByText('voice.nextRecording')).toBeNull();
+ });
+
+ it('still promises the next recording when capture is not paused', () => {
+ render(<VoiceStatus update={idle} enabled />);
+
+ expect(screen.getByText('voice.nextRecording')).toBeTruthy();
+ expect(screen.queryByText('voice.pausedWithCapture')).toBeNull();
+ });
+
+ it('says nothing at all when narration is switched off', () => {
+ const { container } = render(<VoiceStatus update={idle} enabled={false} paused />);
+
+ expect(container.textContent).toBe('');
+ });
+});