Commit graph

5 commits

Author SHA1 Message Date
Sergey
36169b4b08
fix(ui): broaden page gate + debug logging + version bump (#30)
## Что сделано
- Расширен gate `isOpencodePage()` в `src/insert.ts`: теперь проверяет
любой из 6 селекторов (`prompt-input`, `prompt-input-v2`,
`session-prompt-dock`, `session-composer`, `session-new-composer`,
`question-custom-input`) вместо одного `prompt-input`. Это активирует
скрипт раньше на v1.18.x, где композер может монтироваться lazy.
- Добавлено отладочное логирование с префиксом `[ocvd]` в `src/index.ts`
(init, gate retry) и `src/ui.ts` (composer found/not found, mic button
injected). Пользователь может видеть в DevTools Console где скрипт
останавливается.
- Бамп `@version` до `1.0.1` в `package.json` и `vite.config.ts` —
разблокирует автообновление userscript-менеджеров (после PR #29 версия
осталась `1.0.0`, автообновление не сработает).

## Почему
PR #29 добавил корректные селекторы для v1.18.x, но пользователи не
получили обновление из-за не-бампнутой `@version`. Также gate
`isOpencodePage()` проверял только `prompt-input`, которого может не
быть в DOM на ранних этапах lazy-mount. Добавление логирования поможет
диагностировать runtime-проблемы в DevTools.

Closes #28

---------

Co-authored-by: opencode-agent <agent@opencode.local>
2026-07-25 02:03:39 +03:00
Sergey
3eec9f311c
fix: spinner clockwise, lock target on start, context-aware shortcut (#18)
## Что сделано

### Спиннер крутится по часовой стрелке
- Зеркально отражён SVG-arrow (стрелка указывает вправо)
- Вращение изменено с counterclockwise (-360deg) на clockwise (360deg)

### Fix: «Could not find input field» в question prompt
- **Корень проблемы**: `currentTarget` перезаписывался при каждом вызове
`toggleDictation`, включая остановку. Если запись начата с микрофона
question prompt (target="question"), а остановлена через Ctrl+Space
(target всегда "composer"), target перезаписывался → текст вставлялся не
туда.
- **Фикс**: `currentTarget` устанавливается только при старте записи
(state="idle")
- Ctrl+Space теперь контекстно-зависимый: если открыт question prompt —
target="question", иначе "composer"
- Auto-submit для question prompt уже был отключён — без изменений

Co-authored-by: opencode-agent <agent@slaid098.dev>
2026-07-09 06:37:23 +03:00
Sergey
13cbc2cc83
fix: cancel button less transparent, remove cancel toast (#12)
- Cancel button background opacity: 0.2 → 0.5 (more visible)
- Cancel button text color: gray → white
- Remove 'Recording cancelled' toast (visual state change is sufficient)

Co-authored-by: opencode-agent <agent@slaid098.dev>
2026-07-08 10:05:51 +03:00
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
opencode-agent
3bd443dde3 feat: initial implementation of OpenCode Voice Dictation
- TypeScript + Vite (vite-plugin-monkey) userscript
- Groq API integration with whisper-large-v3
- Tap-to-toggle recording with noise suppression
- Contenteditable text insertion for OpenCode web
- Ctrl+Space keyboard shortcut (desktop)
- Custom Whisper prompt for software development context
- Recording timer, toast notifications, auto-submit option
- 44 unit tests, 100% line coverage
- Biome linter, Knip, Vitest, CI/CD pipeline
- Bilingual README (EN/RU) with compatibility table
2026-07-08 05:37:17 +00:00