From 4324abd387fff938b42d0f8a6f12fdef91170096 Mon Sep 17 00:00:00 2001 From: Peppa Date: Mon, 16 Nov 2026 06:37:21 +0500 Subject: [PATCH 1/2] =?UTF-8?q?WTC-33:=20=D0=BE=D0=B1=D1=8A=D1=8F=D1=81?= =?UTF-8?q?=D0=BD=D0=B8=D1=82=D1=8C,=20=D0=BF=D0=BE=D1=87=D0=B5=D0=BC?= =?UTF-8?q?=D1=83=20=D1=83=20=D0=B1=D0=BB=D1=8E=D0=B4=D0=B0=20=D0=BD=D0=B5?= =?UTF-8?q?=D1=82=20=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA=D0=B8=20=C2=AB=D0=A0?= =?UTF-8?q?=D0=B5=D1=86=D0=B5=D0=BF=D1=82=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- openspec/changes/wtc-33-explain-no-recipe/design.md | 1 + .../changes/wtc-33-explain-no-recipe/proposal.md | 4 ++++ .../wtc-33-explain-no-recipe/specs/recipes/spec.md | 9 +++++++++ openspec/changes/wtc-33-explain-no-recipe/tasks.md | 2 ++ src/app.js | 2 ++ src/i18n.js | 12 ++++++------ src/index.html | 1 + test/empty-recipe-hint.test.js | 2 +- test/no-recipe-today.test.js | 13 +++++++++++++ test/recipe-example.test.js | 2 +- 10 files changed, 40 insertions(+), 8 deletions(-) create mode 100644 openspec/changes/wtc-33-explain-no-recipe/design.md create mode 100644 openspec/changes/wtc-33-explain-no-recipe/proposal.md create mode 100644 openspec/changes/wtc-33-explain-no-recipe/specs/recipes/spec.md create mode 100644 openspec/changes/wtc-33-explain-no-recipe/tasks.md create mode 100644 test/no-recipe-today.test.js diff --git a/openspec/changes/wtc-33-explain-no-recipe/design.md b/openspec/changes/wtc-33-explain-no-recipe/design.md new file mode 100644 index 0000000..8202bc1 --- /dev/null +++ b/openspec/changes/wtc-33-explain-no-recipe/design.md @@ -0,0 +1 @@ +Текст noRecipe в i18n заменён на полную фразу; в результате выбора добавлен абзац #noRecipeToday вместо кнопки «Рецепт». diff --git a/openspec/changes/wtc-33-explain-no-recipe/proposal.md b/openspec/changes/wtc-33-explain-no-recipe/proposal.md new file mode 100644 index 0000000..3f87857 --- /dev/null +++ b/openspec/changes/wtc-33-explain-no-recipe/proposal.md @@ -0,0 +1,4 @@ +## Why +Рядом со своим блюдом нет «Рецепта», и непонятно почему. +## What Changes +Подпись «Рецепта для этого блюда пока нет» в списке и в результате выбора. diff --git a/openspec/changes/wtc-33-explain-no-recipe/specs/recipes/spec.md b/openspec/changes/wtc-33-explain-no-recipe/specs/recipes/spec.md new file mode 100644 index 0000000..d8c6b2b --- /dev/null +++ b/openspec/changes/wtc-33-explain-no-recipe/specs/recipes/spec.md @@ -0,0 +1,9 @@ +## ADDED Requirements +### Requirement: Пояснение, почему нет рецепта +Для блюда без рецепта система SHALL показывать подпись «Рецепта для этого блюда пока нет» вместо кнопки «Рецепт». + +#### Scenario: Блюдо без рецепта выпало в выборе +- **GIVEN** в списке только своё блюдо «мантово» +- **WHEN** пользователь нажимает «Что приготовить?» +- **THEN** кнопки «Рецепт» нет +- **AND** видна подпись «Рецепта для этого блюда пока нет» diff --git a/openspec/changes/wtc-33-explain-no-recipe/tasks.md b/openspec/changes/wtc-33-explain-no-recipe/tasks.md new file mode 100644 index 0000000..d4b523e --- /dev/null +++ b/openspec/changes/wtc-33-explain-no-recipe/tasks.md @@ -0,0 +1,2 @@ +- [x] Подпись в списке и в выдаче (i18n, app.js, index.html) +- [x] Тест test/no-recipe-today.test.js diff --git a/src/app.js b/src/app.js index a1d06e6..0b17778 100644 --- a/src/app.js +++ b/src/app.js @@ -35,6 +35,8 @@ function render() { $("dish").textContent = state.last ?? ""; $("recipeToday").hidden = !(show && findRecipe(state.last)); + $("noRecipeToday").hidden = !(show && !findRecipe(state.last)); + $("noRecipeToday").textContent = t.noRecipe; $("recipeToday").textContent = t.recipe; $("recipeToday").setAttribute("aria-label", show ? t.recipeLabel.replace("{name}", state.last) : ""); const lvl = state.last ? difficultyOf(state.last) : null; diff --git a/src/i18n.js b/src/i18n.js index 84ffbfd..c607a46 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -19,12 +19,12 @@ export const messages = { exampleAdded: "«{name}» — добавлено", examplesAllAdded: "Все примеры добавлены. Впишите своё блюдо в поле выше.", examplesNote: "Это только примеры из нашей базы — можно вписать и своё блюдо.", - noRecipeHint: "Пометка «Рецепта нет» стоит у блюд, которых нет в нашей базе. Рецепты есть только у блюд из базы.", + noRecipeHint: "Подпись «Рецепта для этого блюда пока нет» стоит у блюд, которых нет в нашей базе. Рецепты есть только у блюд из базы.", pick: "Что приготовить?", yourDishes: "Ваши блюда", today: "Сегодня готовим:", recipe: "Рецепт", - noRecipe: "Рецепта нет", + noRecipe: "Рецепта для этого блюда пока нет", suggestHint: "Начните вводить — предложим блюда из базы казахской кухни.", fromCatalog: "Из базы", recipeLabel: "Рецепт блюда «{name}»", @@ -60,12 +60,12 @@ export const messages = { exampleAdded: "«{name}» — қосылды", examplesAllAdded: "Барлық мысал қосылды. Өз тағамыңызды жоғарыдағы жолға жазыңыз.", examplesNote: "Бұл біздің қордағы мысалдар ғана — өз тағамыңызды да жаза аласыз.", - noRecipeHint: "«Рецепт жоқ» белгісі біздің қорда жоқ тағамдарда тұрады. Рецепт тек қордағы тағамдарда бар.", + noRecipeHint: "«Бұл тағамның рецепті әзірге жоқ» жазуы біздің қорда жоқ тағамдарда тұрады. Рецепт тек қордағы тағамдарда бар.", pick: "Не дайындаймыз?", yourDishes: "Сіздің тағамдарыңыз", today: "Бүгін дайындаймыз:", recipe: "Рецепт", - noRecipe: "Рецепт жоқ", + noRecipe: "Бұл тағамның рецепті әзірге жоқ", suggestHint: "Жаза бастаңыз — қазақ тағамдары қорынан тағамдар ұсынамыз.", fromCatalog: "Қордан", recipeLabel: "«{name}» тағамының рецепті", @@ -101,12 +101,12 @@ export const messages = { exampleAdded: "“{name}” — added", examplesAllAdded: "All examples are added. Type your own dish in the field above.", examplesNote: "These are just examples from our collection — you can type your own dish too.", - noRecipeHint: "“No recipe” marks dishes that are not in our collection. Only dishes from the collection have a recipe.", + noRecipeHint: "“No recipe for this dish yet” marks dishes that are not in our collection. Only dishes from the collection have a recipe.", pick: "What to cook?", yourDishes: "Your dishes", today: "Today you cook:", recipe: "Recipe", - noRecipe: "No recipe", + noRecipe: "No recipe for this dish yet", suggestHint: "Start typing — we will suggest dishes from the Kazakh cuisine base.", fromCatalog: "From the base", recipeLabel: "Recipe for “{name}”", diff --git a/src/index.html b/src/index.html index c6d4919..ae15120 100644 --- a/src/index.html +++ b/src/index.html @@ -26,6 +26,7 @@ +