diff --git a/README.md b/README.md index 9a76252..e4b2fd3 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 -m http.server 4173 --bind 127.0.0.1`. Прямой 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. Прямой file:// не поддерживает ES modules. ## Возможности diff --git a/Start-Gallery.cmd b/Start-Gallery.cmd index d7f04ba..f7a455a 100644 --- a/Start-Gallery.cmd +++ b/Start-Gallery.cmd @@ -7,6 +7,6 @@ where node >nul 2>nul if not errorlevel 1 ( node scripts/serve.mjs ) else ( - python -m http.server 4173 --bind 127.0.0.1 + python scripts/serve.py ) pause diff --git a/components/CONTRACT.md b/components/CONTRACT.md index 9e36811..439bba9 100644 --- a/components/CONTRACT.md +++ b/components/CONTRACT.md @@ -1,27 +1,29 @@ # Контракт компонентов +Уточнения Dock: переключатель 44×24px с бегунком 18px и равными отступами; перемещение и смена цвета — 160ms. Выпадающие и контекстные меню имеют скругление control и появление 180ms; reduced motion отключает анимацию. График показывает ближайшее время и p95 при наведении/касании; стрелки, Home/End и Escape доступны с клавиатуры. Числовая таблица сохранена. Тост использует manual popover в верхнем слое браузера и виден поверх модального затемнения. + Исполняемые образцы: экран Components; таблица и фильтры — Users; вкладки — Settings; вход — Authentication. Основная стилизация в `system.css`. -| Компонент | Состояния и взаимодействия | -|---|---| -| Button | Rest, hover, active, focus-visible, native disabled, aria-busy на ожидании. Enter/Space. Primary для основного действия; danger для опасного | -| Input / Select | Связанный label, native валидация и клавиатура, focus, disabled, aria-invalid + текст ошибки. Пароль допускает вставку и password manager | -| Checkbox / Radio / Switch | Native inputs, label, checked, disabled; switch имеет role=switch. Space переключает, radio — стрелки браузера | -| Table / Pagination | Семантические th/td, caption, aria-sort. Сортировка имени/роли, фильтр, поиск, выбор страницы, частичный выбор, 5 строк/страница. Мобильный горизонтальный скролл только в table-wrap | -| Search / Filter | Обновляют список без потери фокуса, сбрасывают страницу, пустой результат со сбросом | -| Sidebar / Header / Breadcrumb | Активный раздел aria-current, подписанные иконки, mobile раскрытие. Breadcrumb показывает контекст; не изображает несуществующие ссылки | -| Tabs | tablist/tab/tabpanel, aria-selected, roving tabindex, стрелки/Home/End | -| Dropdown | Native details/summary для списка действий: Enter/Space раскрывают, Tab проходит действия, Esc закрывает | -| Context menu | Правая кнопка, Shift+F10, Enter; role=menu/menuitem, стрелки, Esc, возврат фокуса | -| Modal / Drawer | Native dialog.showModal: фон inert, фокус внутри, Esc/Close, возврат к инициатору. Заголовок aria-labelledby. Drawer использует тот же контракт | -| Tooltip | Hover и focus-within, role=tooltip, aria-describedby. Не содержит обязательной информации | -| Toast | role=status/aria-live=polite, видимый результат без перехвата фокуса | -| Status | Текст + семантический цвет; без зависимости от цвета | -| Chart | SVG с подписью, единицами, периодом и числовой таблицей. Смена периода. Без декоративных данных и автоматического потока | -| Skeleton | aria-busy, метка загрузки, стабильная геометрия; без бесконечного shimmer | -| Empty / Error | Объяснение и следующее действие: сброс фильтров / повторить | -| Authentication | Native required/email/minlength, autocomplete. Демо-вход, SSO-форма и восстановление; реальная авторизация не подключена | -| Command palette | Ctrl/⌘K, поиск, стрелки, Enter, Esc. Native dialog для управления фокусом | +| Компонент | Состояния и взаимодействия | +| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Button | Rest, hover, active, focus-visible, native disabled, aria-busy на ожидании. Enter/Space. Primary для основного действия; danger для опасного | +| Input / Select | Связанный label, native валидация и клавиатура, focus, disabled, aria-invalid + текст ошибки. Пароль допускает вставку и password manager | +| Checkbox / Radio / Switch | Native inputs, label, checked, disabled; switch имеет role=switch. Space переключает, radio — стрелки браузера | +| Table / Pagination | Семантические th/td, caption, aria-sort. Сортировка имени/роли, фильтр, поиск, выбор страницы, частичный выбор, 5 строк/страница. Мобильный горизонтальный скролл только в table-wrap | +| Search / Filter | Обновляют список без потери фокуса, сбрасывают страницу, пустой результат со сбросом | +| Sidebar / Header / Breadcrumb | Активный раздел aria-current, подписанные иконки, mobile раскрытие. Breadcrumb показывает контекст; не изображает несуществующие ссылки | +| Tabs | tablist/tab/tabpanel, aria-selected, roving tabindex, стрелки/Home/End | +| Dropdown | Native details/summary для списка действий: Enter/Space раскрывают, Tab проходит действия, Esc закрывает | +| Context menu | Правая кнопка, Shift+F10, Enter; role=menu/menuitem, стрелки, Esc, возврат фокуса | +| Modal / Drawer | Native dialog.showModal: фон inert, фокус внутри, Esc/Close, возврат к инициатору. Заголовок aria-labelledby. Drawer использует тот же контракт | +| Tooltip | Hover и focus-within, role=tooltip, aria-describedby. Не содержит обязательной информации | +| Toast | role=status/aria-live=polite, видимый результат без перехвата фокуса | +| Status | Текст + семантический цвет; без зависимости от цвета | +| Chart | SVG с подписью, единицами, периодом и числовой таблицей. Смена периода. Без декоративных данных и автоматического потока | +| Skeleton | aria-busy, метка загрузки, стабильная геометрия; без бесконечного shimmer | +| Empty / Error | Объяснение и следующее действие: сброс фильтров / повторить | +| Authentication | Native required/email/minlength, autocomplete. Демо-вход, SSO-форма и восстановление; реальная авторизация не подключена | +| Command palette | Ctrl/⌘K, поиск, стрелки, Enter, Esc. Native dialog для управления фокусом | Hover и active — временные указательные состояния; focus-visible — клавиатурное. Loading и error применяются к операциям и вводам, а не к декоративным статусам. Системные компоненты не должны имитировать состояния, не имеющие смысла для их роли. diff --git a/components/system.css b/components/system.css index 6b5ea98..ad1c82d 100644 --- a/components/system.css +++ b/components/system.css @@ -361,6 +361,42 @@ small { height: 100%; overflow: visible; } +.chart-plot { + position: relative; + height: 100%; + cursor: crosshair; + touch-action: pan-y; +} +.chart-guide { + position: absolute; + top: 0; + bottom: 0; + border-left: 1px dashed var(--color-muted); + pointer-events: none; +} +.chart-dot { + position: absolute; + width: 9px; + height: 9px; + border: 2px solid var(--color-surface); + border-radius: 50%; + background: var(--color-accent); + transform: translate(-50%, -50%); + pointer-events: none; +} +.chart-tooltip { + position: absolute; + top: 4px; + padding: 6px 9px; + border: 1px solid var(--color-border); + border-radius: var(--radius-control); + background: var(--color-surface); + color: var(--color-text); + box-shadow: 0 3px 12px #0002; + font-size: 12px; + white-space: nowrap; + pointer-events: none; +} .chart-grid { stroke: var(--color-border); stroke-dasharray: 3 4; @@ -554,29 +590,35 @@ td .person { justify-content: flex-end; gap: 10px; } -.switch { +input[type="checkbox"].switch { appearance: none; - width: 36px !important; - height: 21px !important; + width: 44px; + height: 24px; + padding: 0; + margin: 0; background: var(--color-border); - border-radius: 12px !important; + border: 1px solid transparent; + border-radius: 999px; position: relative; + transition: background-color 160ms ease; } .switch:after { content: ""; - width: 15px; - height: 15px; + width: 18px; + height: 18px; position: absolute; - top: 3px; - left: 3px; + top: 50%; + left: 2px; + transform: translateY(-50%); border-radius: 50%; background: var(--color-surface); + transition: transform 160ms ease; } -.switch:checked { +input[type="checkbox"].switch:checked { background: var(--color-accent); } .switch:checked:after { - left: 18px; + transform: translate(20px, -50%); } .auth-layout { display: grid; @@ -731,8 +773,23 @@ summary { min-width: 180px; padding: 6px; border: 1px solid var(--color-border); + border-radius: var(--radius-control); z-index: 5; box-shadow: 0 6px 20px #0002; + transform-origin: top left; +} +details[open] > .dropdown { + animation: menu-open 180ms ease-out both; +} +@keyframes menu-open { + from { + opacity: 0; + transform: translateY(-6px) scale(0.98); + } + to { + opacity: 1; + transform: translateY(0) scale(1); + } } .dropdown button { display: block; @@ -751,9 +808,11 @@ summary { position: fixed; background: var(--color-surface); border: 1px solid var(--color-border); + border-radius: var(--radius-control); padding: 6px; z-index: 30; box-shadow: 0 5px 20px #0003; + animation: menu-open 180ms ease-out both; } .context-menu button { display: block; @@ -867,6 +926,9 @@ dialog > p { } #toast { position: fixed; + inset: auto; + margin: 0; + border: 0; bottom: 25px; left: 50%; transform: translateX(-50%); @@ -879,6 +941,9 @@ dialog > p { display: none; max-width: calc(100% - 32px); } +#toast:popover-open { + display: block; +} .skip { position: fixed; top: -100px; diff --git a/index.html b/index.html index 1acfdad..0227a3b 100644 --- a/index.html +++ b/index.html @@ -3,14 +3,15 @@
-${t("p95 · миллисекунды · ниже — лучше · тестовая выборка", "p95 · milliseconds · lower is better · sample dataset")}
| ${t("Время UTC", "Time UTC")} | p95 / ms |
|---|---|
| ${chartRange === "24h" ? String(i).padStart(2, "0") + ":00" : 21 + i + ".11"} | ${v} |
${t("p95 · миллисекунды · ниже — лучше · тестовая выборка", "p95 · milliseconds · lower is better · sample dataset")}
| ${t("Время UTC", "Time UTC")} | p95 / ms |
|---|---|
| ${chartRange === "24h" ? String(i).padStart(2, "0") + ":00" : 21 + i + ".11"} | ${v} |
:root {\n${cssVars(tokens)}\n}${t("Экспорт включает обе темы, JSON и CSS. Акцент применяется к каждой концепции отдельно.", "Export includes both themes, JSON and CSS. Each concept retains its own accent.")}
`; + )}:root {\n${cssVars(tokens)}\n}${t("Экспорт включает обе темы, JSON и CSS. Используется утверждённая палитра Dock.", "Export includes both themes, JSON and CSS. Uses the approved Dock palette.")}
`; } let dialogInitiator = null; function openDialog(title, body, cls = "") { @@ -778,7 +847,7 @@ document.addEventListener("click", async (e) => { if (!e.target.closest(".context-menu")) $(".context-menu")?.remove(); if (!action) return; document - .querySelectorAll("[popover]:popover-open") + .querySelectorAll("[popover=auto]:popover-open") .forEach((el) => el.hidePopover()); const actions = { shares: () => @@ -796,15 +865,8 @@ document.addEventListener("click", async (e) => { setDockOpen(!document.body.classList.contains("dock-open")); }, "dock-close": () => setDockOpen(false), - "mobile-menu": () => { - if (concept.id === "dock") { - setDockOpen(!document.body.classList.contains("dock-open")); - return; - } - const nav = $(".navigation"); - nav.classList.toggle("open"); - button.setAttribute("aria-expanded", nav.classList.contains("open")); - }, + "mobile-menu": () => + setDockOpen(!document.body.classList.contains("dock-open")), close: () => $("#dialog").close(), invite, command, @@ -985,9 +1047,9 @@ document.addEventListener("click", async (e) => { }); }); document.addEventListener("keydown", (e) => { - if (e.key === "Escape" && $("[popover]:popover-open")) { + if (e.key === "Escape" && $("[popover=auto]:popover-open")) { e.preventDefault(); - $("[popover]:popover-open").hidePopover(); + $("[popover=auto]:popover-open").hidePopover(); $(".dock-account")?.focus(); return; } diff --git a/references/QA.md b/references/QA.md index 202c231..eb4ec6b 100644 --- a/references/QA.md +++ b/references/QA.md @@ -66,3 +66,12 @@ Внешняя оболочка удалена полностью. Корневой index.html показывает приложение непосредственно; нет iframe, шапки и регуляторов просмотра. Старый /playground/ перенаправляется на корень. Внутри приложения сохранены темы, страницы, навигация и экспорт на странице токенов. Core 50/50, Dock 10/10, Identity 94/94, TOTP geometry 4/4, feedback/scroll 24/24, standalone site 31/31 — всего 213 проверок, ошибок JavaScript нет. Последняя suite проверяет hover/focus для Пользователей, Настроек, Компонентов и Токенов в обеих темах на desktop/mobile, current-page, Back/Forward, reload, совместимость старых URL, тему и отсутствие сдвигов. Выбранный Обзор выделен отдельно. Экспорт 23 файла, CRC проверен. Актуальные скриншоты: [site](site/README.md). + + +## Dock / исправления по скриншотам, 30.11.2026 + +Удалены запасное меню и выбор интерфейса через concept в URL. Корневой HTML сразу отмечен как Dock; версии CSS/JS и no-store у обоих серверов предотвращают загрузку старой оболочки. Python fallback использует scripts/serve.py. По пользовательскому адресу 4173 подтверждены HTTP 200 и Cache-Control: no-store. + +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; значения и границы подсказки графика, клавиатура и семидневный диапазон; касание в мобильном контексте; тост в верхнем слое при открытом диалоге. Скриншоты меню, переключателя, графика и тоста проверены визуально. Это не полный аудит доступности. diff --git a/references/approved-dock/gallery-mobile.png b/references/approved-dock/gallery-mobile.png index 835c274..baf90c0 100644 Binary files a/references/approved-dock/gallery-mobile.png and b/references/approved-dock/gallery-mobile.png differ diff --git a/references/dock-revision/dark-desktop-account.png b/references/dock-revision/dark-desktop-account.png index a6ba05c..d633794 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 4cf25ac..4a96fff 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 0a4a704..0423b2e 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 494319b..7f8bfc6 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 b86faf6..9848513 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 81682d2..2540de4 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 152bd4b..77604e3 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 efb003b..6f9dd57 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 2ffa61d..a4034f2 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 4efba08..779cca2 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 5d371b9..4a80822 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 d8e4c2d..5fbd50a 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-expanded.png b/references/dock-revision/light-mobile-expanded.png index a156841..fdbca50 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 c070aef..bd3601a 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 1184e27..6653c77 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 2dfd20a..226bbed 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 bb3f568..58fdeab 100644 Binary files a/references/gallery.png and b/references/gallery.png differ diff --git a/references/identity/qa.json b/references/identity/qa.json index 9b3c933..33e325d 100644 --- a/references/identity/qa.json +++ b/references/identity/qa.json @@ -1,5 +1,5 @@ { - "date": "2026-11-30T18:11:02.387Z", + "date": "2026-11-30T20:09:13.573Z", "passed": 94, "failed": 0, "failures": [], diff --git a/references/qa-summary.json b/references/qa-summary.json index a596fdb..e6c87c5 100644 --- a/references/qa-summary.json +++ b/references/qa-summary.json @@ -7,9 +7,10 @@ "dockPassed": 10, "totpGeometryPassed": 4, "feedbackAndScrollPassed": 24, - "sitePassed": 31, - "totalPassed": 213, + "sitePassed": 35, + "totalPassed": 253, "failed": 0, "errors": [], - "export": "23 files; no outer shell; CRC verified" + "export": "23 files; no outer shell; CRC verified", + "targetedVisualChecksPassed": 36 } diff --git a/references/site/dark-desktop.png b/references/site/dark-desktop.png index 480733b..124e6da 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 6d35a37..72e3bc7 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 53287ad..75fb136 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 292a7d0..0dafdae 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 7d075c5..24ed984 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 15d9792..1c1f216 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 b5a5457..90b7205 100644 Binary files a/references/site/navigation-light-mobile.png and b/references/site/navigation-light-mobile.png differ diff --git a/references/site/qa.json b/references/site/qa.json index 6bf47b0..10774e7 100644 --- a/references/site/qa.json +++ b/references/site/qa.json @@ -1,5 +1,5 @@ { - "passed": 31, + "passed": 35, "errors": [], "checks": "Root app without wrapper; all navigation hover/focus; routes/reload/back; legacy redirects; theme persistence; no layout jump; export" } \ No newline at end of file diff --git a/scripts/serve.py b/scripts/serve.py new file mode 100644 index 0000000..76ee514 --- /dev/null +++ b/scripts/serve.py @@ -0,0 +1,24 @@ +"""Local Dock preview with the same cache policy as the Node server.""" + +import os +from functools import partial +from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer +from pathlib import Path + + +class DockHandler(SimpleHTTPRequestHandler): + def end_headers(self): + self.send_header("Cache-Control", "no-store") + super().end_headers() + + +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: + print(f"Anidev Dock: http://127.0.0.1:{port}/", flush=True) + try: + server.serve_forever() + except KeyboardInterrupt: + pass diff --git a/tests/site.mjs b/tests/site.mjs index 15935a5..162595d 100644 --- a/tests/site.mjs +++ b/tests/site.mjs @@ -102,6 +102,14 @@ try { assert.equal(new URL(p.url()).pathname, "/"); assert.equal(await p.locator("iframe").count(), 0); passed++; + for (const oldConcept of ["relay", "folio", "orbit", "unknown"]) { + await p.goto(`${base}/?concept=${oldConcept}&page=dashboard`); + await p.locator(".dock-brand").waitFor(); + assert.equal(await p.locator("body").getAttribute("data-concept"), "dock"); + assert.equal(new URL(p.url()).searchParams.has("concept"), false); + assert.equal(await p.locator("iframe,#concept,.concept-card").count(), 0); + passed++; + } await p.goto(base + "/?page=appearance&theme=light"); await p.locator("[data-identity=theme][data-theme=dark]").click(); await p.reload();