diff --git a/apps/web/app/(app)/t/[key]/page.tsx b/apps/web/app/(app)/t/[key]/page.tsx index fe8e82a6..98f3a2a7 100644 --- a/apps/web/app/(app)/t/[key]/page.tsx +++ b/apps/web/app/(app)/t/[key]/page.tsx @@ -243,6 +243,7 @@ export default async function StoryPage({ params, searchParams }: { params: Prom openQuestions: productQuestions.length, refining, waitsFor: blockers.filter((b) => b.open).map((b) => b.title), + accepted: !!pendingAccept, }); const body = ( diff --git a/packages/core/src/story-product.ts b/packages/core/src/story-product.ts index f8cc0ab2..1147a9a6 100644 --- a/packages/core/src/story-product.ts +++ b/packages/core/src/story-product.ts @@ -7,6 +7,8 @@ export interface StoryProductInput { archived?: boolean; /** tasks.md progress of the story's plan. */ progress?: { done: number; total: number; current: string | null } | null; + /** PEP-127: «Принять» is remembered and being carried through (`getPendingAccept`). */ + accepted?: boolean; /** A live agent is on the story; its name in the team (PEP-75). */ agentWorking: boolean; agentName?: string | null; @@ -33,6 +35,7 @@ export interface StoryProductView { export const STORY_PRODUCT_TEXT = { nothingNeeded: "От вас сейчас ничего не нужно.", + accepted: { now: "Вы приняли работу — изменения обновляются", next: "Когда проверки пройдут, задача закроется сама. Мы сообщим, когда это случится или если что-то не получится." }, answerBelow: "Ответьте на вопрос ниже.", afterAnswer: "После вашего ответа агент продолжит работу.", archived: { now: "Задача в архиве", next: "Работа по ней не идёт. Вернуть задачу на доску можно в «Подробнее»." }, @@ -73,6 +76,8 @@ export function storyProductView(i: StoryProductInput): StoryProductView { const asked = i.openQuestions > 0; if (i.archived) return { ...base, ...T.archived }; if (i.status === "done") return { ...base, ...T.done }; + // PEP-127: accepted already, Peppa carries it to the end itself — nothing to press again. + if (i.accepted && i.status !== "backlog" && i.status !== "blocked") return { ...base, ...T.accepted }; if (i.status === "review") return { ...base, ...T.review, canAccept: true, canFix: true }; if (i.status === "backlog") { if (i.refining === "waiting") return { ...base, ...T.refiningWaiting, need: T.answerBelow }; diff --git a/packages/testkit/test/story-product.test.ts b/packages/testkit/test/story-product.test.ts index 2678a7d8..94ff8221 100644 --- a/packages/testkit/test/story-product.test.ts +++ b/packages/testkit/test/story-product.test.ts @@ -37,6 +37,16 @@ describe("PEP-120: story page in «Продакт» mode", () => { assert.match(v.need!, /«Принять» или «Поправить»/); }); + test("Принято, Peppa доводит до конца (PEP-127): no buttons, nothing needed", () => { + for (const status of ["review", "in_progress"]) { + const v = view({ status, agentWorking: status === "in_progress", accepted: true }); + assert.equal(v.now, "Вы приняли работу — изменения обновляются"); + assert.ok(!v.canAccept && !v.canFix); + assert.equal(v.need, null); + assert.match(v.next, /закроется сама/); + } + }); + test("Текущий шаг с названием файла: no step text", () => { assert.equal(view({ progress: { done: 2, total: 4, current: "Добавить `core/pay.ts` и тест pay.test.ts" } }).stepText, null); for (const t of ["Тест pay.test.ts", "Обновить packages/core", "Вызвать moveTask", "pnpm run ci зелёный", "Миграция users_table", "Запушить и открыть PR"]) assert.equal(core.plainStep(t), null, t);