From 027cd8b81aa06c8a230632bb864bc337eb92bd44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=81=D0=B5=D0=BB=D1=8C?= Date: Sun, 15 Nov 2026 15:21:53 +0500 Subject: [PATCH] =?UTF-8?q?PEP-108:=20web=20dictation=20=E2=80=94=20microp?= =?UTF-8?q?hone=20in=20story,=20comment,=20answer=20and=20chat=20fields=20?= =?UTF-8?q?via=20/api/transcribe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- apps/bot/src/bot.ts | 2 +- apps/web/app/(app)/actions.ts | 1 - apps/web/app/(app)/chats/[chat]/page.tsx | 4 +- apps/web/app/(app)/help/page.tsx | 2 +- apps/web/app/(app)/p/[key]/page.tsx | 4 +- apps/web/app/(app)/t/[key]/tabs.tsx | 2 + apps/web/app/api/transcribe/route.ts | 51 ++++++++ apps/web/components/Dictate.tsx | 7 ++ apps/web/components/DictateButton.tsx | 112 ++++++++++++++++++ apps/web/components/cards.tsx | 7 +- packages/core/src/index.ts | 1 + {apps/bot => packages/core}/src/transcribe.ts | 0 packages/testkit/test/transcribe.test.ts | 38 ++++++ 13 files changed, 224 insertions(+), 7 deletions(-) create mode 100644 apps/web/app/api/transcribe/route.ts create mode 100644 apps/web/components/Dictate.tsx create mode 100644 apps/web/components/DictateButton.tsx rename {apps/bot => packages/core}/src/transcribe.ts (100%) create mode 100644 packages/testkit/test/transcribe.test.ts diff --git a/apps/bot/src/bot.ts b/apps/bot/src/bot.ts index cc433140..45743f2b 100644 --- a/apps/bot/src/bot.ts +++ b/apps/bot/src/bot.ts @@ -75,7 +75,7 @@ import { eq, sql } from "drizzle-orm"; import { choiceToAnswer, esc, renderAnswered, renderQuestion } from "./render.ts"; import { TelegramApi, TelegramError, type InlineButton, type TgCallbackQuery, type TgMessage, type TgUpdate } from "./telegram.ts"; import { dropDraft, loadDraft, parseStoryText, saveDraft, splitStory, updateDraft, type Draft } from "./drafts.ts"; -import { transcribe, transcribeConfig, TranscribeError } from "./transcribe.ts"; +import { transcribe, transcribeConfig, TranscribeError } from "@peppa/core"; /** Longest voice note the bot transcribes (seconds). */ const VOICE_MAX_SEC = 5 * 60; diff --git a/apps/web/app/(app)/actions.ts b/apps/web/app/(app)/actions.ts index c92a609b..b1bc8a67 100644 --- a/apps/web/app/(app)/actions.ts +++ b/apps/web/app/(app)/actions.ts @@ -15,7 +15,6 @@ import { resolveTask, revokeApp, createPairingCode, - getSetting, unpairTelegram, getIncident, getProject as getProjectByKey, diff --git a/apps/web/app/(app)/chats/[chat]/page.tsx b/apps/web/app/(app)/chats/[chat]/page.tsx index 174cf728..2cbd9728 100644 --- a/apps/web/app/(app)/chats/[chat]/page.tsx +++ b/apps/web/app/(app)/chats/[chat]/page.tsx @@ -9,6 +9,7 @@ import { LiveRefresh } from "@/components/LiveRefresh"; import { AgentBadge } from "@/components/AgentBadge"; import { ago, Empty, Flash, PageHeader } from "@/components/common"; import { Hidden, QuestionCard } from "@/components/cards"; +import { Dictate } from "@/components/Dictate"; import { Workspace } from "@/components/Workspace"; import { Button } from "@/components/ui/button"; import { Textarea } from "@/components/ui/input"; @@ -252,8 +253,9 @@ export default async function ChatPage({ params, searchParams }: { params: Promi ) : (
-