Frontend: Composables useConfirm/useChat/usePolling; Guide-Chat abbrechbar

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
team3
2026-06-12 08:12:11 +02:00
parent 601237bbbf
commit 5c35939eab
6 changed files with 178 additions and 94 deletions

View File

@@ -1,5 +1,6 @@
<script setup>
import { ref, computed } from 'vue'
import { useConfirm } from '../composables/useConfirm.js'
const props = defineProps({
topics: { type: Array, required: true },
@@ -63,21 +64,7 @@ const activeGenerations = computed(() => {
return [...bausteinLines, ...guideLines]
})
// Inline-Bestätigung statt confirm(): erster Klick scharfschalten („Sicher?"),
// zweiter Klick führt aus. Browser-Dialoge können unterdrückt sein (Firefox).
const pendingConfirm = ref(null)
let confirmTimer = null
function armOrRun(key, action) {
clearTimeout(confirmTimer)
if (pendingConfirm.value === key) {
pendingConfirm.value = null
action()
} else {
pendingConfirm.value = key
confirmTimer = setTimeout(() => { pendingConfirm.value = null }, 3000)
}
}
const { pending: pendingConfirm, armOrRun } = useConfirm()
function confirmCancelBausteine() {
armOrRun('bausteine', () => emit('cancelBausteine'))