feat(notifications): custom test-notification text in web (#563)#630
feat(notifications): custom test-notification text in web (#563)#630axisrow wants to merge 1 commit into
Conversation
CLI `notification test` accepts `--message`, but the web "Тест" button sent a fixed string — same action, different behaviour. Bring web to parity: - dispatcher `_handle_notifications_test` honours payload["text"] when present, falling back to the default message otherwise; - web handle_test_notification reads an optional `text` form field and only forwards it when non-blank; - settings notifications form gains an optional text input. Addresses the "Тест уведомлений" parity gap from #563. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PR reviewI read the full diff plus the wrapper/CLI/agent code that surrounds it. Overall: 👍 solid PR, correctly scoped and testedThe core fix is right:
Issues worth flagging1. Incomplete parity claim (medium)The PR description says "CLI уже поддерживал
@tool("test_notification", "Send a test notification message via the bot", {})
async def test_notification(args):
...
await svc.send_notification("🔔 Тестовое уведомление от агента")So:
This is a tiny addition (a Also worth noting: the CLI uses 2. Test name is mildly misleading (low)
3. Dispatcher one-liner is dense but correct (low/nit)text = str(payload.get("text") or "").strip() or "✅ Тест уведомлений: соединение установлено"The raw = payload.get("text")
text = (raw.strip() if isinstance(raw, str) else "") or "✅ Тест уведомлений: соединение установлено"Optional cleanup. 4. Template — inline style (nit)
VerdictShip it after deciding on #1 (close the agent gap in this PR, or amend the PR description to call it a known remaining gap). Items 2–4 are nits — none block merge. 🤖 Review generated with Claude Code |
|
@claude review |
|
Claude encountered an error after 52s —— View job PR Review in Progress
|

Addresses the «Тест уведомлений» parity gap from #563.
Проблема
Одно и то же действие вело себя по-разному: CLI
notification test --message "..."позволяет задать свой текст, а кнопка «Тест» в вебе всегда слала фиксированную строку.Решение
_handle_notifications_test: используетpayload["text"], если задан и непустой; иначе — дефолтное сообщение.handle_test_notification: читает необязательное поле формыtextи прокидывает его в payload только если оно непустое (пустое → дефолт диспетчера).settings/_notifications.html: добавлено необязательное текстовое поле рядом с кнопкой «Тест».CLI уже поддерживал
--message, поэтому правок там не требуется — теперь поведение совпадает.Проверка
ruffчисто; dispatcher + web notifications + CLI notification тесты — 191 passed (включая новые: кастомный текст в payload, пустой текст → пустой payload, дефолт диспетчера).🤖 Generated with Claude Code