revert(frontend): Frontend auf letzten funktionierenden Stand 5680179 zurückgesetzt — i18n-Massen-Batch brach Dashboard-Shell in Produktion; Render-Loop-Fix und DSGVO-Antrags-UI liegen sicher in Historie für kontrollierten Wiedereinspiel
This commit is contained in:
@@ -3,7 +3,6 @@ import React, { useState, useRef, useEffect, useCallback } from 'react';
|
||||
import { Sparkles, Send } from 'lucide-react';
|
||||
import { streamChat, fetchMessages } from '@/api/ai';
|
||||
import { apiClient } from '@/api/client';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
interface AiChatPanelProps {
|
||||
windowTitle: string;
|
||||
@@ -17,7 +16,6 @@ interface SimpleMessage {
|
||||
}
|
||||
|
||||
export function AiChatPanel({ windowTitle, windowType }: AiChatPanelProps) {
|
||||
const { t } = useTranslation();
|
||||
const [messages, setMessages] = useState<SimpleMessage[]>([]);
|
||||
const [input, setInput] = useState('');
|
||||
const [isStreaming, setIsStreaming] = useState(false);
|
||||
@@ -120,10 +118,10 @@ export function AiChatPanel({ windowTitle, windowType }: AiChatPanelProps) {
|
||||
<div className="flex flex-col h-full">
|
||||
<div className="px-4 py-2 border-b border-secondary-200 bg-secondary-50 flex items-center gap-2">
|
||||
<Sparkles className="w-4 h-4 text-primary-500" />
|
||||
<span className="text-sm font-semibold text-secondary-700">{t('aiChatPanel.kiassistent')}</span>
|
||||
<span className="text-sm font-semibold text-secondary-700">KI Assistent</span>
|
||||
</div>
|
||||
<div className="flex-1 flex items-center justify-center text-sm text-secondary-400">
|
||||
{t('aiChatPanel.verbindemitki')}
|
||||
Verbinde mit KI...
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
@@ -134,7 +132,7 @@ export function AiChatPanel({ windowTitle, windowType }: AiChatPanelProps) {
|
||||
<div className="flex flex-col h-full">
|
||||
<div className="px-4 py-2 border-b border-secondary-200 bg-secondary-50 flex items-center gap-2">
|
||||
<Sparkles className="w-4 h-4 text-primary-500" />
|
||||
<span className="text-sm font-semibold text-secondary-700">{t('aiChatPanel.kiassistent')}</span>
|
||||
<span className="text-sm font-semibold text-secondary-700">KI Assistent</span>
|
||||
</div>
|
||||
<div className="flex-1 flex items-center justify-center p-4 text-center">
|
||||
<div>
|
||||
@@ -151,7 +149,7 @@ export function AiChatPanel({ windowTitle, windowType }: AiChatPanelProps) {
|
||||
{/* Header */}
|
||||
<div className="px-4 py-2 border-b border-secondary-200 bg-secondary-50 flex items-center gap-2">
|
||||
<Sparkles className="w-4 h-4 text-primary-500" />
|
||||
<span className="text-sm font-semibold text-secondary-700">{t('aiChatPanel.kiassistent')}</span>
|
||||
<span className="text-sm font-semibold text-secondary-700">KI Assistent</span>
|
||||
</div>
|
||||
|
||||
{/* Context info */}
|
||||
@@ -163,7 +161,7 @@ export function AiChatPanel({ windowTitle, windowType }: AiChatPanelProps) {
|
||||
<div ref={scrollRef} className="flex-1 overflow-y-auto p-4 space-y-2">
|
||||
{messages.length === 0 && !streamingContent && (
|
||||
<p className="text-sm text-secondary-400 text-center mt-4">
|
||||
{t('aiChatPanel.stelleeinefragezumaktuellenfenster')}
|
||||
Stelle eine Frage zum aktuellen Fenster...
|
||||
</p>
|
||||
)}
|
||||
{messages.map((msg) => (
|
||||
@@ -195,7 +193,7 @@ export function AiChatPanel({ windowTitle, windowType }: AiChatPanelProps) {
|
||||
value={input}
|
||||
onChange={(e) => setInput(e.target.value)}
|
||||
onKeyDown={handleKeyDown}
|
||||
placeholder={t('aiChatPanel.nachrichteingeben')}
|
||||
placeholder="Nachricht eingeben..."
|
||||
rows={1}
|
||||
className="flex-1 px-3 py-2 text-sm rounded-md border border-secondary-300 focus:outline-none focus:ring-2 focus:ring-primary-500 resize-none"
|
||||
disabled={isStreaming}
|
||||
@@ -204,7 +202,7 @@ export function AiChatPanel({ windowTitle, windowType }: AiChatPanelProps) {
|
||||
onClick={handleSend}
|
||||
disabled={!input.trim() || isStreaming}
|
||||
className="p-2 rounded-md bg-primary-600 text-white hover:bg-primary-700 disabled:opacity-50 disabled:cursor-not-allowed"
|
||||
aria-label={t('aiChatPanel.senden')}
|
||||
aria-label="Senden"
|
||||
>
|
||||
<Send className="w-4 h-4" />
|
||||
</button>
|
||||
|
||||
@@ -3,14 +3,12 @@ import clsx from 'clsx';
|
||||
import { Sparkles, Maximize2, Minimize2, Minus, X } from 'lucide-react';
|
||||
import { useWindowStore, type WindowState } from '@/store/windowStore';
|
||||
import { AiChatPanel } from './AiChatPanel';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
interface WindowProps {
|
||||
window: WindowState;
|
||||
}
|
||||
|
||||
export function Window({ window: win }: WindowProps) {
|
||||
const { t } = useTranslation();
|
||||
const {
|
||||
closeWindow,
|
||||
minimizeWindow,
|
||||
@@ -108,8 +106,8 @@ export function Window({ window: win }: WindowProps) {
|
||||
'p-1.5 rounded hover:bg-secondary-200',
|
||||
win.aiChatVisible && 'bg-primary-100 text-primary-600'
|
||||
)}
|
||||
aria-label={t('window.kichateinaus')}
|
||||
title={t('window.kichat')}
|
||||
aria-label="KI Chat ein/aus"
|
||||
title="KI Chat"
|
||||
>
|
||||
<Sparkles className="w-4 h-4" />
|
||||
</button>
|
||||
@@ -130,8 +128,8 @@ export function Window({ window: win }: WindowProps) {
|
||||
<button
|
||||
onClick={() => minimizeWindow(win.id)}
|
||||
className="p-1.5 rounded hover:bg-secondary-200"
|
||||
aria-label={t('window.minimieren')}
|
||||
title={t('window.minimieren')}
|
||||
aria-label="Minimieren"
|
||||
title="Minimieren"
|
||||
>
|
||||
<Minus className="w-4 h-4" />
|
||||
</button>
|
||||
@@ -139,8 +137,8 @@ export function Window({ window: win }: WindowProps) {
|
||||
<button
|
||||
onClick={() => closeWindow(win.id)}
|
||||
className="p-1.5 rounded hover:bg-danger-100 hover:text-danger-600"
|
||||
aria-label={t('window.schließen')}
|
||||
title={t('window.schließen')}
|
||||
aria-label="Schließen"
|
||||
title="Schließen"
|
||||
>
|
||||
<X className="w-4 h-4" />
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user