refactor(frontend): deduplicate CSS keyframes, unify types, extract format utils, add UI states, trim mock data
- Remove duplicate @keyframes pulse-* from 3 component files (already in nexus-tokens.css) - Rename AgentDetail → AgentDetailData in dashboard types to avoid collision with types/agent.ts - Extract shared formatNumber/initials/formatTime to utils/format.ts - Simplify FlowBoard: use agentStore modal/selection getters instead of duplicating local state - Add error banner + empty state to IrisChat; add loading skeleton + error/empty states to TaskStrip - Remove 105-line unused mockAgents array from useFlowLayout - Reduce operations store fallbacks from hardcoded preview data to minimal safe defaults - Update operations store tests to match lean fallback structure - Net: -73 lines, cleaner imports, fewer magic strings
This commit is contained in:
@@ -12,12 +12,13 @@
|
||||
*/
|
||||
|
||||
import { ref, onMounted, onUnmounted, watch } from 'vue'
|
||||
import type { ThinkingItem, AgentDetail } from './types'
|
||||
import type { ThinkingItem, AgentDetailData } from './types'
|
||||
import { formatNumber } from '../../../utils/format'
|
||||
|
||||
/* ── Props ──────────────────────────────────────────── */
|
||||
|
||||
const props = defineProps<{
|
||||
agent: AgentDetail
|
||||
agent: AgentDetailData
|
||||
// Agent-Liste für Pfeilnavigation (IDs in Anzeigereihenfolge)
|
||||
agentOrder: string[]
|
||||
}>()
|
||||
@@ -97,7 +98,7 @@ interface MetricDef {
|
||||
sub?: string
|
||||
}
|
||||
|
||||
function getMetrics(a: AgentDetail): MetricDef[] {
|
||||
function getMetrics(a: AgentDetailData): MetricDef[] {
|
||||
return [
|
||||
{
|
||||
label: 'Tasks aktiv',
|
||||
@@ -132,12 +133,6 @@ function getMetrics(a: AgentDetail): MetricDef[] {
|
||||
]
|
||||
}
|
||||
|
||||
function formatNumber(n: number): string {
|
||||
if (n >= 1_000_000) return (n / 1_000_000).toFixed(1) + 'M'
|
||||
if (n >= 1_000) return (n / 1_000).toFixed(1) + 'k'
|
||||
return String(n)
|
||||
}
|
||||
|
||||
/* ── Pretty Model Name ────────────────────────────── */
|
||||
|
||||
function modelLabel(alias: string): string {
|
||||
@@ -453,18 +448,6 @@ const typeConfig: Record<ThinkingItem['type'], { dotClass: string; label: string
|
||||
background: var(--st-idle);
|
||||
}
|
||||
|
||||
@keyframes pulse-work {
|
||||
0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.55); }
|
||||
70% { box-shadow: 0 0 0 6px rgba(61, 220, 151, 0); }
|
||||
100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); }
|
||||
}
|
||||
|
||||
@keyframes pulse-think {
|
||||
0% { box-shadow: 0 0 0 0 rgba(52, 214, 245, 0.55); }
|
||||
70% { box-shadow: 0 0 0 6px rgba(52, 214, 245, 0); }
|
||||
100% { box-shadow: 0 0 0 0 rgba(52, 214, 245, 0); }
|
||||
}
|
||||
|
||||
/* ── Model Area ────────────────────────────────────── */
|
||||
.m-model-area {
|
||||
flex: 0 0 auto;
|
||||
|
||||
Reference in New Issue
Block a user