Merge pull request #6441 from continuedev/dallin/fix-flashing-tool-truncation

Less flashy truncate to tool call icon
This commit is contained in:
Nate Sesti 2025-07-03 17:37:15 -07:00 • committed by GitHub
commit 1803de61cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -19,13 +19,16 @@ export function ToolTruncateHistoryIcon({
}, [history]);
const dispatch = useAppDispatch();
const { mainEditor } = useMainEditor();
if (isStreaming || historyIndex === lastMessageIndex) {
if (historyIndex === lastMessageIndex) {
return null;
}
return (
<ToolbarButtonWithTooltip
tooltipContent="Trim chat to this message"
tooltipContent={isStreaming ? "" : "Trim chat to this message"}
onClick={() => {
if (isStreaming) {
return;
}
dispatch(
truncateHistoryToMessage({
index: historyIndex,
@ -34,7 +37,9 @@ export function ToolTruncateHistoryIcon({
mainEditor?.commands.focus();
}}
>
<BarsArrowUpIcon className="h-3 w-3 flex-shrink-0" />
<BarsArrowUpIcon
className={`h-3 w-3 flex-shrink-0 ${isStreaming ? "cursor-not-allowed" : "cursor-pointer"}`}
/>
</ToolbarButtonWithTooltip>
);
}