diff --git a/components/CONTRACT.md b/components/CONTRACT.md index 439bba9..e5cb1a4 100644 --- a/components/CONTRACT.md +++ b/components/CONTRACT.md @@ -2,6 +2,10 @@ Уточнения Dock: переключатель 44×24px с бегунком 18px и равными отступами; перемещение и смена цвета — 160ms. Выпадающие и контекстные меню имеют скругление control и появление 180ms; reduced motion отключает анимацию. График показывает ближайшее время и p95 при наведении/касании; стрелки, Home/End и Escape доступны с клавиатуры. Числовая таблица сохранена. Тост использует manual popover в верхнем слое браузера и виден поверх модального затемнения. +Меню аккаунта содержит только Аккаунт, доступную по роли Панель управления, Сменить аккаунт и Выйти из SSO. Настройки и приложения доступны через навигацию личного кабинета. + +Навигация Dock: выбранный пункт сохраняет цвет при наведении. Переход по меню сохраняет раскрытую панель и режим открытия (hover или закрепление); Escape, подложка и уход мыши из hover-меню закрывают её. + Исполняемые образцы: экран Components; таблица и фильтры — Users; вкладки — Settings; вход — Authentication. Основная стилизация в `system.css`. | Компонент | Состояния и взаимодействия | diff --git a/components/account-pages.js b/components/account-pages.js index dfad8cb..65bed1f 100644 --- a/components/account-pages.js +++ b/components/account-pages.js @@ -118,7 +118,7 @@ export function createAccountUI({ return `${heading(title.profile, t("Личные данные и ваш профиль в экосистеме Anidev.", "Your profile across the Anidev ecosystem."))}
${avatar(a, "large")}

${e(names(a))}

@${e(a.username)}

${a.roles.map((r) => `${e(r)}`).join("")}

${t("Личные данные", "Personal information")}

${t("Имя и username можно изменить. Идентификатор аккаунта остаётся прежним.", "Your name and username may change. Your account ID stays the same.")}

Email${a.email ? e(a.email) : t("Не добавлен", "Not added")}${a.emailVerified ? `${t("Подтверждён", "Verified")}` : action("add-email", "Добавить и подтвердить", "Add and verify")}
${t("Для изменения подтверждённой почты обратитесь к администратору.", "Contact your administrator to change a verified email address.")}
${avatar(a)}
PNG, JPEG, WebP · ${t("до 2 МБ", "up to 2 MB")}${action("clear-avatar", "Убрать фото", "Remove photo")}
Account ID${e(a.sub)}
${demo}
`; } function security(a) { - return `${heading(title.security, t("Способы входа и подтверждение важных действий.", "Sign-in methods and verification for important changes."))}

${t("Способы входа", "Sign-in methods")}

${t("Пароль", "Password")}

${t("Последнее изменение: ", "Last changed: ")}${a.passwordChanged ? new Intl.DateTimeFormat(t("ru-RU", "en-US"), { dateStyle: "long" }).format(new Date(a.passwordChanged + "T12:00:00Z")) : t("нет данных", "no data")}

${action("password-link", "Сменить", "Change")}

TOTP

${a.totp ? t("Подключён", "Enabled") : t("Не подключён", "Not enabled")}

${t("Сброс подтверждается ссылкой из письма.", "Reset is verified using an email link.")}
${action(a.totp ? "totp-link" : "enroll-factor", a.totp ? "Сменить" : "Подключить", a.totp ? "Change" : "Set up")}

Passkey

${t("Встроенный способ входа: Windows Hello или Touch ID.", "Platform sign-in with Windows Hello or Touch ID.")}

${action("add-passkey", "Добавить", "Add")}
${a.passkeys.length ? a.passkeys.map((k) => `

${e(k.name)}

${t("Добавлен", "Added")} ${k.created}

`).join("") : `

${t("Passkey ещё не добавлен", "No passkey added yet")}

${t("Добавьте ключ, чтобы входить с помощью устройства.", "Add a key to sign in with your device.")}

`}

${t("Как работают проверки", "How verification works")}

${t("Приложение запрашивает только недостающий фактор. Возможность заменить TOTP свежим Passkey задаёт администратор приложения. Для администрирования SSO требуется отдельный TOTP.", "Applications request only the missing factor. An application administrator decides whether a fresh passkey can replace TOTP. SSO administration requires a separate TOTP verification.")}

${demo}
`; + return `${heading(title.security, t("Способы входа и подтверждение важных действий.", "Sign-in methods and verification for important changes."))}

${t("Способы входа", "Sign-in methods")}

${t("Пароль", "Password")}

${t("Последнее изменение: ", "Last changed: ")}${a.passwordChanged ? new Intl.DateTimeFormat(t("ru-RU", "en-US"), { dateStyle: "long" }).format(new Date(a.passwordChanged + "T12:00:00Z")) : t("нет данных", "no data")}

${action("password-link", "Сменить", "Change")}

TOTP

${a.totp ? t("Подключён", "Enabled") : t("Не подключён", "Not enabled")}

${t("Сброс подтверждается ссылкой из письма.", "Reset is verified using an email link.")}
${action(a.totp ? "totp-link" : "enroll-factor", a.totp ? "Сменить" : "Подключить", a.totp ? "Change" : "Set up")}

Passkey

${t("Встроенный способ входа: Windows Hello или Touch ID.", "Platform sign-in with Windows Hello or Touch ID.")}

${action("add-passkey", "Добавить", "Add")}
${a.passkeys.length ? a.passkeys.map((k) => `

${e(k.name)}

${t("Добавлен", "Added")} ${k.created}

`).join("") : `

${t("Passkey ещё не добавлен", "No passkey added yet")}

${t("Добавьте ключ, чтобы входить с помощью устройства.", "Add a key to sign in with your device.")}

`}

${t("Как работают проверки", "How verification works")}

${t("Приложение запрашивает только недостающий фактор. Возможность заменить TOTP свежим Passkey задаёт администратор приложения. Для администрирования SSO требуется отдельный TOTP.", "Applications request only the missing factor. An application administrator decides whether a fresh passkey can replace TOTP. SSO administration requires a separate TOTP verification.")}

${demo}
`; } function sessions() { const rows = snap().sessions; diff --git a/components/system.css b/components/system.css index ad1c82d..3de3053 100644 --- a/components/system.css +++ b/components/system.css @@ -1033,9 +1033,17 @@ body[data-concept="dock"] .services { gap: 16px; } body[data-concept="dock"] .service { - display: flex; - flex-wrap: wrap; - justify-content: space-between; + display: grid; + grid-template-columns: minmax(0, 1fr) 6ch max-content; + gap: 10px; +} +body[data-concept="dock"] .service > small, +body[data-concept="dock"] .service > .status { + text-align: right; +} +body[data-concept="dock"] .service > span:first-child { + min-width: 0; + overflow-wrap: anywhere; } body[data-concept="dock"] .activity { background: var(--color-surface); @@ -1929,6 +1937,54 @@ body[data-concept="dock"] .header-actions > .avatar { color: var(--color-muted); line-height: 1.7; } +.identity-security .identity-section { + padding: 0; + margin-bottom: 24px; + border-bottom: 0; +} +.identity-security .identity-section > h2, +.identity-security .identity-section > .section-title { + margin: 0; + padding: 12px 16px; +} +.identity-security .identity-setting-row { + padding: 16px; + position: relative; + border-top: 0; + border-radius: var(--radius-control); +} +.identity-security .identity-setting-row::before { + content: ""; + position: absolute; + inset: 0 16px auto; + border-top: 1px solid var(--color-border); + pointer-events: none; +} +.identity-security .identity-setting-row > div { + min-width: 0; +} +.identity-security .identity-setting-row > button { + flex-shrink: 0; +} +.identity-security .identity-setting-row small { + display: block; + margin-top: 6px; + color: var(--color-muted); +} +.identity-security .identity-security-note { + border-top: 1px solid var(--color-border); + padding-top: 12px; +} +.identity-security-note > p { + margin: 0 16px; +} +@media (max-width: 480px) { + .identity-security .identity-setting-row { + flex-direction: column; + align-items: flex-start; + gap: 12px; + } +} .identity-list-heading { display: flex; justify-content: space-between; @@ -2436,7 +2492,9 @@ body[data-concept="dock"] .nav-links button[aria-current="page"] { background: var(--color-row-active); color: var(--color-accent); } -body[data-concept="dock"] .nav-links button:is(:hover, :focus-visible) { +body[data-concept="dock"] + .nav-links + button:not([aria-current="page"]):is(:hover, :focus-visible) { background: var(--color-row-hover); color: var(--color-text); } diff --git a/playground/frame.js b/playground/frame.js index a58ebae..bc0a860 100644 --- a/playground/frame.js +++ b/playground/frame.js @@ -252,9 +252,6 @@ function navigationPages() { function dockAccount() { return `
- - - ${currentIdentity()?.roles.some((r) => ["Master Admin", "SSO Admin"].includes(r)) ? `` : ""}
@@ -342,7 +339,11 @@ function savePreferences() { } catch {} } let initialRender = true; -function render() { +function render({ preserveDock = false } = {}) { + const dockWasOpen = + preserveDock && + document.body.classList.contains("dock-open") && + page !== "auth"; const route = new URL(location.href); route.searchParams.delete("concept"); route.searchParams.set("page", page); @@ -358,9 +359,11 @@ function render() { ]({}, "", route); } initialRender = false; - dockHoverOpened = false; clearTimeout(dockCloseTimer); - document.body.classList.remove("dock-open"); + if (!dockWasOpen) { + dockHoverOpened = false; + document.body.classList.remove("dock-open"); + } document.title = `Anidev / ${concept.name} / ${pageNames[page]}`; const content = accountPageIds.includes(page) ? accountUI.renderPage(page) @@ -386,6 +389,7 @@ function render() { bindForms(); accountUI.bind(page); bindDockHover(); + if (dockWasOpen) setDockOpen(true, false); bindCharts(); if (page === "users" && $("#user-search")) bindUsers(); } @@ -817,10 +821,14 @@ document.addEventListener("click", async (e) => { if (await accountUI.handleClick(e)) return; const pageButton = e.target.closest("[data-page]"); if (pageButton) { + const fromDock = Boolean(pageButton.closest(".navigation")); + if (fromDock && page === pageButton.dataset.page) return; page = pageButton.dataset.page; $("#dialog").close(); - render(); - $("#content")?.focus(); + render({ preserveDock: fromDock }); + if (fromDock && document.body.classList.contains("dock-open")) { + $(".nav-links [aria-current=page]")?.focus({ preventScroll: true }); + } else $("#content")?.focus(); return; } const sorter = e.target.closest("[data-sort]"); diff --git a/references/QA.md b/references/QA.md index eb4ec6b..593c035 100644 --- a/references/QA.md +++ b/references/QA.md @@ -75,3 +75,14 @@ Core 50/50, Dock 10/10, Identity 94/94, TOTP geometry 4/4, feedback/scroll 24/24 Core 50/50, standalone site 35/35 (включая четыре старые ссылки concept), Dock 10/10, Identity 94/94, TOTP 4/4, feedback/scroll 24/24. Всего 217, ошибок JavaScript нет. После удаления неиспользуемой ветки обнаружена и исправлена зависимость формы входа от общего логотипа; соответствующие suite повторены успешно. Дополнительно 36 целевых проверок в Edge: геометрия переключателя в обоих состояниях, двух темах и desktop/mobile; скругление/анимация меню и reduced motion; значения и границы подсказки графика, клавиатура и семидневный диапазон; касание в мобильном контексте; тост в верхнем слое при открытом диалоге. Скриншоты меню, переключателя, графика и тоста проверены визуально. Это не полный аудит доступности. + + +## Dock / навигация и отступы, 30.11.2026 + +У выбранного пункта нет дополнительной hover-подсветки. Переход по пунктам не удаляет dock-open; сохраняются затемнение, inert основной области и способ открытия. Повторный клик выбранного раздела не пересоздаёт экран. Клавиатурный фокус остаётся в меню. + +В безопасности строки получили одинаковые поля 16px, заголовки и кнопки выровнены; мобильные действия переносятся под текст. Сервисы используют общие grid-колонки с выровненными справа значениями задержки. + +Standalone site 35/35 и Dock 10/10 повторены успешно. В site добавлены утверждения сохранения раскрытия/inert после перехода, повторного клика и стабильного цвета выбранного пункта. Дополнительная проверка: 12 сочетаний RU/EN, двух тем и трёх ширин (1440/768/390), отступы/переполнение безопасности, общая колонка задержек, переход из hover-Dock и Escape; ошибок JavaScript нет. Скриншоты безопасности desktop/mobile и сервисов проверены визуально. + +Меню аккаунта сокращено до Аккаунта, Панели управления (по роли), Сменить аккаунт и Выйти из SSO. В обеих темах проверены отсутствие трёх удалённых пунктов и сохранение оставшихся действий. diff --git a/references/dock-revision/dark-desktop-account.png b/references/dock-revision/dark-desktop-account.png index d633794..4de7a6e 100644 Binary files a/references/dock-revision/dark-desktop-account.png and b/references/dock-revision/dark-desktop-account.png differ diff --git a/references/dock-revision/dark-desktop-collapsed.png b/references/dock-revision/dark-desktop-collapsed.png index 4a96fff..87c1a61 100644 Binary files a/references/dock-revision/dark-desktop-collapsed.png and b/references/dock-revision/dark-desktop-collapsed.png differ diff --git a/references/dock-revision/dark-desktop-expanded.png b/references/dock-revision/dark-desktop-expanded.png index 0423b2e..cc2f98b 100644 Binary files a/references/dock-revision/dark-desktop-expanded.png and b/references/dock-revision/dark-desktop-expanded.png differ diff --git a/references/dock-revision/dark-mobile-account.png b/references/dock-revision/dark-mobile-account.png index 7f8bfc6..6a64540 100644 Binary files a/references/dock-revision/dark-mobile-account.png and b/references/dock-revision/dark-mobile-account.png differ diff --git a/references/dock-revision/dark-mobile-expanded.png b/references/dock-revision/dark-mobile-expanded.png index 9848513..58b5d82 100644 Binary files a/references/dock-revision/dark-mobile-expanded.png and b/references/dock-revision/dark-mobile-expanded.png differ diff --git a/references/dock-revision/dark-tablet-account.png b/references/dock-revision/dark-tablet-account.png index 2540de4..30cf782 100644 Binary files a/references/dock-revision/dark-tablet-account.png and b/references/dock-revision/dark-tablet-account.png differ diff --git a/references/dock-revision/dark-tablet-collapsed.png b/references/dock-revision/dark-tablet-collapsed.png index 77604e3..d42c0b5 100644 Binary files a/references/dock-revision/dark-tablet-collapsed.png and b/references/dock-revision/dark-tablet-collapsed.png differ diff --git a/references/dock-revision/dark-tablet-expanded.png b/references/dock-revision/dark-tablet-expanded.png index 6f9dd57..af163ab 100644 Binary files a/references/dock-revision/dark-tablet-expanded.png and b/references/dock-revision/dark-tablet-expanded.png differ diff --git a/references/dock-revision/light-desktop-account.png b/references/dock-revision/light-desktop-account.png index a4034f2..f69df4d 100644 Binary files a/references/dock-revision/light-desktop-account.png and b/references/dock-revision/light-desktop-account.png differ diff --git a/references/dock-revision/light-desktop-collapsed.png b/references/dock-revision/light-desktop-collapsed.png index 779cca2..7db0a91 100644 Binary files a/references/dock-revision/light-desktop-collapsed.png and b/references/dock-revision/light-desktop-collapsed.png differ diff --git a/references/dock-revision/light-desktop-expanded.png b/references/dock-revision/light-desktop-expanded.png index 4a80822..cb71f09 100644 Binary files a/references/dock-revision/light-desktop-expanded.png and b/references/dock-revision/light-desktop-expanded.png differ diff --git a/references/dock-revision/light-tablet-account.png b/references/dock-revision/light-tablet-account.png index bd3601a..8420d3e 100644 Binary files a/references/dock-revision/light-tablet-account.png and b/references/dock-revision/light-tablet-account.png differ diff --git a/references/dock-revision/light-tablet-collapsed.png b/references/dock-revision/light-tablet-collapsed.png index 6653c77..7382b7f 100644 Binary files a/references/dock-revision/light-tablet-collapsed.png and b/references/dock-revision/light-tablet-collapsed.png differ diff --git a/references/dock-revision/light-tablet-expanded.png b/references/dock-revision/light-tablet-expanded.png index 226bbed..d0f6197 100644 Binary files a/references/dock-revision/light-tablet-expanded.png and b/references/dock-revision/light-tablet-expanded.png differ diff --git a/references/site/dark-desktop.png b/references/site/dark-desktop.png index 124e6da..74bdef4 100644 Binary files a/references/site/dark-desktop.png and b/references/site/dark-desktop.png differ diff --git a/references/site/dark-mobile.png b/references/site/dark-mobile.png index 72e3bc7..7efc414 100644 Binary files a/references/site/dark-mobile.png and b/references/site/dark-mobile.png differ diff --git a/references/site/light-desktop.png b/references/site/light-desktop.png index 75fb136..83af342 100644 Binary files a/references/site/light-desktop.png and b/references/site/light-desktop.png differ diff --git a/references/site/light-mobile.png b/references/site/light-mobile.png index 0dafdae..25d0144 100644 Binary files a/references/site/light-mobile.png and b/references/site/light-mobile.png differ diff --git a/references/site/navigation-dark-desktop.png b/references/site/navigation-dark-desktop.png index 24ed984..f455f33 100644 Binary files a/references/site/navigation-dark-desktop.png and b/references/site/navigation-dark-desktop.png differ diff --git a/references/site/navigation-light-desktop.png b/references/site/navigation-light-desktop.png index 1c1f216..f8d227d 100644 Binary files a/references/site/navigation-light-desktop.png and b/references/site/navigation-light-desktop.png differ diff --git a/references/site/navigation-light-mobile.png b/references/site/navigation-light-mobile.png index 90b7205..b5a5457 100644 Binary files a/references/site/navigation-light-mobile.png and b/references/site/navigation-light-mobile.png differ diff --git a/tests/dock.mjs b/tests/dock.mjs index 5c1452c..3b8234c 100644 --- a/tests/dock.mjs +++ b/tests/dock.mjs @@ -147,6 +147,16 @@ try { await p.locator(".dock-toggle").getAttribute("aria-expanded"), "true", ); + await p.locator('.nav-links [data-page="users"]').click(); + await p.waitForTimeout(300); + assert.equal( + await p.locator(".dock-toggle").getAttribute("aria-expanded"), + "true", + ); + assert.equal( + await p.locator(".main-column").evaluate((el) => el.inert), + true, + ); await p.mouse.move(380, 400); await p.waitForTimeout(450); assert.equal( @@ -174,7 +184,7 @@ try { await touch.close(); passed++; await p.emulateMedia({ reducedMotion: "reduce" }); - await p.reload(); + await p.goto(`${base}/?page=dashboard`); assert.equal( await p .locator(".panel") diff --git a/tests/site.mjs b/tests/site.mjs index 162595d..e9365d5 100644 --- a/tests/site.mjs +++ b/tests/site.mjs @@ -76,6 +76,33 @@ try { }); await p.locator(".nav-links [data-page=users]").click(); await p.locator("#user-search").waitFor(); + assert.equal( + await p.locator(".dock-brand").getAttribute("aria-expanded"), + "true", + ); + assert.equal( + await p.locator(".main-column").evaluate((el) => el.inert), + true, + ); + const selectedItem = p.locator('.nav-links [aria-current="page"]'); + await p.mouse.move(width - 12, height - 12); + await p.waitForTimeout(200); + const selectedColor = await selectedItem.evaluate( + (el) => getComputedStyle(el).backgroundColor, + ); + await selectedItem.hover(); + await p.waitForTimeout(160); + assert.equal( + await selectedItem.evaluate( + (el) => getComputedStyle(el).backgroundColor, + ), + selectedColor, + ); + await selectedItem.click(); + assert.equal( + await p.locator(".dock-brand").getAttribute("aria-expanded"), + "true", + ); assert.equal(new URL(p.url()).searchParams.get("page"), "users"); assert.equal( await p