Chat: Korrekturen aus dem Abschlussreview

- Gespraech startet nicht neu, wenn der Kundenname nachlaedt (Entwurf bleibt, kein verwaister Timer)
- Neue Nachricht an Kunde: erst die eindeutige Beschriftung Name · E-Mail · Kd.-Nr. oeffnet

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-01 23:46:51 +00:00
1 parent eb0b889203
commit 813c6a7e18
4 files changed
+43 -7

No files matched your search

+6 -4
View File
@@ -6,7 +6,7 @@ import ChatThread from '../components/chat/ChatThread'
import { useCustomers } from '../hooks/useCustomers'
import { listChats } from '../lib/teamApi'
import { formatViewLogTime } from '../lib/viewLog'
import { lastLine, sortChats } from '../lib/chatFormat'
import { customerPickLabel, findCustomerByLabel, lastLine, sortChats } from '../lib/chatFormat'
import '../styles/chat.css'
const LIST_POLL_MS = 30 * 1000
@@ -43,13 +43,15 @@ export default function CustomerChatPage() {
const q = String(text || '').trim().toLowerCase()
if (!q) return []
return customers
.filter((c) => (c.name || '').toLowerCase().includes(q))
.map((c) => ({ c, label: customerPickLabel(c) }))
.filter(({ label }) => label.toLowerCase().includes(q))
.slice(0, 8)
.map((c) => ({ value: c.name, hint: c.code || c.email || '' }))
.map(({ label }) => ({ value: label }))
}
// Erst die eindeutige Beschriftung aus der Vorschlagsliste oeffnet das Gespraech (nicht schon ein Namens-Treffer)
const onPick = (value) => {
setQuery(value)
const hit = customers.find((c) => c.name === value)
const hit = findCustomerByLabel(customers, value)
if (hit) {
setQuery('')
open(hit.$id)