fix: Import confirmation UX - two-step process
Admin-Prompts Import hatte unklare Abbrechen-Logik: - Nutzer erwartete: Abbrechen = Import komplett abbrechen - Vorher: Abbrechen = overwrite=false, Import lief weiter Lösung: Zwei-Schritt-Bestätigung 1. "X Prompts importieren?" → Abbrechen = kompletter Abbruch 2. "Existierende überschreiben?" → Abbrechen = nur neue importieren UX: Klare Trennung zwischen "Import abbrechen" und "Modus wählen" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
10d24bbef7
commit
f3a61091c7
|
|
@ -202,11 +202,25 @@ export default function AdminPromptsPage() {
|
||||||
const text = await file.text()
|
const text = await file.text()
|
||||||
const data = JSON.parse(text)
|
const data = JSON.parse(text)
|
||||||
|
|
||||||
// Ask user about overwrite
|
// Two-step confirmation for clarity
|
||||||
|
// Step 1: Confirm import
|
||||||
|
const shouldImport = confirm(
|
||||||
|
`${data.count || 0} Prompts importieren?\n\n` +
|
||||||
|
'OK = Fortfahren\n' +
|
||||||
|
'Abbrechen = Import abbrechen'
|
||||||
|
)
|
||||||
|
|
||||||
|
if (!shouldImport) {
|
||||||
|
setImporting(false)
|
||||||
|
event.target.value = ''
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Step 2: Ask about overwrite
|
||||||
const overwrite = confirm(
|
const overwrite = confirm(
|
||||||
'Bestehende Prompts überschreiben?\n\n' +
|
'Existierende Prompts überschreiben?\n\n' +
|
||||||
'JA = Existierende Prompts aktualisieren\n' +
|
'OK = Ja, bestehende Prompts aktualisieren\n' +
|
||||||
'NEIN = Nur neue Prompts erstellen, Duplikate überspringen'
|
'Abbrechen = Nein, nur neue Prompts erstellen'
|
||||||
)
|
)
|
||||||
|
|
||||||
const result = await api.importPrompts(data, overwrite)
|
const result = await api.importPrompts(data, overwrite)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user