opencode-voice-dictation/tests
Sergey 960acd8a7a
feat: cancel button, question prompt mic, solid timer (#10)
## Changes

### Cancel button (✕)
- New cancel button appears during recording next to stop button
- Tapping ✕ stops recording and **discards audio** — no text inserted
- Tapping ⏹ stops recording and **inserts text** (as before)

### Question prompt support
- Mic button injected into `[data-slot=question-custom-input]` (custom
answer textarea)
- Text insertion via `selectionStart`/`selectionEnd` (textarea ≠
contenteditable)
- MutationObserver detects when question prompt appears

### Solid timer
- Timer background: `#e53935` (opaque red) with white text
- Was `rgba(229, 57, 53, 0.1)` (semi-transparent — text showed through)
- Now fully visible over any text

### Technical
- Refactored UI to use CSS classes instead of single IDs (supports
multiple buttons)
- `insertText()` now takes `target: "composer" | "question"`
- 47 tests, 100% line coverage

Co-authored-by: opencode-agent <agent@slaid098.dev>
2026-07-08 09:40:24 +03:00
..
__mocks__/$ feat: initial implementation of OpenCode Voice Dictation 2026-07-08 05:37:17 +00:00
audio.test.ts feat: initial implementation of OpenCode Voice Dictation 2026-07-08 05:37:17 +00:00
config.test.ts feat: initial implementation of OpenCode Voice Dictation 2026-07-08 05:37:17 +00:00
insert.test.ts feat: cancel button, question prompt mic, solid timer (#10) 2026-07-08 09:40:24 +03:00
keyboard.test.ts feat: initial implementation of OpenCode Voice Dictation 2026-07-08 05:37:17 +00:00
transcribe.test.ts feat: initial implementation of OpenCode Voice Dictation 2026-07-08 05:37:17 +00:00