fix(ptica): drawer modal a11y (focus-trap + restore) + polish #1842

Merged
lekss361 merged 1 commit from feat/ptica-a11y-polish into main 2026-06-20 18:02:38 +00:00
Collaborator

Quality follow-up на смерженный ПТИЦА-cockpit (от свежего main). Закрывает находки code-review.

Drawer modal a11y (главное)

PticaDrawer — корректное модальное управление фокусом:

  • focus-trap: Tab/Shift+Tab зацикливаются внутри диалога (focusables перезапрашиваются на каждый Tab → переживает lazy-панели/под-вкладки); фокус «снаружи» возвращается внутрь;
  • focus-restore: триггер захватывается при открытии и возвращается на закрытии (guards null + detached-node);
  • onClose в ref → эффект зависит только от [open]: чинит «дёрганье» фокуса (trigger→close→trigger), когда у хоста меняется URL/searchParams при открытии.
    Esc/scrim-close, body-scroll-lock, role=dialog/aria-modal — сохранены.

Чистки (нити ревью)

  • MassingScene: убран дублирующий начальный rebuild массы (его делает floors/sections-эффект) + поправлен коммент про порядок эффектов;
  • статичные inline-стили → CSS-классы (scan/gauge/score);
  • .dtabActive без !important (через специфичность .dtabs button.dtabActive);
  • удалён мёртвый SoonCard + его CSS.

Качество

tsc/lint/prettier , next build зелёный (роут /site-finder/analysis/[cad]/ptica в бандле, 31.4 kB), только ptica-файлы, без any. code-reviewer APPROVE — был адверсариальным по focus-trap (listener-leak/stale-focusables/boundary/deep-link-fight) — чисто; единственный минор (focus-bounce от onClose-в-deps) исправлен этим коммитом.

Закрывает a11y follow-up, отмеченный в PR#4 (#1834).

Quality follow-up на смерженный ПТИЦА-cockpit (от свежего main). Закрывает находки code-review. ## Drawer modal a11y (главное) `PticaDrawer` — корректное модальное управление фокусом: - **focus-trap**: Tab/Shift+Tab зацикливаются внутри диалога (focusables перезапрашиваются на каждый Tab → переживает lazy-панели/под-вкладки); фокус «снаружи» возвращается внутрь; - **focus-restore**: триггер захватывается при открытии и возвращается на закрытии (guards null + detached-node); - **onClose в ref** → эффект зависит только от `[open]`: чинит «дёрганье» фокуса (trigger→close→trigger), когда у хоста меняется URL/searchParams при открытии. Esc/scrim-close, body-scroll-lock, `role=dialog`/`aria-modal` — сохранены. ## Чистки (нити ревью) - MassingScene: убран дублирующий начальный rebuild массы (его делает floors/sections-эффект) + поправлен коммент про порядок эффектов; - статичные inline-стили → CSS-классы (scan/gauge/score); - `.dtabActive` без `!important` (через специфичность `.dtabs button.dtabActive`); - удалён мёртвый `SoonCard` + его CSS. ## Качество tsc/lint/prettier ✅, **`next build` зелёный** (роут `/site-finder/analysis/[cad]/ptica` в бандле, 31.4 kB), только ptica-файлы, без `any`. **code-reviewer ✅ APPROVE** — был адверсариальным по focus-trap (listener-leak/stale-focusables/boundary/deep-link-fight) — чисто; единственный минор (focus-bounce от onClose-в-deps) **исправлен** этим коммитом. Закрывает a11y follow-up, отмеченный в PR#4 (#1834).
bot-backend added 1 commit 2026-06-20 15:13:30 +00:00
fix(ptica): drawer modal a11y (focus-trap + restore) + polish
All checks were successful
CI / changes (pull_request) Successful in 5s
CI / backend-tests (pull_request) Has been skipped
CI / frontend-tests (pull_request) Successful in 57s
CI / openapi-codegen-check (pull_request) Successful in 1m52s
88865bf6a7
PticaDrawer: proper modal focus management —
- focus-trap: Tab/Shift+Tab wrap inside the dialog (focusables re-queried per
  Tab so it survives lazy panels/sub-tabs), focus-already-outside pulled back in;
- focus-restore: the trigger element is captured on open and re-focused on close
  (guards null + detached node);
- onClose held in a ref so the effect depends on [open] only — fixes focus
  thrashing when the host's URL/searchParams change mid-open.
Esc/scrim close, body-scroll-lock, role=dialog/aria-modal preserved.

Cleanups (code-review follow-ups):
- MassingScene: drop duplicate initial mass build (floors/sections effect owns
  it); corrected the effect-ordering comment.
- Static inline styles → CSS-module classes (scan/gauge/score/spaced rows).
- DrawerPrimitives: remove !important on .dtabActive via specificity
  (.dtabs button.dtabActive).
- Remove unused SoonCard component + its CSS.

tsc/lint/prettier clean; next build green (route bundled). ptica-only, no any.
lekss361 merged commit f80bdd751b into main 2026-06-20 18:02:38 +00:00
lekss361 deleted branch feat/ptica-a11y-polish 2026-06-20 18:02:39 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lekss361/gendesign#1842
No description provided.