fix(client): pin the bash copy button while the command scrolls

The button lived inside the scroll container with sticky/float
positioning, so horizontal scrolling dragged it through the command
text. It now sits absolutely in a non-scrolling wrapper around the
scroller and stays in the corner on both axes.
This commit is contained in:
Marco Beretta 2026-07-31 05:16:41 +02:00
parent 86d8582535
commit db34b7163b
No known key found for this signature in database
GPG key ID: D918033D8E74CC11

View file

@ -135,20 +135,22 @@ export default function BashCall({
)}
>
{command && (
<div className="relative max-h-[300px] overflow-auto bg-surface-tertiary dark:bg-gray-950">
<div className="relative bg-surface-tertiary dark:bg-gray-950">
<CopyButton
iconOnly
isCopied={isCopied}
onClick={handleCopy}
className="sticky right-0 top-1 float-right mr-1.5 mt-1"
className="absolute right-1.5 top-1"
label={localize('com_ui_copy_code')}
/>
<pre className="whitespace-pre-wrap break-words px-3 py-2.5 pr-10 font-mono text-xs">
<span className="select-none text-text-tertiary" aria-hidden="true">
{'$ '}
</span>
<code className="hljs language-bash">{highlighted ?? command}</code>
</pre>
<div className="max-h-[300px] overflow-auto">
<pre className="whitespace-pre-wrap break-words px-3 py-2.5 pr-10 font-mono text-xs">
<span className="select-none text-text-tertiary" aria-hidden="true">
{'$ '}
</span>
<code className="hljs language-bash">{highlighted ?? command}</code>
</pre>
</div>
</div>
)}
{hasOutput && backgroundHandle == null && (