Changesets · Branches · Tags · Compare
| Changeset | b1f043ba350bd508e23161a397a36dd4d36743215a6f0af4ea6ef880aadd8ef4 |
|---|---|
| Author | Dallin Romney <dallinromney@gmail.com> · 2025-09-09 19:05 -07:00 |
| Committer | Dallin Romney <dallinromney@gmail.com> · 2025-09-09 19:05 -07:00 |
| Parents | 8c097bfc78a4 |
1 file changed
modified gui/src/components/StepContainer/StepContainer.tsx +8 −21
| @@ -22,9 +22,6 @@ | ||
| 22 | 22 | const dispatch = useDispatch(); |
| 23 | 23 | const [isTruncated, setIsTruncated] = useState(false); |
| 24 | 24 | const isStreaming = useAppSelector((state) => state.session.isStreaming); |
| 25 | - const historyItemAfterThis = useAppSelector( | |
| 26 | - (state) => state.session.history[props.index + 1], | |
| 27 | - ); | |
| 28 | 25 | const uiConfig = useAppSelector(selectUIConfig); |
| 29 | 26 | |
| 30 | 27 | // Calculate dimming and indicator state based on latest summary index |
| @@ -34,22 +31,12 @@ | ||
| 34 | 31 | const isLatestSummary = |
| 35 | 32 | latestSummaryIndex !== -1 && props.index === latestSummaryIndex; |
| 36 | 33 | |
| 37 | - const isNextMsgAssistantOrThinking = | |
| 38 | - historyItemAfterThis?.message.role === "assistant" || | |
| 39 | - historyItemAfterThis?.message.role === "thinking" || | |
| 40 | - historyItemAfterThis?.message.role === "tool"; | |
| 41 | - | |
| 42 | - const shouldRenderResponseAction = () => { | |
| 43 | - if (isNextMsgAssistantOrThinking) { | |
| 44 | - return false; | |
| 45 | - } | |
| 46 | - | |
| 47 | - if (!historyItemAfterThis) { | |
| 48 | - return !props.item.toolCallStates; | |
| 49 | - } | |
| 50 | - | |
| 51 | - return true; | |
| 52 | - }; | |
| 34 | + const historyItemAfterThis = useAppSelector( | |
| 35 | + (state) => state.session.history[props.index + 1], | |
| 36 | + ); | |
| 37 | + const showResponseActions = | |
| 38 | + (props.isLast || historyItemAfterThis?.message.role === "user") && | |
| 39 | + !(props.isLast && (isStreaming || props.item.toolCallStates)); | |
| 53 | 40 | |
| 54 | 41 | useEffect(() => { |
| 55 | 42 | if (!isStreaming) { |
| @@ -110,9 +97,9 @@ | ||
| 110 | 97 | {props.isLast && <ThinkingIndicator historyItem={props.item} />} |
| 111 | 98 | </div> |
| 112 | 99 | |
| 113 | - {shouldRenderResponseAction() && !isStreaming && ( | |
| 100 | + {showResponseActions && ( | |
| 114 | 101 | <div |
| 115 | - className={`mt-2 h-7 transition-opacity duration-300 ease-in-out ${isBeforeLatestSummary ? "opacity-35" : ""}`} | |
| 102 | + className={`mt-2 h-7 transition-opacity duration-300 ease-in-out ${isBeforeLatestSummary || isStreaming ? "opacity-35" : ""} ${isStreaming && "pointer-events-none cursor-not-allowed"}`} | |
| 116 | 103 | > |
| 117 | 104 | <ResponseActions |
| 118 | 105 | isTruncated={isTruncated} |