Files
openchamber/packages/ui/src/components/views/ChatView.tsx
T
Serhii DziupinandSerhii Dziupin 903638db94 fix(ui): show embedded subagent history while visibility stays inactive
Busy context-panel session chats could render only the working-status row
when the iframe booted inactive or lost its visibility handshake, because
message reads shared the composer/background-work gate. Keep message
subscriptions enabled in the mounted session-chat panel so materialized
history remains visible (#2903, #2892).

Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>
2026-08-15 03:40:37 +00:00

37 lines
1.2 KiB
TypeScript

import React from 'react';
import { ChatContainer } from '@/components/chat/ChatContainer';
import { ChatErrorBoundary } from '@/components/chat/ChatErrorBoundary';
import { useSessionUIStore } from '@/sync/session-ui-store';
type ChatViewProps = {
active?: boolean;
/**
* Controls message-history subscription independently of `active`.
* Embedded session-chat panels keep this true so history stays visible
* while composer focus / background work remain gated by visibility.
*/
messagesEnabled?: boolean;
readOnly?: boolean;
initialAllowPromptingSubagentSessions?: boolean;
};
export const ChatView: React.FC<ChatViewProps> = ({
active = true,
messagesEnabled,
readOnly = false,
initialAllowPromptingSubagentSessions,
}) => {
const currentSessionId = useSessionUIStore((state) => state.currentSessionId);
return (
<ChatErrorBoundary sessionId={currentSessionId || undefined}>
<ChatContainer
active={active}
messagesEnabled={messagesEnabled}
readOnly={readOnly}
initialAllowPromptingSubagentSessions={initialAllowPromptingSubagentSessions}
/>
</ChatErrorBoundary>
);
};