feat(digest): дайджест метрик workspace (RBAC + ACL + WCAG AA)#231
Merged
Conversation
Новая страница /w/:slug/digest с 4 секциями менеджерских метрик: продуктивность, своевременность, гигиена (score 0-100), нагрузка. ## Backend - модуль modules/digest/ (DTO + dates + access + compute + service + router) - GET /api/workspaces/:wid/digest?scope=personal|team&period=7d|30d|90d - VIEWER → 403 INSUFFICIENT_PERMISSION на scope=team - team scope для MEMBER фильтрует private boards без BoardMember (R6 SDD) - effectiveRole fail-safe → VIEWER для неизвестных role presets (security M2) - workspaceMfaGuard + rateLimit(60/min/user) + UUID param validation - никаких изменений в Prisma schema — агрегаты на лету через TaskStatusHistory ## Frontend - страница DigestPage (/w/:slug/digest) + tab «Дайджест» в AppLayout - useDigest hook с AbortController и graceful 403 auto-switch - 3 компонента (DigestCard, DigestSparkline, WorkloadChart) - WCAG 2.2 AA: dedicated aria-live announcer, h2 hierarchy, sr-only delta, touch targets ≥44, prefers-reduced-motion, responsive sparkline, AntD theme tokens вместо хардкода цветов ## Tests - 47 backend (14 dates + 17 compute + 16 integration) - 15 frontend component (вкл. mobile path для WorkloadChart) - Total: 555 passing, 0 errors ## Deferred (документировано) - E2E Playwright → #229 (требует dev-серверы) - Polish MEDIUM/LOW (29 находок из ревью) → #230 - N+1 ACL в accessibleBoardIdsInWorkspace → Phase 2 cache (plan.md I1) - Topbar tabs accessibility — pre-existing pattern → #230 - Issues #218-228 — Phase 2 roadmap (cycle time history precision, CSV export, email digest, etc.) Связано: docs/design/digest.md, specs/digest.feature, tasks/digest/plan.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Новая страница
/w/:slug/digestс менеджерскими метриками: продуктивность / своевременность / гигиена / распределение нагрузки. Разрезы личный/командный, периоды 7d/30d/90d. RBAC: VIEWER → 403 на team scope. Team scope для MEMBER фильтрует private boards без BoardMember (R6 SDD).Без изменений в Prisma schema — всё считается на лету через
TaskStatusHistory.Артефакты
docs/design/digest.md(G2 approved)specs/digest.feature(G3 approved, 6 категорий покрытия)tasks/digest/plan.md(G4 approved)Что изменилось
Backend (новый модуль):
modules/digest/— dto / dates / access / compute / service / routerGET /api/workspaces/:wid/digest?scope=personal|team&period=7d|30d|90dapp.ts— один mountFrontend:
DigestCard,DigestSparkline,WorkloadChart)useDigesthook с AbortController + 403 graceful auto-switch/w/:slug/digestвApp.tsxБезопасность
workspaceMfaGuard('wid')✅rateLimit({ scope: 'digest', limit: 60/min, key: userId })✅effectiveRolefail-safe → VIEWER для неизвестных presets (defense-in-depth) ✅Доступность (WCAG 2.2 AA)
role="status" aria-live="polite"announcer (вместо broad page-level)h2heading hierarchy черезaria-labelledbyprefers-reduced-motionв bar-chart transitionsTests
Test plan
npm run typecheck— green (backend + frontend)npm run lint— 0 errorsnpm test— 555/555 passing (3 skipped pre-existing)/w/.../digest— переключить scope/period, проверить 4 карточкиDeferred (с явной причиной)
Review summary
3 ревью-агента (code + security + UX) выдали 84 находки (5 CRITICAL + 17 HIGH + 25 MEDIUM + 37 LOW). Зафиксил все CRITICAL и HIGH inline, важные MEDIUM/LOW, остальное — в issue #230 с явным reason.