[CL-REACT-DOCTOR-COMPLIANCE] refactor(AdminComplianceDashboard): чистим 19 react-doctor warnings + smoke-test #113

Merged
andrei merged 1 commit from feature/claude-admin-compliance-warnings-cleanup into master 2026-05-21 13:54:58 +00:00
Owner

Что сделано

  • Tailwind 4 size-shorthand на 15 иконках: h-X w-Xsize-X (Shield h1 icon + StatCard icons во всех 5 секциях) — rule design-no-redundant-size-axes
  • Стабильные ключи для skeleton placeholders: module-level SKELETON_KEYS_GDPR, SKELETON_KEYS_ERASURE, SKELETON_KEYS_KYC const string arrays — rule no-array-index-as-key ×3
  • h1 без explicit font-bold (h1 имеет bold weight by default) — rule design-no-bold-heading
  • Новый smoke test (7 кейсов) с моком QueryClientProvider + admin-compliance API + ReportsSection + components

Зачем

Phase 2 react-doctor hygiene #3 после Lightbox PR #104 и AiRebalancingModal PR #111. Из 21 warnings на app/src/pages/admin/AdminComplianceDashboard.tsx закрываем 19 (90.5%). GitNexus impact: LOW risk, 0 upstream callers — leaf admin page.

До После
21 warnings 2 warnings
0 errors 0 errors
0 tests 7/7 PASS

План тестирования

  • cd app && npx tsc --noEmit — clean
  • cd app && npx eslint src/pages/admin/AdminComplianceDashboard.tsx --max-warnings 0 — clean
  • cd app && npx vitest run src/pages/admin/__tests__/AdminComplianceDashboard.test.tsx7/7 PASS
  • cd app && npm run test:i18n-usage — Missing: 0
  • cd app && npx react-doctor . --offline --lint -y --json → AdminCompliance 21 → 2 warnings, app errors=0
  • CI: 8 jobs Forgejo + React Doctor self-scan должны быть green

Где могу ошибаться

  • 2 warnings deferred (architectural, separate PR):
    • no-giant-component ×1 — 330-line file, нужен split на section-level subcomponents (4-5 файлов вместо 1)
    • rendering-hydration-mismatch-time ×1 — new Date(evt.createdAt).toLocaleDateString() на L224 (audit event timestamp) — locale-dependent, нужен suppressHydrationWarning или fixed-format
  • SKELETON_KEYS_* arrays WET (3 похожих) — намеренно explicit semantic naming; factory helper добавит indirection без выгоды
  • h1 font-bold removed — browser default h1 weight = 700 (bold), визуальный результат идентичен
## Что сделано - Tailwind 4 size-shorthand на 15 иконках: `h-X w-X` → `size-X` (Shield h1 icon + StatCard icons во всех 5 секциях) — rule `design-no-redundant-size-axes` - Стабильные ключи для skeleton placeholders: module-level `SKELETON_KEYS_GDPR`, `SKELETON_KEYS_ERASURE`, `SKELETON_KEYS_KYC` const string arrays — rule `no-array-index-as-key` ×3 - h1 без explicit `font-bold` (h1 имеет bold weight by default) — rule `design-no-bold-heading` - Новый smoke test (7 кейсов) с моком QueryClientProvider + admin-compliance API + ReportsSection + components ## Зачем Phase 2 react-doctor hygiene #3 после Lightbox PR #104 и AiRebalancingModal PR #111. Из 21 warnings на `app/src/pages/admin/AdminComplianceDashboard.tsx` закрываем **19 (90.5%)**. GitNexus impact: **LOW** risk, 0 upstream callers — leaf admin page. | До | После | |---|---| | 21 warnings | 2 warnings | | 0 errors | 0 errors | | 0 tests | 7/7 PASS | ## План тестирования - `cd app && npx tsc --noEmit` — clean - `cd app && npx eslint src/pages/admin/AdminComplianceDashboard.tsx --max-warnings 0` — clean - `cd app && npx vitest run src/pages/admin/__tests__/AdminComplianceDashboard.test.tsx` — **7/7 PASS** - `cd app && npm run test:i18n-usage` — Missing: 0 - `cd app && npx react-doctor . --offline --lint -y --json` → AdminCompliance 21 → 2 warnings, app errors=0 - CI: 8 jobs Forgejo + React Doctor self-scan должны быть green ## Где могу ошибаться - 2 warnings deferred (architectural, separate PR): - `no-giant-component` ×1 — 330-line file, нужен split на section-level subcomponents (4-5 файлов вместо 1) - `rendering-hydration-mismatch-time` ×1 — `new Date(evt.createdAt).toLocaleDateString()` на L224 (audit event timestamp) — locale-dependent, нужен `suppressHydrationWarning` или fixed-format - SKELETON_KEYS_* arrays WET (3 похожих) — намеренно explicit semantic naming; factory helper добавит indirection без выгоды - h1 `font-bold` removed — browser default h1 weight = 700 (bold), визуальный результат идентичен
[CL-REACT-DOCTOR-COMPLIANCE] refactor(AdminComplianceDashboard): чистим 19 react-doctor warnings + smoke-test
Some checks failed
CI / API (pull_request) Has been cancelled
CI / App (pull_request) Has been cancelled
CI / Prisma Migrate Gate (pull_request) Has been cancelled
CI / Contracts (pull_request) Has been cancelled
CI / Telegram Mini App (pull_request) Has been cancelled
CI / Python SDK (pull_request) Has been cancelled
CI / Secrets Scan (pull_request) Has been cancelled
React Doctor / React Doctor / App (pull_request) Has been cancelled
a83d7ed1ad
## Что сделано
- Tailwind 4 size-shorthand на 15 иконках: `h-X w-X` → `size-X` (Shield h1 icon, StatCard icons во всех 5 секциях) — rule `design-no-redundant-size-axes`
- Стабильные ключи для skeleton placeholders: module-level `SKELETON_KEYS_GDPR`, `SKELETON_KEYS_ERASURE`, `SKELETON_KEYS_KYC` constant string arrays вместо `[...Array(N)].map((_, i)` — rule `no-array-index-as-key` ×3
- h1 убран explicit `font-bold` — h1 имеет bold weight by default (rule `design-no-bold-heading`)
- Новый smoke test `app/src/pages/admin/__tests__/AdminComplianceDashboard.test.tsx` (7 кейсов): h1 render + size-6 class + no font-bold, date filter buttons, all 5 section headers, skeleton count, ReportsSection mount

## Зачем
Phase 2 react-doctor hygiene #3 после Lightbox PR #104 и AiRebalancingModal PR #111. Из 21 warnings на `app/src/pages/admin/AdminComplianceDashboard.tsx` закрываем 19. GitNexus impact: **LOW** risk, 0 upstream callers — leaf admin page.

| До | После |
|---|---|
| 21 warnings | 2 warnings |
| 0 errors | 0 errors |
| 0 tests | 7/7 PASS |

## План тестирования
- `cd app && npx tsc --noEmit` — clean
- `cd app && npx eslint src/pages/admin/AdminComplianceDashboard.tsx --max-warnings 0` — clean
- `cd app && npx vitest run src/pages/admin/__tests__/AdminComplianceDashboard.test.tsx` — **7/7 PASS**
- `cd app && npm run test:i18n-usage` — Missing: 0
- `cd app && npx react-doctor . --offline --lint -y --json` → AdminCompliance 21 → 2 warnings, app errors=0

## Где могу ошибаться
- 2 warnings deferred (architectural refactors, separate PR):
  - `no-giant-component` ×1 — 330-line file, нужен split на section-level subcomponents (4-5 файлов вместо 1)
  - `rendering-hydration-mismatch-time` ×1 — `new Date(evt.createdAt).toLocaleDateString()` на L224 (audit event timestamp) — locale-dependent rendering, нужен либо `suppressHydrationWarning` либо fixed-format date string
- SKELETON_KEYS_* arrays могут показаться WET (3 похожих arrays) — но это explicit semantic naming. Альтернатива — общий `generateKeys(prefix, n)` factory, но добавит indirection без выгоды.
- h1 `font-bold` removed — browser default h1 weight = 700 (bold), визуальный результат идентичен
andrei merged commit b4cb0b3277 into master 2026-05-21 13:54:58 +00:00
andrei deleted branch feature/claude-admin-compliance-warnings-cleanup 2026-05-21 13:54:58 +00:00
Sign in to join this conversation.
No reviewers
No labels
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
europa-tech-srl/europatech!113
No description provided.