fix: move OptionsButtons outside WithCopyButton component (#7783)

Relocate OptionsButtons component to be a sibling of WithCopyButton
rather than a child. This fixes the component hierarchy for followup
and completion_result message types, ensuring proper rendering and
interaction behavior. Also adds QuoteButton support to completion_result.
This commit is contained in:
Ara authored and GitHub committed 2025-12-01 15:16:16 -08:00
1 parent aa9573fb0a
commit 49be10ead8
1 file changed
+27 -25
+27 -25
View File
@@ -1844,15 +1844,6 @@ export const ChatRowContent = memo(
ref={contentRef}
textToCopy={question}>
<Markdown markdown={question} />
<OptionsButtons
inputValue={inputValue}
isActive={
(isLast && lastModifiedMessage?.ask === "followup") ||
(!selected && options && options.length > 0)
}
options={options}
selected={selected}
/>
{quoteButtonState.visible && (
<QuoteButton
left={quoteButtonState.left}
@@ -1863,6 +1854,15 @@ export const ChatRowContent = memo(
/>
)}
</WithCopyButton>
<OptionsButtons
inputValue={inputValue}
isActive={
(isLast && lastModifiedMessage?.ask === "followup") ||
(!selected && options && options.length > 0)
}
options={options}
selected={selected}
/>
</div>
)
case "new_task":
@@ -1930,12 +1930,23 @@ export const ChatRowContent = memo(
response = message.text
}
return (
<WithCopyButton
onMouseUp={handleMouseUp}
position="bottom-right"
ref={contentRef}
textToCopy={response}>
<Markdown markdown={response} />
<>
<WithCopyButton
onMouseUp={handleMouseUp}
position="bottom-right"
ref={contentRef}
textToCopy={response}>
<Markdown markdown={response} />
{quoteButtonState.visible && (
<QuoteButton
left={quoteButtonState.left}
onClick={() => {
handleQuoteClick()
}}
top={quoteButtonState.top}
/>
)}
</WithCopyButton>
<OptionsButtons
inputValue={inputValue}
isActive={
@@ -1945,16 +1956,7 @@ export const ChatRowContent = memo(
options={options}
selected={selected}
/>
{quoteButtonState.visible && (
<QuoteButton
left={quoteButtonState.left}
onClick={() => {
handleQuoteClick()
}}
top={quoteButtonState.top}
/>
)}
</WithCopyButton>
</>
)
}
default: