V2-Dev-Stand: Skala 1-10, Benefits/Concerns, DEV-Isolation und Gitea-Doku.
Bündelt die Neuentwicklung in AssigmentMonitorV2 (eigene Ports/DB), die Umstellung auf numerische Bewertungen, Meeting-Checklisten, KI-Tagging und die geplante Feedback-Kaskade — als Basis für Versionsverwaltung in Gitea. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
782678a1cf
commit
234f87d408
71 files changed
+7567
-705
No files matched your search
@@ -0,0 +1,85 @@
|
||||
import {
|
||||
DEFAULT_RATING_COLOR_BANDS,
|
||||
RATING_SCORES,
|
||||
normalizeRatingScore,
|
||||
resolveScoreStyle,
|
||||
} from '../config/constants'
|
||||
import type { RatingColorBand, RatingScore } from '../db/types'
|
||||
|
||||
interface ScorePickerProps {
|
||||
value: RatingScore | null
|
||||
onChange: (score: RatingScore | null) => void
|
||||
bands?: RatingColorBand[]
|
||||
/** 'buttons' = 1–10-Leiste, 'select' = kompaktes Dropdown */
|
||||
variant?: 'buttons' | 'select'
|
||||
className?: string
|
||||
/** Zeigt n/a / Leeren — setzt Score auf null. */
|
||||
allowClear?: boolean
|
||||
}
|
||||
|
||||
export function ScorePicker({
|
||||
value,
|
||||
onChange,
|
||||
bands = DEFAULT_RATING_COLOR_BANDS,
|
||||
variant = 'buttons',
|
||||
className = '',
|
||||
allowClear = true,
|
||||
}: ScorePickerProps) {
|
||||
const normalized = normalizeRatingScore(value)
|
||||
|
||||
if (variant === 'select') {
|
||||
const style = resolveScoreStyle(normalized, bands)
|
||||
return (
|
||||
<select
|
||||
value={normalized ?? ''}
|
||||
onChange={e => {
|
||||
const v = e.target.value
|
||||
onChange(v === '' ? null : Number(v) as RatingScore)
|
||||
}}
|
||||
className={`text-xs rounded-lg border px-1 py-1 focus:outline-none flex-shrink-0 tabular-nums ${
|
||||
normalized !== null ? style.active : style.color
|
||||
} ${className}`}
|
||||
>
|
||||
<option value="">{allowClear ? 'n/a' : '–'}</option>
|
||||
{RATING_SCORES.map(n => (
|
||||
<option key={n} value={n}>{n}</option>
|
||||
))}
|
||||
</select>
|
||||
)
|
||||
}
|
||||
|
||||
const clearStyle = resolveScoreStyle(null, bands)
|
||||
|
||||
return (
|
||||
<div className={`flex gap-0.5 ${className}`}>
|
||||
{allowClear && (
|
||||
<button
|
||||
type="button"
|
||||
title="Nicht bewertet / zurücksetzen"
|
||||
onClick={() => onChange(null)}
|
||||
className={`flex-shrink-0 px-1.5 py-1.5 rounded text-xs font-bold border transition ${
|
||||
normalized === null ? clearStyle.active : clearStyle.color
|
||||
}`}
|
||||
>
|
||||
n/a
|
||||
</button>
|
||||
)}
|
||||
{RATING_SCORES.map(n => {
|
||||
const style = resolveScoreStyle(n, bands)
|
||||
const selected = normalized === n
|
||||
return (
|
||||
<button
|
||||
key={n}
|
||||
type="button"
|
||||
onClick={() => onChange(n)}
|
||||
className={`flex-1 min-w-0 py-1.5 rounded text-xs font-bold border transition tabular-nums ${
|
||||
selected ? style.active : style.color
|
||||
}`}
|
||||
>
|
||||
{n}
|
||||
</button>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user