This commit is contained in:
seb
2026-10-07 19:33:26 +02:00
parent ee2056a159
commit 4cc8c49cf1
7 changed files with 152 additions and 49 deletions

View File

@@ -61,7 +61,10 @@ export default class ChatFab extends PureComponent {
let tooltipTitle = 'KI-Chat öffnen';
let ariaLabel = 'KI-Chat';
if (hasPendingAsk) {
if (isOpen) {
tooltipTitle = 'KI-Chat schließen';
ariaLabel = 'KI-Chat schließen';
} else if (hasPendingAsk) {
tooltipTitle = pendingAsk?.question
? `Antwort erforderlich: „${pendingAsk.question}“`
: 'Antwort erforderlich: Das Modell wartet auf Ihre Eingabe';
@@ -76,12 +79,8 @@ export default class ChatFab extends PureComponent {
sx={(theme) => ({
position: 'fixed',
bottom: { xs: 20, sm: 28 },
right: { xs: 20, sm: 28 },
left: { xs: 20, sm: 164 },
zIndex: theme.zIndex.speedDial || 1050,
opacity: isOpen ? 0 : 1,
transform: isOpen ? 'scale(0)' : 'scale(1)',
pointerEvents: isOpen ? 'none' : 'auto',
transition: 'transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s linear',
})}
>
<Box sx={{ position: 'relative' }}>
@@ -144,7 +143,7 @@ export default class ChatFab extends PureComponent {
/>
)}
<Tooltip title={tooltipTitle} placement="left" arrow disableHoverListener={isOpen}>
<Tooltip title={tooltipTitle} placement="right" arrow>
<Badge
badgeContent={hasPendingAsk ? '?' : undefined}
color={hasPendingAsk ? 'error' : isBusy ? 'warning' : 'default'}
@@ -184,13 +183,6 @@ export default class ChatFab extends PureComponent {
: isBusy
? CHAT_FAB_SHADOW_BUSY
: CHAT_FAB_SHADOW_IDLE,
transition: 'transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s',
'&:hover': {
transform: 'scale(1.06)',
},
'&:active': {
transform: 'scale(0.96)',
},
background: hasPendingAsk
? CHAT_FAB_PENDING
: isBusy