From 7b978cfa8cbfec1e401812d058f2a84ba8b14190 Mon Sep 17 00:00:00 2001 From: Peppa Date: Mon, 16 Nov 2026 06:28:33 +0500 Subject: [PATCH 1/4] =?UTF-8?q?WTC-26:=20=D0=BF=D0=BE=D0=B4=D1=81=D0=BA?= =?UTF-8?q?=D0=B0=D0=B7=D0=BA=D0=B0=20=D0=BF=D1=80=D0=BE=20=C2=AB=D0=A0?= =?UTF-8?q?=D0=B5=D1=86=D0=B5=D0=BF=D1=82=D0=B0=20=D0=BD=D0=B5=D1=82=C2=BB?= =?UTF-8?q?=20=D0=B8=20=D0=BD=D0=B0=20=D0=BF=D1=83=D1=81=D1=82=D0=BE=D0=BC?= =?UTF-8?q?=20=D1=8D=D0=BA=D1=80=D0=B0=D0=BD=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- test/empty-recipe-hint.test.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test/empty-recipe-hint.test.js diff --git a/test/empty-recipe-hint.test.js b/test/empty-recipe-hint.test.js new file mode 100644 index 0000000..76d6303 --- /dev/null +++ b/test/empty-recipe-hint.test.js @@ -0,0 +1,13 @@ +import test from "node:test"; +import assert from "node:assert/strict"; +import { readFileSync } from "node:fs"; +import { messages } from "../src/i18n.js"; + +// WTC-26: на пустом экране объяснено и про кнопку «Рецепт», и про «Рецепта нет» +test("Сценарий: Пустой экран объясняет оба случая", () => { + const app = readFileSync(new URL("../src/app.js", import.meta.url), "utf8"); + assert.match(app, /\$\("noRecipeHint"\)\.hidden = n !== 0 && !hasNoRecipe\(/); + assert.match(messages.ru.recipeExampleHint, /кнопка «Рецепт»/); + assert.match(messages.ru.noRecipeHint, /«Рецепта нет»/); + for (const l of ["ru", "kk", "en"]) assert.ok(messages[l].noRecipeHint.length > 20, l); +}); -- 2.45.2 From da935dc541950b86bc6d241a5d764d866ba1d30b Mon Sep 17 00:00:00 2001 From: Peppa Date: Mon, 16 Nov 2026 06:28:45 +0500 Subject: [PATCH 2/4] =?UTF-8?q?WTC-26:=20=D0=BF=D0=BE=D0=BA=D0=B0=D0=B7?= =?UTF-8?q?=D1=8B=D0=B2=D0=B0=D1=82=D1=8C=20=D0=BF=D0=BE=D0=B4=D1=81=D0=BA?= =?UTF-8?q?=D0=B0=D0=B7=D0=BA=D1=83=20=C2=AB=D0=A0=D0=B5=D1=86=D0=B5=D0=BF?= =?UTF-8?q?=D1=82=D0=B0=20=D0=BD=D0=B5=D1=82=C2=BB=20=D0=BD=D0=B0=20=D0=BF?= =?UTF-8?q?=D1=83=D1=81=D1=82=D0=BE=D0=BC=20=D1=8D=D0=BA=D1=80=D0=B0=D0=BD?= =?UTF-8?q?=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- src/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.js b/src/app.js index bc9b5e5..d93f5d9 100644 --- a/src/app.js +++ b/src/app.js @@ -53,7 +53,7 @@ function render() { $("addExample").textContent = example === null ? "" : t.addExample.replace("{name}", example); $("addExample").dataset.name = example ?? ""; $("noRecipeHint").textContent = t.noRecipeHint; - $("noRecipeHint").hidden = !hasNoRecipe(state.dishes, findRecipe); + $("noRecipeHint").hidden = n !== 0 && !hasNoRecipe(state.dishes, findRecipe); const ul = $("list"); ul.replaceChildren(...state.dishes.map((d) => { const li = document.createElement("li"); -- 2.45.2 From e438552a63350b948946ef104e9922c36b507fe1 Mon Sep 17 00:00:00 2001 From: Peppa Date: Mon, 16 Nov 2026 06:28:49 +0500 Subject: [PATCH 3/4] =?UTF-8?q?WTC-26:=20=D0=B7=D0=B0=D0=BC=D0=B5=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=B2=20=D0=BF=D0=B0=D0=BC=D1=8F=D1=82=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- .peppa/memory.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.peppa/memory.md b/.peppa/memory.md index 8efe7b0..765da48 100644 --- a/.peppa/memory.md +++ b/.peppa/memory.md @@ -16,6 +16,7 @@ - WTC-19: фраза про кнопку «Рецепт» — абзац #recipesHint (i18n listRecipes), видна только когда hasRecipe(dishes, findRecipe) из logic.js, т.е. в списке есть блюдо с кнопкой; на пустом экране её нет (требование WTC-14 снято). - WTC-20: пока в списке нет блюда с кнопкой «Рецепт», виден блок #recipeExample (подсказка + кнопка #addExample «Добавить «…»», пример = recipeExample() в logic.js); иначе — фраза #recipesHint (WTC-19). Подпись #noRecipeHint под списком — при блюде без рецепта (hasNoRecipe). - WTC-24: подсказка под кнопкой «Что приготовить?» — i18n pickHint (в app.js #hint: пусто→emptyHint, одно блюдо после выбора→oneHint, иначе pickHint); остальные критерии были готовы с WTC-5..8. +- WTC-26: #noRecipeHint виден на пустом экране (n===0) или при блюде без рецепта; вместе с #recipeExample объясняет оба случая. sed на macOS с | и & падает — правь через Edit. ## Соглашения - Цвета кнопки: доступная #b4500c, недоступная #e8dccb/#5c4a35 (контраст ≥4.5:1, проверяется тестом); opacity для disabled не используем. -- 2.45.2 From 7b52cbe9cab18534cd64798965000b8d8ccc5d25 Mon Sep 17 00:00:00 2001 From: Peppa Date: Mon, 16 Nov 2026 06:29:04 +0500 Subject: [PATCH 4/4] =?UTF-8?q?WTC-26:=20=D1=82=D0=B5=D1=81=D1=82=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=B4=20=D0=BD=D0=BE=D0=B2=D0=BE=D0=B5=20=D1=83=D1=81?= =?UTF-8?q?=D0=BB=D0=BE=D0=B2=D0=B8=D0=B5=20=D0=BF=D0=BE=D0=B4=D1=81=D0=BA?= =?UTF-8?q?=D0=B0=D0=B7=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- test/recipe-example.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/recipe-example.test.js b/test/recipe-example.test.js index 494f186..c60ec5d 100644 --- a/test/recipe-example.test.js +++ b/test/recipe-example.test.js @@ -53,7 +53,7 @@ test("Сценарий: Своё блюдо в списке", () => { assert.equal(findRecipe("Мамин пирог"), null); assert.match(messages.ru.noRecipeHint, /«Рецепта нет»/); assert.ok(messages.ru.noRecipeHint.includes(messages.ru.noRecipe)); - assert.match(read("app.js"), /\$\("noRecipeHint"\)\.hidden = !hasNoRecipe\(state\.dishes, findRecipe\)/); + assert.match(read("app.js"), /\$\("noRecipeHint"\)\.hidden = n !== 0 && !hasNoRecipe\(state\.dishes, findRecipe\)/); const html = read("index.html"); assert.ok(html.indexOf('id="list"') < html.indexOf('id="noRecipeHint"')); }); -- 2.45.2