6 commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
e4ec12960f
|
fix(ui): skip composer injection in child session (#33)
## Что сделано Фикс бага из issue #32: в child session (subagent) кнопка 🎤 появлялась над disabled-блоком "Prompt is disabled / Back to parent", а клик падал с toast "Could not find input field". - **`src/ui.ts` `findComposer()`** — добавлен guard: `session-prompt-dock` skip'ается в цикле `COMPOSER_SELECTORS`, если внутри него НЕТ `[data-component="prompt-input"]` или `[data-component="prompt-input-v2"]`. В child session внутри dock'а только disabled-блок — guard срабатывает, `findComposer()` возвращает `null`, кнопка не вставляется. - **`src/ui.ts` `injectIntoComposer()`** — defence-in-depth: ранний return, если в документе нет `[data-component="prompt-input"], [data-component="prompt-input-v2"]`. Страховка от любых future-случаев отсутствия реального composer (не только child session). - **Бамп `@version`** 1.0.2 → 1.0.3 синхронно в `package.json` и `vite.config.ts` — разблокировать автообновление userscript-менеджеров (ловушка PR #29 → #30). - **`tests/ui.test.ts`** (новый, 5 кейсов): dock с `prompt-input-v2` → кнопка есть; dock с `prompt-input` → кнопка есть; dock без composer (child session disabled-блок) → кнопки нет; пустой dock → кнопки нет; question-dock открыт → composer-кнопки нет (PR #31 regression guard). Тестирует через публичный `setupUI` + side-effect (`.ocvd-btn` в DOM). - **Handoff** `docs/handoff/pr-XX-child-session-disabled-composer.md` и **ADR 0004** `docs/decisions/0004-pr-XX-child-session-composer-guard.md` с placeholder'ом PR-номера (исправлю после получения номера). Это тот же класс бага, что и PR #31 (question-dock duplicate button) — `session-prompt-dock` использовался как composer-target когда реальный composer внутри не отрендерен. PR #31 пофиксил question-dock case, этот PR закрывает child-session case. ## Почему - **`session-prompt-dock` — общий wrapper для трёх состояний.** В `anomalyco/opencode` (`session-composer-region.tsx`) dock рендерится всегда когда `showComposer()` truthy (`!blocked() || !!parentID()` → в child session всегда truthy). Внутри условно: question-dock (PR #31), disabled-блок "Prompt is disabled / Back to parent" (child session, этот PR), или реальный composer. - **`findComposer()` выбирал wrapper.** `COMPOSER_SELECTORS` = [`prompt-input-v2`, `session-prompt-dock`, `session-new-composer`, `session-composer`] (ADR 0001). В child session `prompt-input-v2` отсутствует, `session-prompt-dock` присутствует. Guard PR #31 (skip если внутри `session-question-dock`) не срабатывал — внутри disabled-блок, не question-dock. - **Клик падал.** Кнопка вставлялась в dock через `injectIntoElement` (`position: absolute; top: 8px; right: 8px`). При клике → `insertIntoContenteditable()` → `querySelector('[data-component="prompt-input"]')` = `null` → toast "Could not find input field". - **Defence-in-depth.** Guard в `findComposer` (не возвращать dock без composer внутри) + guard в `injectIntoComposer` (не вставлять если в документе нет composer). Оба слоя независимы — любой один достаточно, второй страховка на race conditions. Аналог паттерна PR #31 / ADR 0003. Closes #32 Closes #32 --------- Co-authored-by: opencode-agent <agent@opencode.local> |
||
|
|
02601cb360
|
fix(ui): prevent duplicate mic button in question-dock (#31)
## Что сделано - `findComposer()` в `src/ui.ts` теперь skip `session-prompt-dock` если внутри есть `session-question-dock` — общий wrapper не используется как composer-target пока открыт question - `injectIntoComposer()` в `src/ui.ts` добавлен guard: не вставлять composer-кнопку если в DOM есть `[data-slot="question-custom-input"]` (открыт textarea "Свой ответ") - Бамп `@version` 1.0.1 → 1.0.2 в `package.json` и `vite.config.ts` — разблокировать автообновление ## Почему `session-prompt-dock` в OpenCode v1.18.3 — общий wrapper И для question-dock, И для composer. Когда агент задаёт вопрос (`questionRequest`), composer скрывается (`blocked=true`), но wrapper остаётся. `findComposer()` находил wrapper и вставлял кнопку в верх блока вопросов → дубликат + кнопка застревала после закрытия question. Defence-in-depth: guard в findComposer + guard в injectIntoComposer. Closes #28 Closes #28 --------- Co-authored-by: opencode-agent <agent@opencode.local> |
||
|
|
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> |
||
|
|
32c7995572
|
build(deps-dev): bump @types/node from 22.20.0 to 26.1.1 (#16)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.20.0 to 26.1.1. <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sergey <93754860+slaid098@users.noreply.github.com> |
||
|
|
f5956d0268
|
build(deps-dev): bump happy-dom from 17.6.3 to 20.10.6 (#6)
Bumps [happy-dom](https://github.com/capricorn86/happy-dom) from 17.6.3 to 20.10.6. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/capricorn86/happy-dom/releases">happy-dom's releases</a>.</em></p> <blockquote> <h2>v20.10.6</h2> <h3>👷♂️ Patch fixes</h3> <ul> <li>Await NodeJS internal ReadableStream promise during teardown - By <strong><a href="https://github.com/capricorn86"><code>@capricorn86</code></a></strong> in task <a href="https://redirect.github.com/capricorn86/happy-dom/issues/2217">#2217</a></li> </ul> <h2>v20.10.5</h2> <h3>👷♂️ Patch fixes</h3> <ul> <li>Adds cache to query selector parser - By <strong><a href="https://github.com/capricorn86"><code>@capricorn86</code></a></strong> in task <a href="https://redirect.github.com/capricorn86/happy-dom/issues/2142">#2142</a> <ul> <li>The selector parser degraded in performance in v20.6.3 to solve more complex selectors</li> <li>Parsing is still a bit slower, but the cache will hopefully mitigate most of the problem</li> </ul> </li> </ul> <h2>v20.10.4</h2> <h3>👷♂️ Patch fixes</h3> <ul> <li>Coerce null qualifiedName to empty string in createDocument - By <strong><a href="https://github.com/Firer"><code>@Firer</code></a></strong> in task <a href="https://redirect.github.com/capricorn86/happy-dom/issues/2206">#2206</a></li> </ul> <h2>v20.10.3</h2> <h3>👷♂️ Patch fixes</h3> <ul> <li>Fix "~=" attribute selector matching hyphenated substrings in CSS selectors - By <strong><a href="https://github.com/mixelburg"><code>@mixelburg</code></a></strong> in task <a href="https://redirect.github.com/capricorn86/happy-dom/issues/2194">#2194</a></li> </ul> <h2>v20.10.2</h2> <h3>👷♂️ Patch fixes</h3> <ul> <li>Updates external dependencies - By <strong><a href="https://github.com/capricorn86"><code>@capricorn86</code></a></strong> in task <a href="https://redirect.github.com/capricorn86/happy-dom/issues/2163">#2163</a></li> </ul> <h2>v20.10.0</h2> <h3>🎨 Features</h3> <ul> <li>Adds support for setting a canvas adapter for handling the canvas rendering using the browser setting <a href="https://github.com/capricorn86/happy-dom/wiki/IOptionalBrowserSettings">canvasAdapter</a> - By <strong><a href="https://github.com/RAprogramm"><code>@RAprogramm</code></a></strong> and <strong><a href="https://github.com/capricorn86"><code>@capricorn86</code></a></strong> in task <a href="https://redirect.github.com/capricorn86/happy-dom/issues/241">#241</a></li> <li>Adds new package <a href="https://github.com/capricorn86/happy-dom/tree/master/packages/%40happy-dom/node-canvas-adapter">@happy-dom/node-canvas-adapter</a> - By <strong><a href="https://github.com/RAprogramm"><code>@RAprogramm</code></a></strong> and <strong><a href="https://github.com/capricorn86"><code>@capricorn86</code></a></strong> in task <a href="https://redirect.github.com/capricorn86/happy-dom/issues/241">#241</a> <ul> <li><a href="https://github.com/capricorn86/happy-dom/tree/master/packages/%40happy-dom/node-canvas-adapter">@happy-dom/node-canvas-adapter</a> is a pluggable canvas adapter for Happy DOM using <a href="https://github.com/Automattic/node-canvas">node-canvas</a>.</li> </ul> </li> <li>Adds support for loading image files when enabling the browser setting <a href="https://github.com/capricorn86/happy-dom/wiki/IOptionalBrowserSettings">enableImageFileLoading</a> - By <strong><a href="https://github.com/capricorn86"><code>@capricorn86</code></a></strong> in task <a href="https://redirect.github.com/capricorn86/happy-dom/issues/241">#241</a></li> <li>Adds support for loading image data URLs - By <strong><a href="https://github.com/capricorn86"><code>@capricorn86</code></a></strong> in task <a href="https://redirect.github.com/capricorn86/happy-dom/issues/241">#241</a></li> <li>Adds support for <a href="https://developer.mozilla.org/en-US/docs/Web/API/ImageData">ImageData</a> - By <strong><a href="https://github.com/capricorn86"><code>@capricorn86</code></a></strong> in task <a href="https://redirect.github.com/capricorn86/happy-dom/issues/241">#241</a></li> <li>Adds support for <a href="https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap">ImageBitmap</a> - By <strong><a href="https://github.com/capricorn86"><code>@capricorn86</code></a></strong> in task <a href="https://redirect.github.com/capricorn86/happy-dom/issues/241">#241</a></li> <li>Adds support for <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap">Window.createImageBitmap()</a> - By <strong><a href="https://github.com/capricorn86"><code>@capricorn86</code></a></strong> in task <a href="https://redirect.github.com/capricorn86/happy-dom/issues/241">#241</a></li> </ul> <h2>v20.9.0</h2> <h3>🎨 Features</h3> <ul> <li>Adds support for event listener properties on Window (e.g. <code>Window.onkeydown</code>) - By <strong><a href="https://github.com/capricorn86"><code>@capricorn86</code></a></strong> in task <a href="https://redirect.github.com/capricorn86/happy-dom/issues/2131">#2131</a></li> </ul> <h2>v20.8.9</h2> <h3>👷♂️ Patch fixes</h3> <ul> <li>Fixes issue where cookies from the current origin was being forwarded to the target origin in fetch requests - By <strong><a href="https://github.com/capricorn86"><code>@capricorn86</code></a></strong> in task <a href="https://redirect.github.com/capricorn86/happy-dom/issues/2117">#2117</a> <ul> <li>A security advisory (<a href="https://github.com/capricorn86/happy-dom/security/advisories/GHSA-w4gp-fjgq-3q4g">GHSA-w4gp-fjgq-3q4g</a>) was reported for this security vulnerability. Big thanks to <a href="https://github.com/r74tech"><code>@r74tech</code></a> for reporting this!</li> </ul> </li> </ul> <h2>v20.8.8</h2> <h3>👷♂️ Patch fixes</h3> <ul> <li>Fixes issue where export names can be interpolated as executable code in ESM - By <strong><a href="https://github.com/capricorn86"><code>@capricorn86</code></a></strong> in task <a href="https://redirect.github.com/capricorn86/happy-dom/issues/2113">#2113</a> <ul> <li>A security advisory (<a href="https://github.com/capricorn86/happy-dom/security/advisories/GHSA-6q6h-j7hj-3r64">GHSA-6q6h-j7hj-3r64</a>) has been reported that shows a security vulnerability where it may be possible to escape the VM context and get access to process level functionality in unsafe environments using CommonJS. Big thanks to <a href="https://github.com/tndud042713"><code>@tndud042713</code></a> for reporting this!</li> </ul> </li> </ul> <h2>v20.8.7</h2> <h3>👷♂️ Patch fixes</h3> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
||
|
|
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 |