diff --git a/DESIGN.md b/DESIGN.md index 424a1f9..10e55bc 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -47,3 +47,11 @@ icons/icons.js — общий источник 64 линейных иконок. SSH-консоль и log-ридер — собственные страницы Dock, а также образцы на странице компонентов. Терминал имеет чёрный фон #000 в обеих темах; текст и ANSI-палитра рассчитаны на этот фон. Обрамление и инструменты используют выбранную тему Dock. Площадь терминала автоматически пересчитывает количество строк и колонок. Перехват клавиатуры ограничен фокусом терминала, предусмотрен доступный выход Ctrl+Shift+M. Log-ридер использует моноширинные строки, явные уровни DEBUG/INFO/WARN/ERROR, фильтры и отдельную панель события. На мобильном метаданные переносятся над сообщением, без горизонтального скролла всей страницы. Открытие события останавливает следование, чтобы поток не сдвигал выбранные данные. + +## Группы навигации и обратная связь + +В Dock поддерживаются раскрываемые группы: «Администрирование» объединяет SSH-консоль и логи. В раскрытом меню активная дочерняя страница получает подложку, а заголовок группы — акцент текста/иконки; в свёрнутом Dock подложка отмечает сам раздел. Вложенность обозначена отступом и тонкой направляющей. Открытие группы не сбрасывает текущую рабочую область. + +Самостоятельные подписанные радио и checkbox оформляются в choice-pill: одинаковая вертикальная ось, округлая общая область нажатия и выбранное состояние. Для readonly сохраняются выделение и копирование. Компонентные образцы соблюдают зазоры между соседними контролами. + +Тосты имеют четыре семантических состояния: success, info, warning и error. Цвет подкрепляется иконкой, заголовком и текстом. Новый токен color.warning задаёт янтарный акцент: #795519 в светлой и #e8c889 в тёмной теме. Тосты не перехватывают фокус при появлении; ошибка не скрывается по таймеру. diff --git a/README.md b/README.md index 67b38e6..0dea64b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ node scripts/serve.mjs ``` -Просмотр: [http://127.0.0.1:4173/](http://127.0.0.1:4173/). Нужен Node.js 22+ или Python 3; зависимости для просмотра не требуются. Альтернатива: `python scripts/serve.py`. Оба сервера запрещают кэширование, чтобы после обновления открывался актуальный Dock. Прямой file:// не поддерживает ES modules. +Просмотр: [http://127.0.0.1:4173/](http://127.0.0.1:4173/). Нужен Node.js 22+ или Python 3; зависимости для просмотра не требуются. Альтернатива: `python scripts/serve.py`. Оба сервера запрещают кэширование, чтобы после обновления открывался актуальный Dock. Python-сервер имеет увеличенную очередь подключений; в Windows порт закрепляется за одним экземпляром. Прямой file:// не поддерживает ES modules. ## Иконки @@ -28,11 +28,11 @@ node scripts/serve.mjs ## Возможности -Самостоятельный сайт Dock на весь экран, без внешней панели просмотра и iframe. Разделы открываются собственной навигацией, URL поддерживают перезагрузку и Back/Forward. Светлая/тёмная тема выбирается в личном кабинете и сохраняется. Параметры locale/density/accent доступны в URL; внешних регуляторов нет. Компоненты и токены — собственные страницы Dock. Экспорт находится на странице токенов. Старый /playground/ перенаправляет на корень с сохранением параметров. +Самостоятельный сайт Dock на весь экран, без внешней панели просмотра и iframe. SSH-консоль и логи сгруппированы в раскрываемое «Администрирование». Разделы открываются собственной навигацией, URL поддерживают перезагрузку и Back/Forward. Светлая/тёмная тема выбирается в личном кабинете и сохраняется. Параметры locale/density/accent доступны в URL; внешних регуляторов нет. Компоненты и токены — собственные страницы Dock. Экспорт находится на странице токенов. Старый /playground/ перенаправляет на корень с сохранением параметров. Строки таблиц, сервисов, событий, сеансов, приложений и настроек имеют заметные hover/focus и состояния выбора. Полоса прокрутки оформлена под тему; место для неё резервируется, поэтому меню и диалоги не сдвигают контент. -Работают поиск, фильтры, пагинация, редактирование пользователей и доступов, диалоги, меню аккаунта и command palette. Панель раскрывается при наведении; a/ поддерживает клик, клавиатуру и touch. +В библиотеке компонентов показаны четыре состояния тостов, readonly-поле и подписанные радио/чекбоксы в капсулах. Работают поиск, фильтры, пагинация, редактирование пользователей и доступов, диалоги, меню аккаунта и command palette. Панель раскрывается при наведении; a/ поддерживает клик, клавиатуру и touch. Личный кабинет и состояния входа — демонстрации на тестовых данных. Сам SSO Service не изменяется; реальная авторизация, письма и Passkey не выполняются. Данные примера хранятся в sessionStorage вкладки; пароли и токены не сохраняются. Сброс — на экране состояний входа. @@ -49,6 +49,9 @@ npm run test:dock npm run test:identity npm run test:approved npm run test:site +npm run test:icons +npm run test:workspaces +npm run test:feedback ``` Suite использует Edge на Windows или PLAYWRIGHT_EXECUTABLE_PATH. Для другого порта задайте BASE_URL. [QA](references/QA.md), [проверки утверждённого Dock](references/approved-dock/README.md). diff --git a/components/CONTRACT.md b/components/CONTRACT.md index 5401fc8..3c42557 100644 --- a/components/CONTRACT.md +++ b/components/CONTRACT.md @@ -4,7 +4,7 @@ Меню аккаунта содержит только Аккаунт, доступную по роли Панель управления, Сменить аккаунт и Выйти из SSO. Настройки и приложения доступны через навигацию личного кабинета. -Навигация Dock: выбранный пункт сохраняет цвет при наведении. Переход по меню сохраняет раскрытую панель и режим открытия (hover или закрепление); Escape, подложка и уход мыши из hover-меню закрывают её. +Навигация Dock: выбранный пункт сохраняет цвет при наведении. «Администрирование» — disclosure-группа с SSH-консолью и логами. aria-expanded и aria-controls описывают её состояние; закрытые дети inert и aria-hidden. В узком Dock видна только иконка раздела. Переход на дочернюю страницу сохраняет раскрытие Dock и группы, повторный клик не пересоздаёт рабочую область. Enter/Space переключают группу, Right открывает и фокусирует первый пункт, Left закрывает, Up/Down перемещают фокус внутри группы. Escape сначала закрывает подменю, затем Dock; модифицированные стрелки сохраняют браузерное поведение. Переход по меню сохраняет раскрытую панель и режим открытия (hover или закрепление); Escape, подложка и уход мыши из hover-меню закрывают её. Иконки: только icons/icons.js, SVG 24×24 со stroke 1.5 и круглыми окончаниями. В Dock ось значка совпадает с центром подложки и аватара; при раскрытии значок не сдвигается. Клавиатурный фокус внутри панели рисуется с inset 2px. Табличные checkbox центрируются по высоте строки; disabled-кнопки не получают hover-фон. @@ -12,6 +12,23 @@ Рабочие области: SSH — xterm.js, black surface, resize, управляющие коды, history/completion, clipboard, поиск, fullscreen и Keyboard Lock с fallback. Перехват действует только в активном терминале; Ctrl+Shift+M возвращает фокус панели, выключенный ввод не перехватывает Tab. Log reader — текст/level/source-фильтры, пауза с очередью, follow, ограниченные окна строк, детали JSON, безопасное чтение файлов и экспорт. Контракт транспорта, ограничения браузера и cleanup описаны в patterns/WORKSPACES.md. +Поля: readonly остаётся фокусируемым и позволяет выделение/копирование, но не редактирование. Программный фокус #content не рисует рамку вокруг всей страницы. В sample-control-row зазор 12px и общая высота контролов; на мобильном они стоят друг под другом. + +Choice pill: подписанные checkbox/radio помещаются внутрь label.choice-pill со span текста. Вся капсула кликабельна; native input сохраняет поведение и клавиатуру. Контрол и подпись центрированы, checked меняет фон/рамку/цвет, focus-visible обводит капсулу; минимальная высота 40px, на мобильном 44px. Табличные checkbox остаются компактными. + +Тосты: createNotifier из toast.js, типы success/info/warning/error. Иконка, заголовок, текст, семантический акцент и закрытие. Таймеры: 4/5/8 секунд, ошибка без автоматического скрытия. Hover и фокус приостанавливают таймер. Повторный вызов заменяет активное уведомление. Error использует role=alert/assertive; остальные status/polite. Текст вставляется через textContent. Тост помещается в активный dialog и показывается в верхнем слое: затемнение не перекрывает его, закрытие доступно мышью и клавиатурой, фокус возвращается инициатору. + +```js +import { createNotifier } from "./components/toast.js"; +const notify = createNotifier(document.querySelector("#toast"), { + t: (ru, en) => ru, +}); +notify("Изменения сохранены", { type: "success" }); +notify("Проверьте соединение", { type: "warning", title: "Нет ответа" }); +notify("Операция завершилась ошибкой", { type: "error" }); +notify.dismiss(); +``` + Исполняемые образцы: экран Components; таблица и фильтры — Users; вкладки — Settings; вход — Authentication. Основная стилизация в `system.css`. | Компонент | Состояния и взаимодействия | diff --git a/components/export-system.js b/components/export-system.js index e1c8a1f..f3251c9 100644 --- a/components/export-system.js +++ b/components/export-system.js @@ -105,6 +105,7 @@ export async function exportSystem( "icons/anidev-dock-icons.zip", ...iconNames.map((name) => `icons/svg/${name}.svg`), "components/system.css", + "components/toast.js", "components/workspaces.css", "components/ssh-console.js", "components/log-reader.js", diff --git a/components/system.css b/components/system.css index 87d19fe..10eabf6 100644 --- a/components/system.css +++ b/components/system.css @@ -974,25 +974,88 @@ dialog > p { background: var(--color-accent); color: var(--color-on-accent); } -#toast { +:is(#toast, .anidev-toast) { + --toast-tone: var(--color-accent); position: fixed; inset: auto; margin: 0; - border: 0; - bottom: 25px; + bottom: 24px; left: 50%; transform: translateX(-50%); - background: var(--color-text); - color: var(--color-bg); - padding: 12px 20px; + width: min(420px, calc(100% - 32px)); + max-width: calc(100% - 32px); + background: var(--color-surface); + color: var(--color-text); + border: 1px solid + color-mix(in srgb, var(--toast-tone) 30%, var(--color-border)); + border-left: 3px solid var(--toast-tone); border-radius: var(--radius-control); - font-size: 14px; + box-shadow: 0 8px 32px #0003; + padding: 14px; + font-size: 13px; z-index: 100; display: none; - max-width: calc(100% - 32px); } -#toast:popover-open { - display: block; +:is(#toast, .anidev-toast)[data-type="success"] { + --toast-tone: var(--color-success); +} +:is(#toast, .anidev-toast)[data-type="warning"] { + --toast-tone: var(--color-warning); +} +:is(#toast, .anidev-toast)[data-type="error"] { + --toast-tone: var(--color-danger); +} +:is(#toast, .anidev-toast):popover-open { + display: flex; + align-items: flex-start; + gap: 12px; + animation: toast-enter 180ms ease-out; +} +.toast-symbol { + display: grid; + place-items: center; + flex-shrink: 0; + width: 30px; + height: 30px; + border-radius: 50%; + background: color-mix(in srgb, var(--toast-tone) 12%, var(--color-surface)); + color: var(--toast-tone); +} +.toast-content { + display: grid; + gap: 4px; + flex: 1; + min-width: 0; +} +.toast-title { + font-size: 14px; + line-height: 20px; +} +.toast-message { + line-height: 1.5; + overflow-wrap: anywhere; +} +:is(#toast, .anidev-toast) .toast-dismiss { + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + width: 28px; + min-height: 28px; + padding: 6px; + border: 0; + background: transparent; + color: var(--color-muted); +} +@keyframes toast-enter { + from { + opacity: 0; + translate: 0 6px; + } + to { + opacity: 1; + translate: 0 0; + } } .skip { position: fixed; @@ -2585,3 +2648,197 @@ body[data-concept="dock"] .nav-links button { background-color 120ms ease-out, color 120ms ease-out; } + +#content:focus { + outline: none; +} +.sample-control-row { + display: grid; + grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr); + gap: 12px; + align-items: stretch; + max-width: 440px; + margin-top: 18px; +} +.sample-control-row > :is(input, select) { + width: 100%; + min-width: 0; + height: calc(var(--size-control) + 8px); +} +input[readonly] { + cursor: default; + background: color-mix(in srgb, var(--color-muted) 6%, var(--color-surface)); +} +.choice-pill, +.form-row .choice-pill { + display: inline-flex; + align-items: center; + justify-content: flex-start; + gap: 8px; + flex: 0 1 auto; + min-height: 40px; + padding: 8px 12px; + border: 1px solid var(--color-border); + border-radius: 999px; + background: var(--color-surface); + font-size: 14px; + line-height: 20px; + cursor: pointer; +} +.choice-pill > :is(input[type="checkbox"], input[type="radio"]) { + display: block; + width: 18px; + height: 18px; + margin: 0; + flex-shrink: 0; +} +.choice-pill > span { + line-height: 20px; +} +.choice-pill:hover { + background: var(--color-row-hover); +} +.choice-pill:has(input:checked) { + background: var(--color-row-active); + border-color: var(--color-accent); + color: var(--color-accent); +} +.choice-pill:has(input:focus-visible) { + outline: 2px solid var(--color-accent); + outline-offset: 2px; +} +.choice-pill > input:focus-visible { + outline: none; +} +.choice-pill:has(input:disabled) { + opacity: 0.5; + cursor: not-allowed; +} +body[data-concept="dock"] .navigation { + --nav-icon-track: 50px; +} +body[data-concept="dock"] .navigation > .dock-brand, +body[data-concept="dock"] .dock-account-area { + flex-shrink: 0; +} +body[data-concept="dock"] .navigation > .nav-links { + min-height: 0; + flex: 1 1 auto; + overflow-y: auto; + overflow-x: hidden; + scrollbar-width: thin; +} +body[data-concept="dock"]:not(.dock-open) .navigation > .nav-links { + scrollbar-width: none; +} +body[data-concept="dock"] .nav-links > button, +.nav-group { + flex-shrink: 0; +} +.nav-group { + min-width: 0; +} +.nav-group-label { + position: relative; + display: block; + padding-right: 24px; +} +.nav-chevron { + position: absolute; + right: 8px; + top: 50%; + width: 16px; + height: 16px; + translate: 0 -50%; + transition: transform 160ms ease; +} +.nav-group.is-expanded .nav-chevron { + transform: rotate(180deg); +} +.nav-submenu-container { + display: grid; + grid-template-rows: 0fr; + opacity: 0; + transition: + grid-template-rows 180ms ease, + opacity 140ms ease; +} +.nav-group.is-expanded .nav-submenu-container { + grid-template-rows: 1fr; + opacity: 1; +} +.nav-submenu-clip { + min-height: 0; + overflow: hidden; +} +.nav-submenu-list { + margin: 4px 0 4px 25px; + padding: 0 0 0 14px; + border-left: 1px solid var(--color-border); + display: grid; + gap: 4px; +} +body[data-concept="dock"] .nav-submenu-list button { + grid-template-columns: 24px minmax(0, 1fr); + gap: 10px; + padding: 8px 8px 8px 0; + min-height: 40px; + font-size: 13px; +} +body[data-concept="dock"] .nav-submenu-list .nav-icon { + width: 18px; + height: 18px; +} +body[data-concept="dock"] .nav-group-toggle[data-active="true"] { + background: var(--color-row-active); + color: var(--color-accent); +} +body[data-concept="dock"] + .nav-links + .nav-group-toggle[data-active="true"]:is(:hover, :focus-visible) { + background: var(--color-row-active); + color: var(--color-accent); +} +@media (max-width: 600px) { + .sample-control-row { + grid-template-columns: 1fr; + } + .choice-pill, + .form-row .choice-pill { + min-height: 44px; + } + body[data-concept="dock"] .nav-submenu-list button { + min-height: 44px; + } +} + +.selection-specimen fieldset { + margin: 0; + min-width: 0; +} +.selection-specimen legend { + padding: 0; +} + +body[data-concept="dock"] .navigation .wordmark > span { + text-align: left; +} +body[data-concept="dock"].dock-open + .nav-links + .nav-group-toggle[data-active="true"] { + background: transparent; + color: var(--color-accent); +} +body[data-concept="dock"].dock-open + .nav-links + .nav-group-toggle[data-active="true"]:is(:hover, :focus-visible) { + background: var(--color-row-hover); + color: var(--color-text); +} +:is(#toast, .anidev-toast) .toast-dismiss:hover:not(:disabled) { + background: var(--color-row-hover); + color: var(--color-text); +} +.choice-pill:has(input:disabled) > input { + cursor: not-allowed; +} diff --git a/components/toast.js b/components/toast.js new file mode 100644 index 0000000..55b7f29 --- /dev/null +++ b/components/toast.js @@ -0,0 +1,99 @@ +import { iconSvg } from "../icons/icons.js"; +const types = { + success: { icon: "check", ru: "Готово", en: "Success", duration: 4000 }, + info: { icon: "info", ru: "Информация", en: "Information", duration: 5000 }, + warning: { icon: "warning", ru: "Внимание", en: "Warning", duration: 8000 }, + error: { icon: "error", ru: "Ошибка", en: "Error", duration: 0 }, +}; +export function createNotifier(element, { t = (ru) => ru } = {}) { + element.classList.add("anidev-toast"); + let timer, + remaining = 0, + started = 0, + active = false, + invoker = null; + function hide() { + clearTimeout(timer); + active = false; + if (element.isConnected && element.matches(":popover-open")) + element.hidePopover(); + } + function resume() { + if (!active || !remaining) return; + clearTimeout(timer); + started = performance.now(); + timer = setTimeout(hide, remaining); + } + function pause() { + if (!active || !remaining) return; + clearTimeout(timer); + remaining = Math.max(1, remaining - (performance.now() - started)); + } + element.addEventListener("pointerenter", pause); + element.addEventListener("pointerleave", () => { + if (!element.contains(document.activeElement)) resume(); + }); + element.addEventListener("focusin", pause); + element.addEventListener("focusout", (event) => { + if (!element.contains(event.relatedTarget) && !element.matches(":hover")) + resume(); + }); + element.addEventListener("click", (event) => { + if (event.target.closest("[data-toast-dismiss]")) { + const restore = element.contains(document.activeElement); + hide(); + if ( + restore && + invoker?.isConnected && + !invoker.closest("[inert]") && + invoker.getClientRects().length + ) + invoker.focus({ preventScroll: true }); + } + }); + // A modal makes outside elements inert: put the toast inside it, then use the top layer. + document.addEventListener( + "close", + (event) => { + if ( + event.target instanceof HTMLDialogElement && + event.target.contains(element) + ) { + hide(); + document.body.append(element); + } + }, + { capture: true }, + ); + function notify(message, { type = "info", title, duration } = {}) { + type = Object.hasOwn(types, type) ? type : "info"; + const config = types[type]; + if (!element.contains(document.activeElement)) + invoker = document.activeElement; + hide(); + const modal = [...document.querySelectorAll("dialog[open]")].at(-1); + if (element.parentElement !== (modal || document.body)) + (modal || document.body).append(element); + element.popover = "manual"; + element.dataset.type = type; + element.setAttribute("role", type === "error" ? "alert" : "status"); + element.setAttribute( + "aria-live", + type === "error" ? "assertive" : "polite", + ); + element.setAttribute("aria-atomic", "true"); + element.innerHTML = `${iconSvg(config.icon, { size: 20 })}
`; + element.querySelector(".toast-title").textContent = + title || t(config.ru, config.en); + element.querySelector(".toast-message").textContent = String(message); + active = true; + remaining = + Number.isFinite(duration) && duration >= 0 ? duration : config.duration; + element.showPopover(); + started = performance.now(); + if (!element.matches(":hover") && !element.contains(document.activeElement)) + resume(); + } + notify.dismiss = hide; + return notify; +} diff --git a/concepts/registry.js b/concepts/registry.js index 01ec1b5..401232b 100644 --- a/concepts/registry.js +++ b/concepts/registry.js @@ -79,6 +79,7 @@ export function tokensFor(id, theme = "light", accent, density = "normal") { "color.on-accent": on, "color.danger": dark ? "#ffafa5" : "#a22923", "color.success": dark ? "#a2d3ab" : "#26623b", + "color.warning": dark ? "#e8c889" : "#795519", "color.row-hover": rowHover, "color.row-active": rowActive, "radius.control": c.radius, diff --git a/icons/catalog.js b/icons/catalog.js index 6f4e6f6..8c028f6 100644 --- a/icons/catalog.js +++ b/icons/catalog.js @@ -1,3 +1,4 @@ +import { createNotifier } from "../components/toast.js"; import { icons, iconNames, iconSvg } from "./icons.js"; import { tokensFor, cssVars } from "../concepts/registry.js"; const $ = (s) => document.querySelector(s); @@ -13,8 +14,7 @@ const categories = { }; for (const [id, label] of Object.entries(categories)) $("#category").add(new Option(label, id)); -let theme = "light", - timer; +let theme = "light"; try { theme = JSON.parse(localStorage.getItem("anidev.preferences") || "{}").theme === @@ -54,22 +54,19 @@ $("#theme").addEventListener("click", () => { theme = theme === "dark" ? "light" : "dark"; applyTheme(); }); +const notify = createNotifier($("#toast")); $("#icon-grid").addEventListener("click", async (e) => { const tile = e.target.closest("[data-icon]"); if (!tile) return; - const toast = $("#toast"); - toast.popover = "manual"; + try { await navigator.clipboard.writeText( iconSvg(tile.dataset.icon, { size: Number($("#size").value) }), ); - toast.textContent = `SVG скопирован: ${tile.dataset.icon}`; + notify(`SVG скопирован: ${tile.dataset.icon}`, { type: "success" }); } catch { - toast.textContent = "Не удалось скопировать. Скачайте SVG-пак."; + notify("Не удалось скопировать. Скачайте SVG-пак.", { type: "error" }); } - toast.showPopover(); - clearTimeout(timer); - timer = setTimeout(() => toast.hidePopover(), 2800); }); applyTheme(); render(); diff --git a/package.json b/package.json index cf3ca64..be1c7cd 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "test:dock": "node tests/dock.mjs", "test:identity": "node tests/identity.mjs && node tests/totp-layout.mjs", "test:approved": "node tests/approved-dock.mjs", - "test:site": "node tests/site.mjs" + "test:site": "node tests/site.mjs", + "test:feedback": "node tests/navigation-feedback.mjs" }, "devDependencies": { "playwright": "^1.58.0" diff --git a/playground/frame.js b/playground/frame.js index d212fef..78045d8 100644 --- a/playground/frame.js +++ b/playground/frame.js @@ -1,3 +1,4 @@ +import { createNotifier } from "../components/toast.js"; import { sshScreen, mountSsh } from "../components/ssh-console.js"; import { logsScreen, mountLogs } from "../components/log-reader.js"; import { iconSvg } from "../icons/icons.js"; @@ -194,9 +195,12 @@ const pageNames = { identity: t("Состояния входа", "Sign-in states"), }; const icon = (id) => - iconSvg({ ssh: "terminal", logs: "document" }[id] || id, { - className: "nav-icon", - }); + iconSvg( + { ssh: "terminal", logs: "document", administration: "server" }[id] || id, + { + className: "nav-icon", + }, + ); const wordmark = '
a/anidev
'; function persist() { try { @@ -206,18 +210,7 @@ function persist() { toast(t("Хранилище браузера недоступно", "Browser storage unavailable")); } } -let toastTimer; -function toast(message) { - const notification = $("#toast"); - notification.popover = "manual"; - notification.textContent = message; - if (notification.matches(":popover-open")) notification.hidePopover(); - notification.showPopover(); - clearTimeout(toastTimer); - toastTimer = setTimeout(() => { - notification.hidePopover(); - }, 3500); -} +const toast = createNotifier($("#toast"), { t }); function currentIdentity() { return identityAdapter.snapshot().account; } @@ -234,7 +227,14 @@ function accountInitials() { function navigationPages() { return accountPageIds.includes(page) ? ["profile", "security", "sessions", "applications", "appearance"] - : ["dashboard", "users", "settings", "ssh", "logs", "components", "tokens"]; + : [ + "dashboard", + "users", + "settings", + "administration", + "components", + "tokens", + ]; } function dockAccount() { return `
@@ -244,13 +244,41 @@ ${currentIdentity()?.roles.some((r) => ["Master Admin", "SSO Admin"].includes(r)
`; } +let administrationOpen = ["ssh", "logs"].includes(page); +function navPage(id, label = pageNames[id]) { + return ``; +} +function administrationNav() { + const active = ["ssh", "logs"].includes(page); + return ``; +} +function syncAdministration() { + const group = $("[data-nav-group=administration]"); + if (!group) return; + const expanded = + administrationOpen && document.body.classList.contains("dock-open"); + group.classList.toggle("is-expanded", expanded); + group + .querySelector(".nav-group-toggle") + .setAttribute("aria-expanded", String(expanded)); + group + .querySelector(".nav-submenu-container") + .setAttribute("aria-hidden", String(!expanded)); + group.querySelector(".nav-submenu-container").inert = !expanded; +} +function setAdministration(open, focusChild = false) { + if (open && !document.body.classList.contains("dock-open")) { + dockHoverOpened = false; + setDockOpen(true, false); + } + administrationOpen = open; + syncAdministration(); + if (open && focusChild) $("#administration-submenu button")?.focus(); +} function nav() { const dockBrand = ``; return ``; @@ -310,6 +338,7 @@ function setDockOpen(open, returnFocus = true) { ); toggle.title = toggle.getAttribute("aria-label"); $(".main-column").inert = open; + syncAdministration(); if (open) { nav.setAttribute("role", "dialog"); nav.setAttribute("aria-modal", "true"); @@ -624,13 +653,23 @@ function auth() { return `
${wordmark}
${t("Ваша инфраструктура.
Под вашим контролем.", "Your infrastructure.
Under your control.")}
ANIDEV IDENTITY / ${t("ДЕМОНСТРАЦИЯ", "DEMONSTRATION")}

${t("Вход в Anidev", "Sign in to Anidev")}

${t("Продолжите работу с вашим пространством.", "Continue to your workspace.")}

${t("или корпоративный аккаунт", "or your company account")}
© Anidev 2026
`; } function componentScreen() { - return `${heading(t("Библиотека компонентов", "Component library"), t("Единые состояния. Шесть способов выражения.", "Shared states. Six ways of expressing them."), ``)}
+ return `${heading(t("Библиотека компонентов", "Component library"), t("Единые компоненты и состояния Dock.", "Shared Dock components and states."), ``)}

Buttons

Hover · active · focus · disabled · loading
-

Inputs & selects

-

Selection controls

${t("Период хранения", "Retention period")}
+

Inputs & selects

+

Selection controls

${t("Период хранения", "Retention period")}

Overlays & feedback

${t("Скопировать идентификатор", "Copy identifier")}
${t("Действия проекта", "Project actions")}
${t("Контекстное меню: правая кнопка, Shift+F10 или Enter", "Context menu: right click, Shift+F10 or Enter")}

Empty state

${t("Пока нет API-ключей", "No API keys yet")}

${t("Создайте ключ для подключения сервиса.", "Create a key to connect your service.")}

Error & skeleton

${t("Не удалось загрузить журнал.", "Could not load the log.")}

+

${t("Уведомления", "Notifications")}

${[ + ["success", t("Успех", "Success")], + ["info", t("Информация", "Information")], + ["warning", t("Предупреждение", "Warning")], + ["error", t("Ошибка", "Error")], + ] + .map( + ([type, label]) => ``, + ) + .join("")}

${t("Статусы", "Status indicators")}

${iconSvg("check", { size: 16 })}${t("Работает", "Operational")}${iconSvg("close", { size: 16 })}${t("Недоступен", "Unavailable")}${iconSvg("more-horizontal", { size: 16 })}${t("Ожидает", "Pending")}

${t("Состояние выражено текстом, а не только цветом.", "Status uses text as well as color.")}

${t("Рабочие области", "Workspaces")}

${t("SSH-терминал и ридер логов в стиле Dock.", "SSH terminal and log reader in Dock style.")}

${t("Иконки Anidev", "Anidev icons")}

${["profile", "security", "sessions", "applications", "settings", "copy", "key", "bell"].map(icon).join("")}

${t("64 SVG · сетка 24×24 · контур 1.5px", "64 SVGs · 24×24 grid · 1.5px stroke")}

${t("Открыть пак иконок →", "Open icon pack →")}
@@ -842,6 +881,7 @@ document.addEventListener("click", async (e) => { const fromDock = Boolean(pageButton.closest(".navigation")); if (fromDock && page === pageButton.dataset.page) return; page = pageButton.dataset.page; + if (["ssh", "logs"].includes(page)) administrationOpen = true; $("#dialog").close(); render({ preserveDock: fromDock }); if (fromDock && document.body.classList.contains("dock-open")) { @@ -876,6 +916,32 @@ document.addEventListener("click", async (e) => { .querySelectorAll("[popover=auto]:popover-open") .forEach((el) => el.hidePopover()); const actions = { + "toast-success": () => + toast(t("Изменения сохранены.", "Changes saved."), { type: "success" }), + "toast-info": () => + toast( + t( + "В журнале появилось новое событие.", + "A new event is available in the log.", + ), + { type: "info" }, + ), + "toast-warning": () => + toast( + t( + "Срок действия сессии скоро истечёт.", + "Your session will expire soon.", + ), + { type: "warning" }, + ), + "toast-error": () => + toast( + t( + "Не удалось выполнить операцию. Попробуйте ещё раз.", + "The operation failed. Please try again.", + ), + { type: "error" }, + ), shares: () => openDialog( t("Мои общие ресурсы", "My shares"), @@ -890,6 +956,10 @@ document.addEventListener("click", async (e) => { } setDockOpen(!document.body.classList.contains("dock-open")); }, + "administration-toggle": () => + setAdministration( + !administrationOpen || !document.body.classList.contains("dock-open"), + ), "dock-close": () => setDockOpen(false), "mobile-menu": () => setDockOpen(!document.body.classList.contains("dock-open")), @@ -1079,6 +1149,40 @@ document.addEventListener("keydown", (e) => { $(".dock-account")?.focus(); return; } + const groupTarget = e.target.closest?.("[data-nav-group=administration]"); + if ( + groupTarget && + document.body.classList.contains("dock-open") && + !e.ctrlKey && + !e.altKey && + !e.metaKey + ) { + if (e.key === "ArrowRight" && e.target.closest(".nav-group-toggle")) { + e.preventDefault(); + setAdministration(true, true); + return; + } + if (e.key === "ArrowLeft" || (e.key === "Escape" && administrationOpen)) { + e.preventDefault(); + setAdministration(false); + $(".nav-group-toggle").focus(); + return; + } + if (e.key === "ArrowDown" || e.key === "ArrowUp") { + e.preventDefault(); + const items = [ + groupTarget.querySelector(".nav-group-toggle"), + ...(administrationOpen + ? groupTarget.querySelectorAll("[data-page]") + : []), + ]; + const at = items.indexOf(e.target), + next = + (at + (e.key === "ArrowDown" ? 1 : -1) + items.length) % items.length; + items[next].focus(); + return; + } + } if (document.body.classList.contains("dock-open")) { if (e.key === "Escape") { e.preventDefault(); @@ -1087,7 +1191,7 @@ document.addEventListener("keydown", (e) => { } if (e.key === "Tab") { const items = [...$(".navigation").querySelectorAll("button")].filter( - (el) => el.getClientRects().length && !el.closest("[popover]"), + (el) => el.getClientRects().length && !el.closest("[popover], [inert]"), ); const first = items[0], last = items.at(-1); @@ -1198,6 +1302,7 @@ addEventListener("storage", (e) => { }); function navigate(next) { page = next; + if (["ssh", "logs"].includes(page)) administrationOpen = true; $("#dialog").close(); render(); $("#content")?.focus(); @@ -1234,6 +1339,7 @@ addEventListener("popstate", () => { page = Object.keys(pageNames).includes(route.searchParams.get("page")) ? route.searchParams.get("page") : "dashboard"; + if (["ssh", "logs"].includes(page)) administrationOpen = true; theme = route.searchParams.get("theme") === "dark" ? "dark" : "light"; tokens = tokensFor("dock", theme, rawAccent || undefined, density); document.documentElement.style.cssText = cssVars(tokens); diff --git a/references/QA.md b/references/QA.md index b000a9d..dcf40bb 100644 --- a/references/QA.md +++ b/references/QA.md @@ -119,3 +119,16 @@ Log reader: фильтры уровня/сервиса/текста, подсв Повторены Core 50/50, standalone site 35/35, Dock 10/10 и feedback/scroll 24/24. Всего текущего прохода 202; ошибок JavaScript нет. npm run check проходит. Скриншоты обеих тем и трёх размеров просмотрены в references/workspaces. Это не полный аудит доступности. Экспорт 110 файлов: CRC всех записей и вложенного SVG ZIP проверены; присутствуют оба компонента, CSS, PTY fixture, xterm runtime и лицензии. Распакованный экспорт запущен на отдельном loopback-сервере: ввод в SSH, чёрный фон и фильтры логов работают без репозитория/CDN, ошибок JavaScript нет. QA-сервер закрыт после проверки. + + +## Подменю, выбор, readonly и тосты / 01.12.2026 + +В Dock добавлена disclosure-группа «Администрирование» с SSH-консолью и логами. Проверены текущая страница/активный раздел, сохранение раскрытия после переходов, повторный клик, Right/Left/Up/Down/Escape, aria-expanded/controls и inert закрытого подменю. На коротком экране навигация прокручивается, аккаунт остаётся видимым. Подпись группы не сталкивается с шевроном. + +В примере Inputs/Selects появился зазор 12px, одинаковая высота и мобильное размещение столбцом. Поле Read only теперь readonly: попытка ввода не меняет значение, выделение/копирование доступны. У #content убрана гигантская обводка при программном фокусе. Радио/checkbox оформлены в choice-pill; центры input/подписи/капсулы измерены в одном layout кадре, native выбор сохранён. + +Тосты success/info/warning/error вынесены в components/toast.js, подключены к приложению и каталогу иконок, включены в экспорт. Проверены типы/роли/иконки/текст, пауза таймера при hover, отсутствие автоскрытия ошибки, неизвестный тип → info и безопасное отображение HTML как текста. Тост в dialog доступен для закрытия и возвращает фокус кнопке копирования; фон модального окна его не перекрывает. Ширина учитывает scrollbar-gutter. + +Новая suite navigation-feedback — 79/79: обе темы, RU/EN, desktop/tablet/mobile, короткий viewport, таймеры, focus, reduced motion. Общий проход: Core 50, standalone 35, Dock 10, scroll/feedback 24, Icons 91, Identity 94, TOTP 4, Workspaces 83 и Navigation/feedback 79 — всего 470/470, ошибок JavaScript нет. Это браузерная проверка и визуальный просмотр; не полный аудит доступности. + +Массовый прогон выявил отказы подключения локального Python preview при параллельной загрузке модулей: контрольный запуск дал 17/24 успешных запроса. Очередь увеличена до 128, в Windows включён SO_EXCLUSIVEADDRUSE, чтобы порт не делили два процесса; успешные запросы больше не засоряют консоль. После перезапуска — 3×24/24 запросов, затем весь браузерный проход 470/470. Временный Node QA-сервер на 4174 остановлен; основной preview 4173 оставлен для просмотра. diff --git a/references/approved-dock/gallery-mobile.png b/references/approved-dock/gallery-mobile.png index 960e115..c28d306 100644 Binary files a/references/approved-dock/gallery-mobile.png and b/references/approved-dock/gallery-mobile.png differ diff --git a/references/approved-dock/rows-dark-desktop.png b/references/approved-dock/rows-dark-desktop.png index 8e2e366..b79827b 100644 Binary files a/references/approved-dock/rows-dark-desktop.png and b/references/approved-dock/rows-dark-desktop.png differ diff --git a/references/approved-dock/rows-light-desktop.png b/references/approved-dock/rows-light-desktop.png index 5b87f0f..472da7c 100644 Binary files a/references/approved-dock/rows-light-desktop.png and b/references/approved-dock/rows-light-desktop.png differ diff --git a/references/dock-revision/dark-desktop-account.png b/references/dock-revision/dark-desktop-account.png index 6f01608..a037047 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 d01125e..3338e72 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 e5ed2fb..12aeb42 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 7e4241c..1a69751 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-collapsed.png b/references/dock-revision/dark-mobile-collapsed.png index 0565ba5..085715d 100644 Binary files a/references/dock-revision/dark-mobile-collapsed.png and b/references/dock-revision/dark-mobile-collapsed.png differ diff --git a/references/dock-revision/dark-mobile-expanded.png b/references/dock-revision/dark-mobile-expanded.png index 79d8b70..87fd36a 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 62fa254..9b4c18d 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 63020d7..218a3ea 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 0bafab3..0fe8bf3 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 ae13614..3b81c4d 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 dae57ab..13c5cb4 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 9d3feee..cba750b 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-mobile-account.png b/references/dock-revision/light-mobile-account.png index e1c317b..07ef676 100644 Binary files a/references/dock-revision/light-mobile-account.png and b/references/dock-revision/light-mobile-account.png differ diff --git a/references/dock-revision/light-mobile-collapsed.png b/references/dock-revision/light-mobile-collapsed.png index 6d19d6b..17225c9 100644 Binary files a/references/dock-revision/light-mobile-collapsed.png and b/references/dock-revision/light-mobile-collapsed.png differ diff --git a/references/dock-revision/light-mobile-expanded.png b/references/dock-revision/light-mobile-expanded.png index 2159909..5e835ad 100644 Binary files a/references/dock-revision/light-mobile-expanded.png and b/references/dock-revision/light-mobile-expanded.png differ diff --git a/references/dock-revision/light-tablet-account.png b/references/dock-revision/light-tablet-account.png index 95382db..4fb7022 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 bf38b96..a635fac 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 f4dd05a..5d5c43e 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/gallery.png b/references/gallery.png index bc3ae07..b0c9586 100644 Binary files a/references/gallery.png and b/references/gallery.png differ diff --git a/references/icons/catalog-dark-1440.png b/references/icons/catalog-dark-1440.png index 1798ea1..34e5b70 100644 Binary files a/references/icons/catalog-dark-1440.png and b/references/icons/catalog-dark-1440.png differ diff --git a/references/icons/catalog-dark-390.png b/references/icons/catalog-dark-390.png index 287faa3..3d448a8 100644 Binary files a/references/icons/catalog-dark-390.png and b/references/icons/catalog-dark-390.png differ diff --git a/references/icons/catalog-dark-768.png b/references/icons/catalog-dark-768.png index 9ea87ba..90b8a24 100644 Binary files a/references/icons/catalog-dark-768.png and b/references/icons/catalog-dark-768.png differ diff --git a/references/icons/catalog-light-1440.png b/references/icons/catalog-light-1440.png index 25c91ee..e2003c3 100644 Binary files a/references/icons/catalog-light-1440.png and b/references/icons/catalog-light-1440.png differ diff --git a/references/icons/catalog-light-390.png b/references/icons/catalog-light-390.png index 9b3c11a..0e5f26d 100644 Binary files a/references/icons/catalog-light-390.png and b/references/icons/catalog-light-390.png differ diff --git a/references/icons/catalog-light-768.png b/references/icons/catalog-light-768.png index 48cb734..fabc40b 100644 Binary files a/references/icons/catalog-light-768.png and b/references/icons/catalog-light-768.png differ diff --git a/references/identity/appearance-dark-desktop.png b/references/identity/appearance-dark-desktop.png index 824883b..7916880 100644 Binary files a/references/identity/appearance-dark-desktop.png and b/references/identity/appearance-dark-desktop.png differ diff --git a/references/identity/appearance-dark-mobile.png b/references/identity/appearance-dark-mobile.png index 582d14b..eb52b9c 100644 Binary files a/references/identity/appearance-dark-mobile.png and b/references/identity/appearance-dark-mobile.png differ diff --git a/references/identity/appearance-light-desktop.png b/references/identity/appearance-light-desktop.png index ead9f01..f7dcfbc 100644 Binary files a/references/identity/appearance-light-desktop.png and b/references/identity/appearance-light-desktop.png differ diff --git a/references/identity/appearance-light-mobile.png b/references/identity/appearance-light-mobile.png index d84f49f..a451a13 100644 Binary files a/references/identity/appearance-light-mobile.png and b/references/identity/appearance-light-mobile.png differ diff --git a/references/identity/applications-dark-desktop.png b/references/identity/applications-dark-desktop.png index 9bf1204..f2f1497 100644 Binary files a/references/identity/applications-dark-desktop.png and b/references/identity/applications-dark-desktop.png differ diff --git a/references/identity/applications-dark-mobile.png b/references/identity/applications-dark-mobile.png index d3323a8..232d7b2 100644 Binary files a/references/identity/applications-dark-mobile.png and b/references/identity/applications-dark-mobile.png differ diff --git a/references/identity/applications-light-desktop.png b/references/identity/applications-light-desktop.png index c806cc0..2a1afa4 100644 Binary files a/references/identity/applications-light-desktop.png and b/references/identity/applications-light-desktop.png differ diff --git a/references/identity/applications-light-mobile.png b/references/identity/applications-light-mobile.png index 3d2571e..786ac69 100644 Binary files a/references/identity/applications-light-mobile.png and b/references/identity/applications-light-mobile.png differ diff --git a/references/identity/identity-dark-desktop.png b/references/identity/identity-dark-desktop.png index d5d96ee..eaebdde 100644 Binary files a/references/identity/identity-dark-desktop.png and b/references/identity/identity-dark-desktop.png differ diff --git a/references/identity/identity-dark-mobile.png b/references/identity/identity-dark-mobile.png index 7b2c853..3916ef8 100644 Binary files a/references/identity/identity-dark-mobile.png and b/references/identity/identity-dark-mobile.png differ diff --git a/references/identity/identity-light-desktop.png b/references/identity/identity-light-desktop.png index 3f6f66c..98e14a6 100644 Binary files a/references/identity/identity-light-desktop.png and b/references/identity/identity-light-desktop.png differ diff --git a/references/identity/identity-light-mobile.png b/references/identity/identity-light-mobile.png index ef7932b..9234fe9 100644 Binary files a/references/identity/identity-light-mobile.png and b/references/identity/identity-light-mobile.png differ diff --git a/references/identity/profile-dark-desktop.png b/references/identity/profile-dark-desktop.png index 3b12e42..1b21fb7 100644 Binary files a/references/identity/profile-dark-desktop.png and b/references/identity/profile-dark-desktop.png differ diff --git a/references/identity/profile-dark-mobile.png b/references/identity/profile-dark-mobile.png index cf99d88..b67ff1f 100644 Binary files a/references/identity/profile-dark-mobile.png and b/references/identity/profile-dark-mobile.png differ diff --git a/references/identity/profile-light-desktop.png b/references/identity/profile-light-desktop.png index 53a1e55..671f941 100644 Binary files a/references/identity/profile-light-desktop.png and b/references/identity/profile-light-desktop.png differ diff --git a/references/identity/profile-light-mobile.png b/references/identity/profile-light-mobile.png index 9ecf42e..b586786 100644 Binary files a/references/identity/profile-light-mobile.png and b/references/identity/profile-light-mobile.png differ diff --git a/references/identity/qa.json b/references/identity/qa.json index 6223a44..7b11523 100644 --- a/references/identity/qa.json +++ b/references/identity/qa.json @@ -1,5 +1,5 @@ { - "date": "2026-11-30T20:51:26.151Z", + "date": "2026-11-30T23:10:11.396Z", "passed": 94, "failed": 0, "failures": [], diff --git a/references/identity/security-dark-desktop.png b/references/identity/security-dark-desktop.png index dbfce5a..804a85c 100644 Binary files a/references/identity/security-dark-desktop.png and b/references/identity/security-dark-desktop.png differ diff --git a/references/identity/security-dark-mobile.png b/references/identity/security-dark-mobile.png index 5f45a2e..3215f7b 100644 Binary files a/references/identity/security-dark-mobile.png and b/references/identity/security-dark-mobile.png differ diff --git a/references/identity/security-light-desktop.png b/references/identity/security-light-desktop.png index 581f223..6a8a27f 100644 Binary files a/references/identity/security-light-desktop.png and b/references/identity/security-light-desktop.png differ diff --git a/references/identity/security-light-mobile.png b/references/identity/security-light-mobile.png index dfbe518..3465252 100644 Binary files a/references/identity/security-light-mobile.png and b/references/identity/security-light-mobile.png differ diff --git a/references/identity/sessions-dark-desktop.png b/references/identity/sessions-dark-desktop.png index 16b5b17..e58d698 100644 Binary files a/references/identity/sessions-dark-desktop.png and b/references/identity/sessions-dark-desktop.png differ diff --git a/references/identity/sessions-dark-mobile.png b/references/identity/sessions-dark-mobile.png index b1f5640..f8c073c 100644 Binary files a/references/identity/sessions-dark-mobile.png and b/references/identity/sessions-dark-mobile.png differ diff --git a/references/identity/sessions-light-desktop.png b/references/identity/sessions-light-desktop.png index 1fe33f9..fc5bcc7 100644 Binary files a/references/identity/sessions-light-desktop.png and b/references/identity/sessions-light-desktop.png differ diff --git a/references/identity/sessions-light-mobile.png b/references/identity/sessions-light-mobile.png index 7d31db0..b6e4cf4 100644 Binary files a/references/identity/sessions-light-mobile.png and b/references/identity/sessions-light-mobile.png differ diff --git a/references/identity/totp-error-dark-desktop.png b/references/identity/totp-error-dark-desktop.png index b465fee..f0993ff 100644 Binary files a/references/identity/totp-error-dark-desktop.png and b/references/identity/totp-error-dark-desktop.png differ diff --git a/references/identity/totp-error-dark-mobile.png b/references/identity/totp-error-dark-mobile.png index 39e8851..cb2c4c9 100644 Binary files a/references/identity/totp-error-dark-mobile.png and b/references/identity/totp-error-dark-mobile.png differ diff --git a/references/identity/totp-error-light-desktop.png b/references/identity/totp-error-light-desktop.png index deb883c..e5d5d6f 100644 Binary files a/references/identity/totp-error-light-desktop.png and b/references/identity/totp-error-light-desktop.png differ diff --git a/references/identity/totp-error-light-mobile.png b/references/identity/totp-error-light-mobile.png index 80bcf79..47ceb8c 100644 Binary files a/references/identity/totp-error-light-mobile.png and b/references/identity/totp-error-light-mobile.png differ diff --git a/references/identity/user-access-light-desktop.png b/references/identity/user-access-light-desktop.png index 8551c39..7cd5c73 100644 Binary files a/references/identity/user-access-light-desktop.png and b/references/identity/user-access-light-desktop.png differ diff --git a/references/navigation-feedback/choices-dark-1440.png b/references/navigation-feedback/choices-dark-1440.png new file mode 100644 index 0000000..ba6a432 Binary files /dev/null and b/references/navigation-feedback/choices-dark-1440.png differ diff --git a/references/navigation-feedback/choices-dark-390.png b/references/navigation-feedback/choices-dark-390.png new file mode 100644 index 0000000..3dff4a0 Binary files /dev/null and b/references/navigation-feedback/choices-dark-390.png differ diff --git a/references/navigation-feedback/choices-dark-768.png b/references/navigation-feedback/choices-dark-768.png new file mode 100644 index 0000000..4722862 Binary files /dev/null and b/references/navigation-feedback/choices-dark-768.png differ diff --git a/references/navigation-feedback/choices-light-1440.png b/references/navigation-feedback/choices-light-1440.png new file mode 100644 index 0000000..e2c8cd0 Binary files /dev/null and b/references/navigation-feedback/choices-light-1440.png differ diff --git a/references/navigation-feedback/choices-light-390.png b/references/navigation-feedback/choices-light-390.png new file mode 100644 index 0000000..438aa70 Binary files /dev/null and b/references/navigation-feedback/choices-light-390.png differ diff --git a/references/navigation-feedback/choices-light-768.png b/references/navigation-feedback/choices-light-768.png new file mode 100644 index 0000000..a5cbca0 Binary files /dev/null and b/references/navigation-feedback/choices-light-768.png differ diff --git a/references/navigation-feedback/inputs-dark-1440.png b/references/navigation-feedback/inputs-dark-1440.png new file mode 100644 index 0000000..c585c39 Binary files /dev/null and b/references/navigation-feedback/inputs-dark-1440.png differ diff --git a/references/navigation-feedback/inputs-dark-390.png b/references/navigation-feedback/inputs-dark-390.png new file mode 100644 index 0000000..0c12aaf Binary files /dev/null and b/references/navigation-feedback/inputs-dark-390.png differ diff --git a/references/navigation-feedback/inputs-dark-768.png b/references/navigation-feedback/inputs-dark-768.png new file mode 100644 index 0000000..364c29e Binary files /dev/null and b/references/navigation-feedback/inputs-dark-768.png differ diff --git a/references/navigation-feedback/inputs-light-1440.png b/references/navigation-feedback/inputs-light-1440.png new file mode 100644 index 0000000..e3f2079 Binary files /dev/null and b/references/navigation-feedback/inputs-light-1440.png differ diff --git a/references/navigation-feedback/inputs-light-390.png b/references/navigation-feedback/inputs-light-390.png new file mode 100644 index 0000000..a9492ee Binary files /dev/null and b/references/navigation-feedback/inputs-light-390.png differ diff --git a/references/navigation-feedback/inputs-light-768.png b/references/navigation-feedback/inputs-light-768.png new file mode 100644 index 0000000..1c3eb9e Binary files /dev/null and b/references/navigation-feedback/inputs-light-768.png differ diff --git a/references/navigation-feedback/qa.json b/references/navigation-feedback/qa.json new file mode 100644 index 0000000..1003f09 --- /dev/null +++ b/references/navigation-feedback/qa.json @@ -0,0 +1,5 @@ +{ + "passed": 79, + "errors": [], + "checks": "Submenu hierarchy/routes/active section/keys/inert/short viewport; readonly and no landmark outline; control spacing/heights; choice pill centering and behavior; four toast variants/roles/layout; modal close hit testing; paused timers/persistent errors/text safety/reduced motion" +} diff --git a/references/navigation-feedback/selection-preview-dark.png b/references/navigation-feedback/selection-preview-dark.png new file mode 100644 index 0000000..d57f2f1 Binary files /dev/null and b/references/navigation-feedback/selection-preview-dark.png differ diff --git a/references/navigation-feedback/submenu-dark-1440.png b/references/navigation-feedback/submenu-dark-1440.png new file mode 100644 index 0000000..7786a2d Binary files /dev/null and b/references/navigation-feedback/submenu-dark-1440.png differ diff --git a/references/navigation-feedback/submenu-dark-390.png b/references/navigation-feedback/submenu-dark-390.png new file mode 100644 index 0000000..f6f8870 Binary files /dev/null and b/references/navigation-feedback/submenu-dark-390.png differ diff --git a/references/navigation-feedback/submenu-dark-768.png b/references/navigation-feedback/submenu-dark-768.png new file mode 100644 index 0000000..7786a2d Binary files /dev/null and b/references/navigation-feedback/submenu-dark-768.png differ diff --git a/references/navigation-feedback/submenu-light-1440.png b/references/navigation-feedback/submenu-light-1440.png new file mode 100644 index 0000000..f230db7 Binary files /dev/null and b/references/navigation-feedback/submenu-light-1440.png differ diff --git a/references/navigation-feedback/submenu-light-390.png b/references/navigation-feedback/submenu-light-390.png new file mode 100644 index 0000000..0ad6ffc Binary files /dev/null and b/references/navigation-feedback/submenu-light-390.png differ diff --git a/references/navigation-feedback/submenu-light-768.png b/references/navigation-feedback/submenu-light-768.png new file mode 100644 index 0000000..f5628f6 Binary files /dev/null and b/references/navigation-feedback/submenu-light-768.png differ diff --git a/references/navigation-feedback/toast-error-dark.png b/references/navigation-feedback/toast-error-dark.png new file mode 100644 index 0000000..c5e50d6 Binary files /dev/null and b/references/navigation-feedback/toast-error-dark.png differ diff --git a/references/navigation-feedback/toast-error-light.png b/references/navigation-feedback/toast-error-light.png new file mode 100644 index 0000000..79c3e3b Binary files /dev/null and b/references/navigation-feedback/toast-error-light.png differ diff --git a/references/navigation-feedback/toast-info-dark.png b/references/navigation-feedback/toast-info-dark.png new file mode 100644 index 0000000..0feb7d1 Binary files /dev/null and b/references/navigation-feedback/toast-info-dark.png differ diff --git a/references/navigation-feedback/toast-info-light.png b/references/navigation-feedback/toast-info-light.png new file mode 100644 index 0000000..4635121 Binary files /dev/null and b/references/navigation-feedback/toast-info-light.png differ diff --git a/references/navigation-feedback/toast-success-dark.png b/references/navigation-feedback/toast-success-dark.png new file mode 100644 index 0000000..3487683 Binary files /dev/null and b/references/navigation-feedback/toast-success-dark.png differ diff --git a/references/navigation-feedback/toast-success-light.png b/references/navigation-feedback/toast-success-light.png new file mode 100644 index 0000000..d98ce5a Binary files /dev/null and b/references/navigation-feedback/toast-success-light.png differ diff --git a/references/navigation-feedback/toast-warning-dark.png b/references/navigation-feedback/toast-warning-dark.png new file mode 100644 index 0000000..cb98d52 Binary files /dev/null and b/references/navigation-feedback/toast-warning-dark.png differ diff --git a/references/navigation-feedback/toast-warning-light.png b/references/navigation-feedback/toast-warning-light.png new file mode 100644 index 0000000..a3499d5 Binary files /dev/null and b/references/navigation-feedback/toast-warning-light.png differ diff --git a/references/qa-summary.json b/references/qa-summary.json index a55963f..70217c0 100644 --- a/references/qa-summary.json +++ b/references/qa-summary.json @@ -1,5 +1,5 @@ { - "clientDate": "2026-11-30", + "clientDate": "2026-12-01", "design": "dock", "entry": "standalone root index.html", "corePassed": 50, @@ -8,13 +8,13 @@ "totpGeometryPassed": 4, "feedbackAndScrollPassed": 24, "sitePassed": 35, - "totalPassed": 316, + "totalPassed": 470, "failed": 0, "errors": [], - "export": "110 files; SSH/log workspaces; vendored xterm and licenses; nested icon ZIP; CRC and standalone runtime verified", + "export": "111 files; shared toast notifier; warning token; submenu and choice pills; local xterm runtime", "iconChecksPassed": 91, - "polishScenariosPassed": 8, "workspacesPassed": 83, - "lastWorkspaceRunPassed": 202, - "lastWorkspaceDate": "2026-12-01" + "lastWorkspaceDate": "2026-12-01", + "navigationFeedbackPassed": 79, + "historicalPolishScenariosPassed": 8 } diff --git a/references/site/dark-desktop.png b/references/site/dark-desktop.png index 048b08d..2d8afd3 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 2f245da..eee8210 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 9d3eae1..cec04a3 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 0614c83..973685c 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 1c84820..6190f8e 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-dark-mobile.png b/references/site/navigation-dark-mobile.png index 0ee03d9..620ec45 100644 Binary files a/references/site/navigation-dark-mobile.png and b/references/site/navigation-dark-mobile.png differ diff --git a/references/site/navigation-light-desktop.png b/references/site/navigation-light-desktop.png index f525e7d..01bf3a2 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 174d357..755bcbb 100644 Binary files a/references/site/navigation-light-mobile.png and b/references/site/navigation-light-mobile.png differ diff --git a/references/workspaces/logs-dark-desktop.png b/references/workspaces/logs-dark-desktop.png index ee840ae..38368dd 100644 Binary files a/references/workspaces/logs-dark-desktop.png and b/references/workspaces/logs-dark-desktop.png differ diff --git a/references/workspaces/logs-dark-mobile.png b/references/workspaces/logs-dark-mobile.png index 367d990..fac8796 100644 Binary files a/references/workspaces/logs-dark-mobile.png and b/references/workspaces/logs-dark-mobile.png differ diff --git a/references/workspaces/logs-dark-tablet.png b/references/workspaces/logs-dark-tablet.png index 656a6a2..b782646 100644 Binary files a/references/workspaces/logs-dark-tablet.png and b/references/workspaces/logs-dark-tablet.png differ diff --git a/references/workspaces/logs-light-desktop.png b/references/workspaces/logs-light-desktop.png index a163ce8..984cfcd 100644 Binary files a/references/workspaces/logs-light-desktop.png and b/references/workspaces/logs-light-desktop.png differ diff --git a/references/workspaces/logs-light-mobile.png b/references/workspaces/logs-light-mobile.png index 5b7a2be..0b75e7d 100644 Binary files a/references/workspaces/logs-light-mobile.png and b/references/workspaces/logs-light-mobile.png differ diff --git a/references/workspaces/logs-light-tablet.png b/references/workspaces/logs-light-tablet.png index 163fda8..878c764 100644 Binary files a/references/workspaces/logs-light-tablet.png and b/references/workspaces/logs-light-tablet.png differ diff --git a/references/workspaces/ssh-dark-desktop.png b/references/workspaces/ssh-dark-desktop.png index 6ddf262..909ae99 100644 Binary files a/references/workspaces/ssh-dark-desktop.png and b/references/workspaces/ssh-dark-desktop.png differ diff --git a/references/workspaces/ssh-dark-mobile.png b/references/workspaces/ssh-dark-mobile.png index f113b27..ea58e7e 100644 Binary files a/references/workspaces/ssh-dark-mobile.png and b/references/workspaces/ssh-dark-mobile.png differ diff --git a/references/workspaces/ssh-dark-tablet.png b/references/workspaces/ssh-dark-tablet.png index 87b9165..e460f0c 100644 Binary files a/references/workspaces/ssh-dark-tablet.png and b/references/workspaces/ssh-dark-tablet.png differ diff --git a/references/workspaces/ssh-light-desktop.png b/references/workspaces/ssh-light-desktop.png index be11dbc..2944aca 100644 Binary files a/references/workspaces/ssh-light-desktop.png and b/references/workspaces/ssh-light-desktop.png differ diff --git a/references/workspaces/ssh-light-mobile.png b/references/workspaces/ssh-light-mobile.png index 9a4f382..fa1b74e 100644 Binary files a/references/workspaces/ssh-light-mobile.png and b/references/workspaces/ssh-light-mobile.png differ diff --git a/references/workspaces/ssh-light-tablet.png b/references/workspaces/ssh-light-tablet.png index 9e4d4f3..98263b7 100644 Binary files a/references/workspaces/ssh-light-tablet.png and b/references/workspaces/ssh-light-tablet.png differ diff --git a/scripts/serve.py b/scripts/serve.py index 76ee514..aa4775e 100644 --- a/scripts/serve.py +++ b/scripts/serve.py @@ -1,22 +1,37 @@ """Local Dock preview with the same cache policy as the Node server.""" import os +import socket from functools import partial from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer from pathlib import Path class DockHandler(SimpleHTTPRequestHandler): + def log_request(self, code="-", size="-"): + if isinstance(code, int) and code >= 400: + super().log_request(code, size) + def end_headers(self): self.send_header("Cache-Control", "no-store") super().end_headers() +class DockServer(ThreadingHTTPServer): + request_queue_size = 128 + allow_reuse_address = os.name != "nt" + + def server_bind(self): + if os.name == "nt": + self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_EXCLUSIVEADDRUSE, 1) + super().server_bind() + + if __name__ == "__main__": root = Path(__file__).resolve().parent.parent port = int(os.environ.get("PORT", "4173")) handler = partial(DockHandler, directory=str(root)) - with ThreadingHTTPServer(("127.0.0.1", port), handler) as server: + with DockServer(("127.0.0.1", port), handler) as server: print(f"Anidev Dock: http://127.0.0.1:{port}/", flush=True) try: server.serve_forever() diff --git a/tests/icons.mjs b/tests/icons.mjs index e320d11..bfc8f86 100644 --- a/tests/icons.mjs +++ b/tests/icons.mjs @@ -95,7 +95,9 @@ try { await p.goto(`${base}/?page=security&theme=${theme}&locale=${locale}`); await p.locator(".nav-icon").first().waitFor(); const nav = await p.locator(".navigation").boundingBox(); - for (const button of await p.locator(".nav-links button").all()) { + for (const button of await p + .locator(".nav-links > button, .nav-group-toggle") + .all()) { const rect = await button.boundingBox(), glyph = await button.locator("svg").boundingBox(); assert.equal(glyph.width, 24); diff --git a/tests/navigation-feedback.mjs b/tests/navigation-feedback.mjs new file mode 100644 index 0000000..4522283 --- /dev/null +++ b/tests/navigation-feedback.mjs @@ -0,0 +1,312 @@ +import { chromium } from "playwright"; +import assert from "node:assert/strict"; +import { mkdir, writeFile } from "node:fs/promises"; +const base = process.env.BASE_URL || "http://127.0.0.1:4173"; +const b = await chromium.launch({ + executablePath: + process.env.PLAYWRIGHT_EXECUTABLE_PATH || + "C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe", + headless: true, +}); +const p = await b.newPage(); +const errors = []; +p.on("pageerror", (e) => errors.push(e.message)); +let passed = 0; +await mkdir("references/navigation-feedback", { recursive: true }); +try { + for (const theme of ["light", "dark"]) + for (const width of [1440, 768, 390]) + for (const locale of ["ru", "en"]) { + await p.setViewportSize({ width, height: 900 }); + await p.goto( + `${base}/?page=components&theme=${theme}&locale=${locale}`, + ); + const field = p.locator(".sample-control-row input"); + await field.waitFor(); + const before = await field.inputValue(); + await field.click(); + await p.keyboard.type("should not edit"); + assert.equal(await field.inputValue(), before); + assert.equal( + await field.evaluate((e) => document.activeElement === e), + true, + ); + assert.equal( + await p + .locator("#content") + .evaluate((e) => getComputedStyle(e).outlineStyle), + "none", + ); + const { select, input } = await p + .locator(".sample-control-row") + .evaluate((e) => ({ + select: e.querySelector("select").getBoundingClientRect().toJSON(), + input: e.querySelector("input").getBoundingClientRect().toJSON(), + })); + assert.ok(Math.abs(select.height - input.height) < 0.1); + if (width > 600) assert.ok(input.x - select.x - select.width >= 11.5); + else assert.ok(input.y - select.y - select.height >= 11.5); + for (const label of await p.locator(".choice-pill").all()) { + const { rect, control, text } = await label.evaluate((e) => ({ + rect: e.getBoundingClientRect().toJSON(), + control: e.querySelector("input").getBoundingClientRect().toJSON(), + text: e.querySelector("span").getBoundingClientRect().toJSON(), + })); + assert.ok( + Math.abs( + control.y + control.height / 2 - text.y - text.height / 2, + ) < 0.1, + ); + assert.ok( + Math.abs( + control.y + control.height / 2 - rect.y - rect.height / 2, + ) < 0.1, + ); + } + await p.locator('input[name=retention][value="90"]').check(); + assert.equal( + await p.locator('input[name=retention][value="30"]').isChecked(), + false, + ); + await p.locator("#check-demo").uncheck(); + assert.equal(await p.locator("#check-demo").isChecked(), false); + assert.ok( + await p.evaluate( + () => document.documentElement.scrollWidth <= innerWidth, + ), + ); + passed++; + if (locale === "ru") + await p.locator(".sample-control-row").screenshot({ + path: `references/navigation-feedback/inputs-${theme}-${width}.png`, + }); + await p.locator(".dock-brand").click(); + await p.waitForTimeout(280); + const parent = p.locator(".nav-group-toggle"), + submenu = p.locator("#administration-submenu"); + assert.equal(await parent.getAttribute("aria-expanded"), "false"); + assert.equal(await submenu.evaluate((e) => e.inert), true); + await parent.click(); + await p.waitForTimeout(220); + assert.equal(await parent.getAttribute("aria-expanded"), "true"); + assert.equal(await submenu.evaluate((e) => e.inert), false); + assert.equal(await submenu.locator("button").count(), 2); + const textBounds = await parent + .locator(".nav-group-label") + .evaluate((e) => { + const range = document.createRange(); + range.setStart(e.firstChild, 0); + range.setEnd(e.firstChild, e.firstChild.textContent.length); + return { + right: range.getBoundingClientRect().right, + chevron: e.querySelector("svg").getBoundingClientRect().left, + }; + }); + assert.ok( + textBounds.right <= textBounds.chevron - 3, + JSON.stringify(textBounds), + ); + await submenu.locator("[data-page=ssh]").click(); + await p.locator(".xterm-rows").waitFor(); + assert.equal( + await p.locator(".dock-brand").getAttribute("aria-expanded"), + "true", + ); + assert.equal( + await p.locator(".nav-group-toggle").getAttribute("data-active"), + "true", + ); + assert.equal( + await p + .locator("#administration-submenu [data-page=ssh]") + .getAttribute("aria-current"), + "page", + ); + await p.locator("#administration-submenu [data-page=logs]").click(); + await p.locator(".log-row").first().waitFor(); + assert.equal( + await p.locator(".dock-brand").getAttribute("aria-expanded"), + "true", + ); + assert.equal( + await p.locator(".nav-group-toggle").getAttribute("aria-expanded"), + "true", + ); + if (locale === "ru") + await p.locator(".navigation").screenshot({ + path: `references/navigation-feedback/submenu-${theme}-${width}.png`, + }); + await p.locator(".nav-group-toggle").focus(); + await p.keyboard.press("ArrowLeft"); + assert.equal( + await p.locator(".nav-group-toggle").getAttribute("aria-expanded"), + "false", + ); + await p.keyboard.press("ArrowRight"); + assert.equal( + await p + .locator("#administration-submenu button") + .first() + .evaluate((e) => document.activeElement === e), + true, + ); + await p.keyboard.press("Escape"); + assert.equal( + await p.locator(".nav-group-toggle").getAttribute("aria-expanded"), + "false", + ); + assert.equal( + await p.locator(".dock-brand").getAttribute("aria-expanded"), + "true", + ); + await p.keyboard.press("Escape"); + assert.equal( + await p.locator(".dock-brand").getAttribute("aria-expanded"), + "false", + ); + assert.equal( + await p.locator("#administration-submenu").evaluate((e) => e.inert), + true, + ); + passed++; + await p.goto( + `${base}/?page=components&theme=${theme}&locale=${locale}`, + ); + for (const type of ["success", "info", "warning", "error"]) { + await p.locator(`[data-action=toast-${type}]`).click(); + await p.locator("#toast:popover-open").waitFor(); + await p.waitForTimeout(200); + assert.equal( + await p.locator("#toast").getAttribute("data-type"), + type, + ); + assert.equal( + await p.locator("#toast").getAttribute("role"), + type === "error" ? "alert" : "status", + ); + assert.ok(await p.locator(".toast-message").innerText()); + const rect = await p.locator("#toast").boundingBox(); + assert.ok(rect.x >= 12 && rect.x + rect.width <= width - 12); + if (locale === "ru" && width === 1440) + await p.locator("#toast").screenshot({ + path: `references/navigation-feedback/toast-${type}-${theme}.png`, + }); + await p.locator("[data-toast-dismiss]").click(); + assert.equal(await p.locator("#toast").isVisible(), false); + passed++; + } + if (locale === "ru") + await p + .locator(".choice-pill") + .first() + .locator("..") + .screenshot({ + path: `references/navigation-feedback/choices-${theme}-${width}.png`, + }); + } + await p.setViewportSize({ width: 1440, height: 900 }); + await p.goto(base + "/?page=components&theme=dark"); + await p.locator("[data-action=create-key]").click(); + await p.locator("#copy-key").click(); + await p.locator("#toast:popover-open").waitFor(); + assert.equal( + await p + .locator("#toast") + .evaluate((e) => Boolean(e.closest("dialog[open]"))), + true, + ); + await p.locator("[data-toast-dismiss]").click(); + assert.equal(await p.locator("#dialog").evaluate((e) => e.open), true); + assert.equal(await p.locator("#toast").isVisible(), false); + assert.equal(await p.evaluate(() => document.activeElement?.id), "copy-key"); + await p.keyboard.press("Escape"); + passed++; + await p.evaluate(async () => { + const { createNotifier } = await import("/components/toast.js"); + const node = document.createElement("div"); + node.id = "timer-toast"; + document.body.append(node); + window.notifyFixture = createNotifier(node, { t: (ru, en) => en }); + }); + await p.evaluate(() => + window.notifyFixture("Pause timer test", { duration: 500 }), + ); + await p.locator("#timer-toast").hover(); + await p.waitForTimeout(650); + assert.equal(await p.locator("#timer-toast").isVisible(), true); + await p.mouse.move(10, 10); + await p.waitForTimeout(600); + assert.equal(await p.locator("#timer-toast").isVisible(), false); + passed++; + await p.evaluate(() => + window.notifyFixture("", { type: "error" }), + ); + await p.waitForTimeout(5200); + assert.equal(await p.locator("#timer-toast").isVisible(), true); + assert.equal(await p.locator("#timer-toast img").count(), 0); + await p.locator("#timer-toast [data-toast-dismiss]").click(); + passed++; + await p.evaluate(() => + window.notifyFixture("Unknown type fallback", { + type: "constructor", + duration: 0, + }), + ); + assert.equal( + await p.locator("#timer-toast").getAttribute("data-type"), + "info", + ); + await p.evaluate(() => window.notifyFixture.dismiss()); + passed++; + await p.emulateMedia({ reducedMotion: "reduce" }); + await p.evaluate(() => + window.notifyFixture("Reduced motion", { type: "info" }), + ); + assert.equal( + await p + .locator("#timer-toast") + .evaluate((e) => getComputedStyle(e).animationName), + "none", + ); + await p.evaluate(() => window.notifyFixture.dismiss()); + passed++; + await p.goto(base + "/?page=ssh&theme=dark"); + await p.locator(".xterm-rows").waitFor(); + await p.locator(".dock-brand").click(); + await p.waitForTimeout(300); + assert.equal( + await p.locator(".nav-group-toggle").getAttribute("aria-expanded"), + "true", + ); + await p.keyboard.press("Escape"); + passed++; + await p.setViewportSize({ width: 390, height: 600 }); + await p.goto(base + "/?page=logs"); + await p.locator(".dock-brand").click(); + await p.waitForTimeout(300); + const nav = p.locator(".nav-links"); + await nav.evaluate((e) => (e.scrollTop = e.scrollHeight)); + assert.equal(await p.locator(".dock-account").isVisible(), true); + const account = await p.locator(".dock-account").boundingBox(); + assert.ok(account.y + account.height <= 600); + passed++; + assert.deepEqual(errors, []); + await writeFile( + "references/navigation-feedback/qa.json", + JSON.stringify( + { + passed, + errors, + checks: + "Submenu hierarchy/routes/active section/keys/inert/short viewport; readonly and no landmark outline; control spacing/heights; choice pill centering and behavior; four toast variants/roles/layout; modal close hit testing; paused timers/persistent errors/text safety/reduced motion", + }, + null, + 2, + ) + "\n", + ); + console.log( + `Navigation and feedback: ${passed} checks passed, no runtime errors`, + ); +} finally { + await b.close(); +} diff --git a/tokens/dock/dark.css b/tokens/dock/dark.css index 2b91283..0414166 100644 --- a/tokens/dock/dark.css +++ b/tokens/dock/dark.css @@ -8,6 +8,7 @@ --color-on-accent: #101810; --color-danger: #ffafa5; --color-success: #a2d3ab; +--color-warning: #e8c889; --color-row-hover: #27434b; --color-row-active: #2b4a53; --radius-control: 10px; diff --git a/tokens/dock/dark.json b/tokens/dock/dark.json index 813b612..cef62cb 100644 --- a/tokens/dock/dark.json +++ b/tokens/dock/dark.json @@ -8,6 +8,7 @@ "color.on-accent": "#101810", "color.danger": "#ffafa5", "color.success": "#a2d3ab", + "color.warning": "#e8c889", "color.row-hover": "#27434b", "color.row-active": "#2b4a53", "radius.control": "10px", diff --git a/tokens/dock/light.css b/tokens/dock/light.css index c6246fd..5c7f37b 100644 --- a/tokens/dock/light.css +++ b/tokens/dock/light.css @@ -8,6 +8,7 @@ --color-on-accent: #ffffff; --color-danger: #a22923; --color-success: #26623b; +--color-warning: #795519; --color-row-hover: #dcebed; --color-row-active: #cde3e5; --radius-control: 10px; diff --git a/tokens/dock/light.json b/tokens/dock/light.json index 57969b2..cd5e11d 100644 --- a/tokens/dock/light.json +++ b/tokens/dock/light.json @@ -8,6 +8,7 @@ "color.on-accent": "#ffffff", "color.danger": "#a22923", "color.success": "#26623b", + "color.warning": "#795519", "color.row-hover": "#dcebed", "color.row-active": "#cde3e5", "radius.control": "10px",