Merge pull request #7677 from continuedev/dallin/con-3851-persist-response-actions-space

fix: HOTFIX response actions disappearing and causing jumping while streaming
This commit is contained in:
Nate Sesti 2025-09-09 21:38:14 -07:00 • committed by GitHub
commit 28b3491191
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -22,9 +22,6 @@ export default function StepContainer(props: StepContainerProps) {
const dispatch = useDispatch();
const [isTruncated, setIsTruncated] = useState(false);
const isStreaming = useAppSelector((state) => state.session.isStreaming);
const historyItemAfterThis = useAppSelector(
(state) => state.session.history[props.index + 1],
);
const uiConfig = useAppSelector(selectUIConfig);
// Calculate dimming and indicator state based on latest summary index
@ -34,22 +31,12 @@ export default function StepContainer(props: StepContainerProps) {
const isLatestSummary =
latestSummaryIndex !== -1 && props.index === latestSummaryIndex;
const isNextMsgAssistantOrThinking =
historyItemAfterThis?.message.role === "assistant" ||
historyItemAfterThis?.message.role === "thinking" ||
historyItemAfterThis?.message.role === "tool";
const shouldRenderResponseAction = () => {
if (isNextMsgAssistantOrThinking) {
return false;
}
if (!historyItemAfterThis) {
return !props.item.toolCallStates;
}
return true;
};
const historyItemAfterThis = useAppSelector(
(state) => state.session.history[props.index + 1],
);
const showResponseActions =
(props.isLast || historyItemAfterThis?.message.role === "user") &&
!(props.isLast && (isStreaming || props.item.toolCallStates));
useEffect(() => {
if (!isStreaming) {
@ -110,9 +97,9 @@ export default function StepContainer(props: StepContainerProps) {
{props.isLast && <ThinkingIndicator historyItem={props.item} />}
</div>
{shouldRenderResponseAction() && !isStreaming && (
{showResponseActions && (
<div
className={`mt-2 h-7 transition-opacity duration-300 ease-in-out ${isBeforeLatestSummary ? "opacity-35" : ""}`}
className={`mt-2 h-7 transition-opacity duration-300 ease-in-out ${isBeforeLatestSummary || isStreaming ? "opacity-35" : ""} ${isStreaming && "pointer-events-none cursor-not-allowed"}`}
>
<ResponseActions
isTruncated={isTruncated}