From 0a9a2f9021204770678fbaf2c8ce7117a50608fd Mon Sep 17 00:00:00 2001 From: anti Date: Sat, 9 May 2026 06:29:15 -0400 Subject: [PATCH] refactor(decnet_web/AttackerDetail): trim shell + bump coverage floor Drop unused icon/api/useEffect/Tag imports left behind by the fingerprint, behaviour, and IntelPanel extractions. AttackerDetail.tsx ends at 450 LOC across Phase 10 (down from 1652 / 73% reduction). Coverage floor: lines 23->24, functions 20->21, branches 17->19, statements 22->23. --- decnet_web/src/components/AttackerDetail.tsx | 9 +++++---- decnet_web/vite.config.ts | 17 +++++++++-------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/decnet_web/src/components/AttackerDetail.tsx b/decnet_web/src/components/AttackerDetail.tsx index 17af6c2a..b161e93b 100644 --- a/decnet_web/src/components/AttackerDetail.tsx +++ b/decnet_web/src/components/AttackerDetail.tsx @@ -1,7 +1,8 @@ -import React, { useEffect, useState } from 'react'; +import React, { useState } from 'react'; import { useParams, useNavigate } from 'react-router-dom'; -import { Activity, AlertTriangle, ArrowLeft, Cpu, Crosshair, Eye, Fingerprint, Globe, Keyboard, Shield, Clock, Sparkles, Wifi, Lock, FileKey, Radio, Timer, FileText, AtSign } from '../icons'; -import api from '../utils/api'; +import { + Activity, ArrowLeft, Crosshair, Fingerprint, Globe, FileText, AtSign, +} from '../icons'; import SessionDrawer from './SessionDrawer'; import EmptyState from './EmptyState/EmptyState'; import TTPsObservedSection from './TTPsObservedSection'; @@ -13,7 +14,7 @@ import { ServicesTargeted } from './AttackerDetail/sections/ServicesTargeted'; import { CommandsViewer } from './AttackerDetail/sections/CommandsViewer'; import { ArtifactsPanel } from './AttackerDetail/sections/ArtifactsPanel'; import { MailLogPanel } from './AttackerDetail/sections/MailLogPanel'; -import { Tag, Section } from './AttackerDetail/ui'; +import { Section } from './AttackerDetail/ui'; import { FingerprintGroup, getPayload, } from './AttackerDetail/fingerprints'; diff --git a/decnet_web/vite.config.ts b/decnet_web/vite.config.ts index fe5505bb..6c79980d 100644 --- a/decnet_web/vite.config.ts +++ b/decnet_web/vite.config.ts @@ -15,15 +15,16 @@ export default defineConfig({ include: ['src/**/*.{ts,tsx}'], exclude: ['src/**/*.d.ts', 'src/test/**', 'src/main.tsx'], // Baseline floors. Each refactor PR raises these; never lower. - // Phase 9 (Credentials trim): page shell down from 487 to 231 LOC. - // Lifted helpers, SortTh, CredsTable, ReuseTable, and a useCredentials - // hook (3 endpoints + reuse-map). 13 new tests. Suite: 48 files, - // 236 tests, 24.16% lines / 17.72% branches. + // Phase 10 (AttackerDetail follow-through): page shell down from + // 1652 to 450 LOC. Lifted fingerprint renderers (12), behaviour + // panel (8 sub-pieces + lookups), and IntelPanel into focused + // sub-modules. 13 new tests. Suite: 50 files, 249 tests, + // 24.8% lines / 19.53% branches. thresholds: { - lines: 23, - functions: 20, - branches: 17, - statements: 22, + lines: 24, + functions: 21, + branches: 19, + statements: 23, }, }, },