fix(webui): keep slash commands out of streaming state
This commit is contained in:
@@ -1480,7 +1480,17 @@ export function ThreadComposer({
|
||||
...(attachedMcpPresets.length > 0 ? { mcpPresets: attachedMcpPresets } : {}),
|
||||
}
|
||||
: undefined;
|
||||
onSend(content, payload, options);
|
||||
const commandName = content.split(/\s+/, 1)[0];
|
||||
const isSlashSideChannel =
|
||||
payload === undefined
|
||||
&& attachedCliApps.length === 0
|
||||
&& attachedMcpPresets.length === 0
|
||||
&& visibleSlashCommands.some((command) => command.command === commandName);
|
||||
onSend(
|
||||
content,
|
||||
payload,
|
||||
isSlashSideChannel ? { ...options, sideChannel: true } : options,
|
||||
);
|
||||
setQueuedPrompts([]);
|
||||
// Bubble owns the data URL copy; safe to revoke every staged blob
|
||||
// preview here without affecting the rendered message.
|
||||
@@ -1497,6 +1507,7 @@ export function ThreadComposer({
|
||||
onSend,
|
||||
readyImages,
|
||||
value,
|
||||
visibleSlashCommands,
|
||||
]);
|
||||
|
||||
const onKeyDown = (e: ReactKeyboardEvent<HTMLTextAreaElement>) => {
|
||||
|
||||
@@ -455,6 +455,13 @@ export const ThreadViewport = forwardRef<ThreadViewportHandle, ThreadViewportPro
|
||||
measureComposerDock();
|
||||
}, [composer, hasMessages, measureComposerDock]);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
if (!hasMessages || userReadingHistoryRef.current) return;
|
||||
const promptId = activeTurnPromptRef.current;
|
||||
if (promptId && scrollToPromptTopNow(promptId)) return;
|
||||
scrollToBottom(false, 2);
|
||||
}, [composerDockHeight, hasMessages, scrollToBottom, scrollToPromptTopNow]);
|
||||
|
||||
useEffect(() => cancelScheduledBottomScroll, [cancelScheduledBottomScroll]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user