feat: add plagiarism graph, domain API services, error/empty-state handling, and UI polish
Some checks failed
CI / checks (push) Has been cancelled
Some checks failed
CI / checks (push) Has been cancelled
- Add PlagiarismGraphComponent (force-graph) with legend, abbreviated names, risk-derived node colors, and particle animation; integrated into work, event, group, and student detail pages - Extract domain API services (students, events, groups, reference-sets, users, analysis-runs, audit) from WorksApiService - Add RiskLevelPipe for translating risk level values to Russian - Replace raw IDs with entity names across all detail page overview sections - Dashboard: remove Works tab, reorder tabs (Students, Events, Groups, Ref-sets), hide list cards when empty or on error - Hide secondary blocks (runs, matches, graph, analytics) on error instead of showing error text; keep top-level entity load errors visible - Refset detail: split Ingestions tab into separate list and upload cards; hide list card when empty or on error - Convert analysis runs list to table; fix kv-grid vertical alignment - Style native select[tuiSelect] to match other form fields - Add favicon (yellow star) from sparkguardian - Add CLAUDE.md, .env.example, proxy config, CI workflow, and Makefile Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
# SparkGuardian — Конвенции и правила разработки
|
||||
# SparkAntiplagiat — Конвенции и правила разработки
|
||||
|
||||
> Этот документ описывает все архитектурные, стилевые и технические решения проекта SparkGuardian.
|
||||
> Его цель — обеспечить идентичный стиль кода и подход к дизайну в любых связанных проектах.
|
||||
> **Передайте этот файл AI-ассистенту вместе с задачей**, чтобы новый проект был логическим продолжением SparkGuardian.
|
||||
> Документ описывает архитектурные, стилевые и технические решения фронтенда SparkAntiplagiat.
|
||||
> Базируется на конвенциях родственного проекта SparkGuardian и наследует общие правила (Angular 21, signals, Taiga UI, T-Bank tokens).
|
||||
> **Передавайте этот файл AI-ассистенту вместе с задачей** — описанные правила должны соблюдаться при любых изменениях.
|
||||
|
||||
---
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
| Фреймворк | Angular | 21+ |
|
||||
| Язык | TypeScript | strict mode |
|
||||
| UI-библиотека | Taiga UI | v5 |
|
||||
| Видео | hls.js | — |
|
||||
| Формы / маски | Maskito | 5.x |
|
||||
| Web API wrappers | @ng-web-apis | 5.x |
|
||||
| Стили | Vanilla CSS + CSS Custom Properties | — |
|
||||
| Линтинг | ESLint + angular-eslint | — |
|
||||
| Тесты | Vitest + jsdom | — |
|
||||
@@ -33,24 +34,31 @@ src/app/
|
||||
├── core/ ← синглтоны, DI-токены, interceptors, сервисы, модели, pipes
|
||||
│ ├── config/ ← InjectionToken'ы (API_BASE_URL, API_ORIGIN, DEFAULT_PAGE_LIMIT)
|
||||
│ ├── devtools/ ← DevLogService (ring-buffer 300 записей)
|
||||
│ ├── http/ ← interceptors (apiBaseUrl, devLog), error-classification, http-error utils
|
||||
│ ├── guards/ ← authGuard
|
||||
│ ├── http/ ← interceptors (apiBaseUrl, auth, devLog), error-classification, http-error utils
|
||||
│ ├── models/ ← api.types.ts — ВСЕ TypeScript-интерфейсы API
|
||||
│ ├── notifications/ ← UserErrorNotifyService, user-error-messages config
|
||||
│ ├── services/ ← SessionsApiService — единственный API-клиент
|
||||
│ ├── sessions/ ← pipes, telemetry summary (rule engine)
|
||||
│ ├── keyboard/ ← VK→SVG mapping, highlight service, transcript util
|
||||
│ └── mouse/ ← mouse payload parsing, SVG highlight service
|
||||
│ ├── services/ ← доменные API-клиенты: WorksApi, AnalysisRunsApi,
|
||||
│ │ StudentsApi, GroupsApi, EventsApi, ReferenceSetsApi,
|
||||
│ │ UsersApi, AuditApi + AuthService
|
||||
│ ├── monitoring/ ← pipes для audit log
|
||||
│ └── works/ ← pipes: analysis-run-status, chip-classes
|
||||
│
|
||||
├── features/ ← lazy-loaded smart-компоненты (по одному на маршрут)
|
||||
│ ├── landing/ ← LandingComponent (маркетинговая страница)
|
||||
│ ├── devtools/ ← DevConsoleComponent (overlay, только isDevMode())
|
||||
│ └── sessions/ ← SessionsList, SessionDetail (+4 tab-компонента),
|
||||
│ HlsPlayer, KeyboardView, MouseView, StreamSelector,
|
||||
│ TelemetryEventDetail
|
||||
│ ├── login/ ← LoginComponent
|
||||
│ ├── dashboard/ ← DashboardComponent (сводка доменов + CRUD-формы)
|
||||
│ ├── works/ ← WorksList, WorkDetail (загрузка архива, запуск check,
|
||||
│ │ отчёты, adoptions по прогонам)
|
||||
│ ├── groups/ ← GroupDetail (участники, привязка студентов/юзеров)
|
||||
│ ├── students/ ← StudentDetail
|
||||
│ ├── events/ ← EventDetail (CRUD + works события)
|
||||
│ ├── reference-sets/ ← RefsetDetail (ingestions, CRUD)
|
||||
│ ├── monitoring/ ← MonitoringComponent (audit logs + фильтры)
|
||||
│ └── devtools/ ← DevConsoleComponent (overlay, только isDevMode())
|
||||
│
|
||||
└── shared/ ← чистые pure-функции, НИКАКИХ Angular-зависимостей
|
||||
└── utils/ ← date-time, duration, json, math, number, stream,
|
||||
telemetry-summary-human-text
|
||||
└── utils/ ← date-time, duration, json, math, number
|
||||
```
|
||||
|
||||
### Правила файловой организации
|
||||
@@ -60,7 +68,7 @@ src/app/
|
||||
- **Селекторы компонентов**: `app-<name>` (e.g., `app-session-detail`).
|
||||
- **Классы компонентов**: `PascalCase` + суффикс `Component` (e.g., `SessionDetailComponent`).
|
||||
- **Pipes**: суффикс `Pipe` (e.g., `SessionStatusPipe`).
|
||||
- **Сервисы**: суффикс `Service` (e.g., `SessionsApiService`).
|
||||
- **Сервисы**: суффикс `Service` (e.g., `WorksApiService`).
|
||||
- **Утилиты**: суффикс `.util.ts` (e.g., `date-time.util.ts`).
|
||||
- **Конфиги**: суффикс `.config.ts` (e.g., `user-error-messages.config.ts`).
|
||||
- **Типы**: суффикс `.types.ts` (e.g., `api.types.ts`).
|
||||
@@ -83,7 +91,7 @@ src/app/
|
||||
})
|
||||
export class MyComponent {
|
||||
// DI через inject(), НЕ constructor injection
|
||||
private readonly api = inject(SessionsApiService);
|
||||
private readonly api = inject(WorksApiService);
|
||||
private readonly userErrors = inject(UserErrorNotifyService);
|
||||
|
||||
// Inputs/Outputs через signal-based API (Angular 17+)
|
||||
|
||||
Reference in New Issue
Block a user