TR-54: переключатель языка вверху страницы, текущий язык выделен
All checks were successful
peppa/lint lint: success за 1с
peppa/typecheck typecheck: success за 0с
peppa/test test: success за 3с
peppa/build build: success за 0с
ci / checks (pull_request) Successful in 13s
deploy / deploy (pull_request) Successful in 5s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Peppa 2026-11-16 14:06:54 +05:00
parent cbff475be3
commit 6b19631460
9 changed files with 10 additions and 6 deletions

View File

@ -29,6 +29,7 @@
- TR-34: замер в headless Chrome — сообщение о блокировке на 160–270 px от верха; `--window-size` не сужает окно меньше 500 px. Сообщение об ошибке стоит над полями, а не под формой (TR-21) — не переносить. - TR-34: замер в headless Chrome — сообщение о блокировке на 160–270 px от верха; `--window-size` не сужает окно меньше 500 px. Сообщение об ошибке стоит над полями, а не под формой (TR-21) — не переносить.
- TR-48: сообщение о блокировке — `<p class="error locked" role="alert">` (жёлтый фон, жирный, полоса слева; цвета `--lock-*` в src/views.ts), неверная пара — `class="error"` (розовый); заголовок к сообщению не добавлять (TR-21). `npm run screenshot:lockout` снимает три языка: docs/screenshots/lockout.png (ru), lockout-kk.png, lockout-en.png — все три показаны в памятке. - TR-48: сообщение о блокировке — `<p class="error locked" role="alert">` (жёлтый фон, жирный, полоса слева; цвета `--lock-*` в src/views.ts), неверная пара — `class="error"` (розовый); заголовок к сообщению не добавлять (TR-21). `npm run screenshot:lockout` снимает три языка: docs/screenshots/lockout.png (ru), lockout-kk.png, lockout-en.png — все три показаны в памятке.
- TR-51: снимки сообщения о неверном пароле — docs/screenshots/wrong-password.png, -kk.png, -en.png (логин «proba», одна неверная попытка), показаны в памятке в разделе «Как проверить сообщения при входе»; снимает их та же `npm run screenshot:lockout`. Она переснимает и lockout*.png — если страница не менялась, верни их `git checkout`. Повтор задачи про сообщение при неверном пароле — уже закрыто, со снимком. - TR-51: снимки сообщения о неверном пароле — docs/screenshots/wrong-password.png, -kk.png, -en.png (логин «proba», одна неверная попытка), показаны в памятке в разделе «Как проверить сообщения при входе»; снимает их та же `npm run screenshot:lockout`. Она переснимает и lockout*.png — если страница не менялась, верни их `git checkout`. Повтор задачи про сообщение при неверном пароле — уже закрыто, со снимком.
- TR-54: переключатель языка (`<nav>`) стоит НАД карточкой `<main>` в src/views.ts — в виде «таблеток», текущий язык залит акцентом; под формой по-прежнему только пустота (TR-47). Тесты проверяют `indexOf("<nav") < indexOf("<main")`. Менял вид — пересними `npm run screenshot:lockout`.
## Грабли ## Грабли

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 68 KiB

View File

@ -44,9 +44,12 @@ button, .button { display: block; width: 100%; padding: 12px; font: inherit; fon
text-align: center; text-decoration: none; color: var(--accent-text); background: var(--accent); text-align: center; text-decoration: none; color: var(--accent-text); background: var(--accent);
border: 0; border-radius: 8px; cursor: pointer; } border: 0; border-radius: 8px; cursor: pointer; }
form { margin: 0; } form { margin: 0; }
nav { display: flex; gap: 14px; font-size: 14px; color: var(--muted); } nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; width: 100%; max-width: 400px;
nav a { color: var(--accent); } font-size: 15px; }
nav [aria-current] { color: var(--text); font-weight: 600; text-decoration: none; } nav a { flex: 1 1 auto; min-width: 0; padding: 8px 14px; text-align: center; text-decoration: none;
color: var(--accent); background: var(--card); border: 1px solid var(--line); border-radius: 999px; }
nav [aria-current] { color: var(--accent-text); background: var(--accent); border-color: var(--accent);
font-weight: 600; }
`; `;
interface PageOptions { interface PageOptions {
@ -77,10 +80,10 @@ function page({ lang, path, title, body, refreshSeconds }: PageOptions): string
<link rel="stylesheet" href="/static/style.css"> <link rel="stylesheet" href="/static/style.css">
</head> </head>
<body> <body>
<nav aria-label="${escapeHtml(t(lang, "lang.label"))}">${switcher}</nav>
<main> <main>
${body} ${body}
</main> </main>
<nav aria-label="${escapeHtml(t(lang, "lang.label"))}">${switcher}</nav>
</body> </body>
</html> </html>
`; `;

View File

@ -651,7 +651,7 @@ describe("Requirement: Страница входа без пояснений п
app = await startApp(); app = await startApp();
const html = await (await app.get(`/login?lang=${lang}`)).text(); const html = await (await app.get(`/login?lang=${lang}`)).text();
expect(html).toContain(`<html lang="${lang}">`); expect(html).toContain(`<html lang="${lang}">`);
expect(html.indexOf("<nav")).toBeGreaterThan(html.indexOf("</form>")); expect(html.indexOf("<nav")).toBeLessThan(html.indexOf("<main"));
expect(textUnderForm(html)).toBe(""); expect(textUnderForm(html)).toBe("");
expect(html).not.toContain('class="info"'); expect(html).not.toContain('class="info"');
expect(html).not.toContain("<h2"); expect(html).not.toContain("<h2");
@ -750,7 +750,7 @@ describe("Requirement: Поля входа сразу под пояснение
expect(html).toContain(`<h1>${title}</h1>`); expect(html).toContain(`<h1>${title}</h1>`);
expect(aboveFields(html).trim()).toBe(`<p class="lead">${lead}</p>`); expect(aboveFields(html).trim()).toBe(`<p class="lead">${lead}</p>`);
expect(html).toContain(`<button type="submit">${button}</button>\n</form>`); expect(html).toContain(`<button type="submit">${button}</button>\n</form>`);
expect(html.indexOf("<nav")).toBeGreaterThan(html.indexOf("</form>")); expect(html.indexOf("<nav")).toBeLessThan(html.indexOf("<main"));
expect(textUnderForm(html)).toBe(""); expect(textUnderForm(html)).toBe("");
}, },
); );