PEP-127: страница задачи для продакта после «Принять» — без повторной кнопки, «изменения обновляются, закроется сама»

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Асель 2026-11-15 22:21:35 +05:00
parent a99e6abe6d
commit c6a14a6dba
3 changed files with 16 additions and 0 deletions

View File

@ -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 = (

View File

@ -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 };

View File

@ -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);