@comergehq/studio 0.1.13 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,6 +10,8 @@ import { StudioSheetHeaderIconButton } from '../../components/studio-sheet/Studi
10
10
  import { IconArrowDown, IconBack, IconClose, IconDraw, IconHome } from '../../components/icons/StudioIcons';
11
11
  import { Text } from '../../components/primitives/Text';
12
12
  import type { ChatMessage } from '../../components/models/types';
13
+ import type { EditQueueItem } from '../../data/apps/edit-queue/types';
14
+ import { ChatQueue } from '../../components/chat/ChatQueue';
13
15
 
14
16
  export type ChatPanelProps = {
15
17
  title?: string;
@@ -29,6 +31,8 @@ export type ChatPanelProps = {
29
31
  onNavigateHome?: () => void;
30
32
  onStartDraw?: () => void;
31
33
  onSend: (text: string, attachments?: string[]) => void | Promise<void>;
34
+ queueItems?: EditQueueItem[];
35
+ onRemoveQueueItem?: (id: string) => void;
32
36
  };
33
37
 
34
38
  export function ChatPanel({
@@ -49,6 +53,8 @@ export function ChatPanel({
49
53
  onNavigateHome,
50
54
  onStartDraw,
51
55
  onSend,
56
+ queueItems = [],
57
+ onRemoveQueueItem,
52
58
  }: ChatPanelProps) {
53
59
  const listRef = React.useRef<ChatMessageListRef | null>(null);
54
60
  const [nearBottom, setNearBottom] = React.useState(true);
@@ -123,12 +129,17 @@ export function ChatPanel({
123
129
  );
124
130
  }
125
131
 
132
+ const queueTop = queueItems.length > 0 ? (
133
+ <ChatQueue items={queueItems} onRemove={onRemoveQueueItem} />
134
+ ) : null;
135
+
126
136
  return (
127
137
  <ChatPage
128
138
  header={header}
129
139
  messages={messages}
130
140
  showTypingIndicator={showTypingIndicator}
131
141
  topBanner={topBanner}
142
+ composerTop={queueTop}
132
143
  composerHorizontalPadding={0}
133
144
  listRef={listRef}
134
145
  onNearBottomChange={setNearBottom}
@@ -58,6 +58,8 @@ export type StudioOverlayProps = {
58
58
  chatSending?: boolean;
59
59
  chatShowTypingIndicator?: boolean;
60
60
  onSendChat: (text: string, attachments?: string[]) => void | Promise<void>;
61
+ chatQueueItems?: import('../../data/apps/edit-queue/types').EditQueueItem[];
62
+ onRemoveQueueItem?: (id: string) => void;
61
63
 
62
64
  // Navigation callbacks
63
65
  onNavigateHome?: () => void;
@@ -93,6 +95,8 @@ export function StudioOverlay({
93
95
  chatSending,
94
96
  chatShowTypingIndicator,
95
97
  onSendChat,
98
+ chatQueueItems,
99
+ onRemoveQueueItem,
96
100
  onNavigateHome,
97
101
  showBubble,
98
102
  studioControlOptions,
@@ -110,9 +114,11 @@ export function StudioOverlay({
110
114
  const [commentsCount, setCommentsCount] = React.useState<number | null>(null);
111
115
 
112
116
  const threadId = app?.threadId ?? null;
117
+ const disableOptimistic = Boolean(chatQueueItems && chatQueueItems.length > 0) || app?.status === 'editing';
113
118
  const optimistic = useOptimisticChatMessages({
114
119
  threadId,
115
120
  shouldForkOnEdit,
121
+ disableOptimistic,
116
122
  chatMessages,
117
123
  onSendChat,
118
124
  });
@@ -265,6 +271,8 @@ export function StudioOverlay({
265
271
  onNavigateHome={onNavigateHome}
266
272
  onStartDraw={startDraw}
267
273
  onSend={optimistic.onSend}
274
+ queueItems={chatQueueItems}
275
+ onRemoveQueueItem={onRemoveQueueItem}
268
276
  />
269
277
  }
270
278
  />