[split-required] Split 58 monoliths across Python, Go, TypeScript (Phases 1-3)
Phase 1 — Python (klausur-service): 5 monoliths → 36 files - dsfa_corpus_ingestion.py (1,828 LOC → 5 files) - cv_ocr_engines.py (2,102 LOC → 7 files) - cv_layout.py (3,653 LOC → 10 files) - vocab_worksheet_api.py (2,783 LOC → 8 files) - grid_build_core.py (1,958 LOC → 6 files) Phase 2 — Go (edu-search-service, school-service): 8 monoliths → 19 files - staff_crawler.go (1,402 → 4), policy/store.go (1,168 → 3) - policy_handlers.go (700 → 2), repository.go (684 → 2) - search.go (592 → 2), ai_extraction_handlers.go (554 → 2) - seed_data.go (591 → 2), grade_service.go (646 → 2) Phase 3 — TypeScript (admin-lehrer): 45 monoliths → 220+ files - sdk/types.ts (2,108 → 16 domain files) - ai/rag/page.tsx (2,686 → 14 files) - 22 page.tsx files split into _components/ + _hooks/ - 11 component files split into sub-components - 10 SDK data catalogs added to loc-exceptions - Deleted dead backup index_original.ts (4,899 LOC) All original public APIs preserved via re-export facades. Zero new errors: Python imports verified, Go builds clean, TypeScript tsc --noEmit shows only pre-existing errors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
129
admin-lehrer/app/(admin)/backlog/_components/BacklogItemCard.tsx
Normal file
129
admin-lehrer/app/(admin)/backlog/_components/BacklogItemCard.tsx
Normal file
@@ -0,0 +1,129 @@
|
||||
'use client'
|
||||
|
||||
import { ChevronRight } from 'lucide-react'
|
||||
import type { BacklogItem, BacklogCategory } from '../types'
|
||||
import { statusLabels, priorityLabels } from '../data'
|
||||
|
||||
interface BacklogItemCardProps {
|
||||
item: BacklogItem
|
||||
category: BacklogCategory | undefined
|
||||
isExpanded: boolean
|
||||
onToggleExpand: (id: string) => void
|
||||
onUpdateStatus: (id: string, status: BacklogItem['status']) => void
|
||||
onToggleSubtask: (itemId: string, subtaskId: string) => void
|
||||
}
|
||||
|
||||
export function BacklogItemCard({
|
||||
item,
|
||||
category,
|
||||
isExpanded,
|
||||
onToggleExpand,
|
||||
onUpdateStatus,
|
||||
onToggleSubtask,
|
||||
}: BacklogItemCardProps) {
|
||||
const completedSubtasks = item.subtasks?.filter((st) => st.completed).length || 0
|
||||
const totalSubtasks = item.subtasks?.length || 0
|
||||
|
||||
return (
|
||||
<div className="bg-white rounded-xl border border-slate-200 overflow-hidden">
|
||||
<div
|
||||
className="p-4 cursor-pointer hover:bg-slate-50 transition-colors"
|
||||
onClick={() => onToggleExpand(item.id)}
|
||||
>
|
||||
<div className="flex items-start gap-3">
|
||||
{/* Expand Icon */}
|
||||
<button className="mt-1 text-slate-400">
|
||||
<ChevronRight
|
||||
className={`w-5 h-5 transition-transform ${isExpanded ? 'rotate-90' : ''}`}
|
||||
/>
|
||||
</button>
|
||||
|
||||
{/* Content */}
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="flex items-center gap-2 mb-1 flex-wrap">
|
||||
<h3 className="font-semibold text-slate-900">{item.title}</h3>
|
||||
<span
|
||||
className={`px-2 py-0.5 rounded text-xs font-medium ${
|
||||
priorityLabels[item.priority].color
|
||||
}`}
|
||||
>
|
||||
{priorityLabels[item.priority].label}
|
||||
</span>
|
||||
</div>
|
||||
<p className="text-sm text-slate-500 mb-2">{item.description}</p>
|
||||
{item.notes && (
|
||||
<p className="text-xs text-slate-400 mb-2 italic">{item.notes}</p>
|
||||
)}
|
||||
<div className="flex items-center gap-3 text-xs">
|
||||
<span className={`px-2 py-1 rounded border ${category?.bgColor}`}>
|
||||
{category?.name}
|
||||
</span>
|
||||
{totalSubtasks > 0 && (
|
||||
<span className="text-slate-500">
|
||||
{completedSubtasks}/{totalSubtasks} Teilaufgaben
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Status */}
|
||||
<select
|
||||
value={item.status}
|
||||
onChange={(e) => {
|
||||
e.stopPropagation()
|
||||
onUpdateStatus(item.id, e.target.value as BacklogItem['status'])
|
||||
}}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
className={`px-3 py-1.5 rounded-lg text-sm font-medium border-0 cursor-pointer ${
|
||||
statusLabels[item.status].color
|
||||
}`}
|
||||
>
|
||||
{Object.entries(statusLabels).map(([value, { label }]) => (
|
||||
<option key={value} value={value}>
|
||||
{label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{/* Progress Bar */}
|
||||
{totalSubtasks > 0 && (
|
||||
<div className="mt-3 ml-8">
|
||||
<div className="w-full bg-slate-200 rounded-full h-1.5">
|
||||
<div
|
||||
className="bg-green-500 h-1.5 rounded-full transition-all"
|
||||
style={{ width: `${(completedSubtasks / totalSubtasks) * 100}%` }}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Expanded Subtasks */}
|
||||
{isExpanded && item.subtasks && item.subtasks.length > 0 && (
|
||||
<div className="border-t border-slate-200 bg-slate-50 p-4 pl-12">
|
||||
<h4 className="text-sm font-medium text-slate-700 mb-3">Teilaufgaben</h4>
|
||||
<ul className="space-y-2">
|
||||
{item.subtasks.map((subtask) => (
|
||||
<li key={subtask.id} className="flex items-center gap-3">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={subtask.completed}
|
||||
onChange={() => onToggleSubtask(item.id, subtask.id)}
|
||||
className="w-4 h-4 rounded border-slate-300 text-blue-600 focus:ring-blue-500"
|
||||
/>
|
||||
<span
|
||||
className={`text-sm ${
|
||||
subtask.completed ? 'text-slate-400 line-through' : 'text-slate-700'
|
||||
}`}
|
||||
>
|
||||
{subtask.title}
|
||||
</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
'use client'
|
||||
|
||||
import type { BacklogCategory, CategoryProgress } from '../types'
|
||||
|
||||
interface CategoryCardsProps {
|
||||
categories: BacklogCategory[]
|
||||
selectedCategory: string | null
|
||||
onSelectCategory: (id: string | null) => void
|
||||
getCategoryProgress: (categoryId: string) => CategoryProgress
|
||||
}
|
||||
|
||||
export function CategoryCards({
|
||||
categories,
|
||||
selectedCategory,
|
||||
onSelectCategory,
|
||||
getCategoryProgress,
|
||||
}: CategoryCardsProps) {
|
||||
return (
|
||||
<div className="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-3">
|
||||
{categories.map((cat) => {
|
||||
const catProgress = getCategoryProgress(cat.id)
|
||||
return (
|
||||
<button
|
||||
key={cat.id}
|
||||
onClick={() => onSelectCategory(selectedCategory === cat.id ? null : cat.id)}
|
||||
className={`p-3 rounded-xl border-2 text-left transition-all ${
|
||||
selectedCategory === cat.id
|
||||
? `${cat.bgColor} ring-2 ring-offset-2`
|
||||
: 'bg-white border-slate-200 hover:border-slate-300'
|
||||
}`}
|
||||
>
|
||||
<div className="flex items-center gap-2 mb-1">
|
||||
<span className={selectedCategory === cat.id ? cat.color : 'text-slate-500'}>
|
||||
{cat.icon}
|
||||
</span>
|
||||
<span className="font-medium text-xs truncate">{cat.name}</span>
|
||||
</div>
|
||||
<div className="text-xs text-slate-500">
|
||||
{catProgress.completed}/{catProgress.total}
|
||||
</div>
|
||||
</button>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
55
admin-lehrer/app/(admin)/backlog/_components/FilterBar.tsx
Normal file
55
admin-lehrer/app/(admin)/backlog/_components/FilterBar.tsx
Normal file
@@ -0,0 +1,55 @@
|
||||
'use client'
|
||||
|
||||
import { Search } from 'lucide-react'
|
||||
|
||||
interface FilterBarProps {
|
||||
searchQuery: string
|
||||
onSearchChange: (query: string) => void
|
||||
selectedPriority: string | null
|
||||
onPriorityChange: (priority: string | null) => void
|
||||
hasActiveFilters: boolean
|
||||
onClearFilters: () => void
|
||||
}
|
||||
|
||||
export function FilterBar({
|
||||
searchQuery,
|
||||
onSearchChange,
|
||||
selectedPriority,
|
||||
onPriorityChange,
|
||||
hasActiveFilters,
|
||||
onClearFilters,
|
||||
}: FilterBarProps) {
|
||||
return (
|
||||
<div className="flex flex-wrap gap-4">
|
||||
<div className="flex-1 min-w-[200px] relative">
|
||||
<Search className="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400" />
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Suchen..."
|
||||
value={searchQuery}
|
||||
onChange={(e) => onSearchChange(e.target.value)}
|
||||
className="w-full pl-10 pr-4 py-2 border border-slate-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
/>
|
||||
</div>
|
||||
<select
|
||||
value={selectedPriority || ''}
|
||||
onChange={(e) => onPriorityChange(e.target.value || null)}
|
||||
className="px-4 py-2 border border-slate-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
>
|
||||
<option value="">Alle Prioritaeten</option>
|
||||
<option value="critical">Kritisch</option>
|
||||
<option value="high">Hoch</option>
|
||||
<option value="medium">Mittel</option>
|
||||
<option value="low">Niedrig</option>
|
||||
</select>
|
||||
{hasActiveFilters && (
|
||||
<button
|
||||
onClick={onClearFilters}
|
||||
className="px-4 py-2 text-sm text-slate-600 hover:text-slate-900"
|
||||
>
|
||||
Filter zuruecksetzen
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
25
admin-lehrer/app/(admin)/backlog/_components/InfoBox.tsx
Normal file
25
admin-lehrer/app/(admin)/backlog/_components/InfoBox.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
'use client'
|
||||
|
||||
import { AlertTriangle } from 'lucide-react'
|
||||
|
||||
export function InfoBox() {
|
||||
return (
|
||||
<div className="bg-amber-50 border border-amber-200 rounded-xl p-6">
|
||||
<div className="flex items-start gap-4">
|
||||
<AlertTriangle className="w-6 h-6 text-amber-600 flex-shrink-0 mt-0.5" />
|
||||
<div>
|
||||
<h3 className="font-semibold text-amber-900">Wichtiger Hinweis</h3>
|
||||
<p className="text-sm text-amber-800 mt-1">
|
||||
Diese Backlog-Liste muss vollstaendig abgearbeitet sein, bevor BreakPilot in den
|
||||
Produktivbetrieb gehen kann. Alle kritischen Items muessen abgeschlossen sein. Der
|
||||
Fortschritt wird lokal im Browser gespeichert und kann mit "Zuruecksetzen"
|
||||
auf die Standardwerte zurueckgesetzt werden.
|
||||
</p>
|
||||
<p className="text-xs text-amber-700 mt-2">
|
||||
Letzte Aktualisierung: 2026-02-03
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
'use client'
|
||||
|
||||
import type { BacklogProgress } from '../types'
|
||||
|
||||
interface OverallProgressProps {
|
||||
progress: BacklogProgress
|
||||
onReset: () => void
|
||||
}
|
||||
|
||||
export function OverallProgress({ progress, onReset }: OverallProgressProps) {
|
||||
return (
|
||||
<div className="bg-white rounded-xl border border-slate-200 p-6">
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<div>
|
||||
<h2 className="text-lg font-semibold text-slate-900">Gesamtfortschritt</h2>
|
||||
<p className="text-sm text-slate-500">
|
||||
{progress.completed} von {progress.total} Aufgaben abgeschlossen
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex items-center gap-4">
|
||||
<button
|
||||
onClick={onReset}
|
||||
className="text-sm text-slate-500 hover:text-slate-700"
|
||||
>
|
||||
Zuruecksetzen
|
||||
</button>
|
||||
<div className="text-3xl font-bold text-blue-600">{progress.percentage}%</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="w-full bg-slate-200 rounded-full h-3">
|
||||
<div
|
||||
className="bg-blue-600 h-3 rounded-full transition-all duration-500"
|
||||
style={{ width: `${progress.percentage}%` }}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user