Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions components/AIMode/ChatPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export function ChatPane({
documentCard,
documentCardExecutionId,
}: ChatPaneProps) {
const { chatId, list, chat, modelSelection, draft, setDraft, notice, creatingChat } = state;
const { chatId, list, chat, modelSelection, draft, setDraft, notice, composerBusy, canStop } =
state;
const composerRef = useRef<HTMLTextAreaElement>(null);

// ---- transcript auto-scroll ----
Expand Down Expand Up @@ -74,7 +75,7 @@ export function ChatPane({
const startFromCard = useCallback(
(message: string) => {
state.clearNotice();
void state.sendText(message);
void state.send(message);
},
[state]
);
Expand All @@ -84,9 +85,6 @@ export function ChatPane({
chatId != null && (chat.access === 'not_found' || chat.access === 'unauthorized');
const composerDisabled =
listBlocked || chatUnavailable || (chatId != null && chat.access === 'loading');
const composerBusy = chat.isBusy || creatingChat;
// Stop must only be offered when there is a turn to cancel server-side.
const canStop = chat.latestExecution != null && chat.isBusy && chat.pendingSend == null;

// The listing usually knows the title before the chat itself has loaded,
// so a refresh doesn't flash "Untitled" while the transcript is fetched.
Expand All @@ -104,7 +102,7 @@ export function ChatPane({
textareaRef={composerRef}
value={draft}
onChange={setDraft}
onSend={state.send}
onSend={() => void state.send()}
onStop={state.stop}
busy={composerBusy}
canStop={canStop}
Expand Down
Loading
Loading