mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-10-20 05:15:31 +00:00
Merge pull request #44627 from NousResearch/bb/desktop-tool-row-copy-affordance
fix(desktop): move tool-row copy control into expanded body
This commit is contained in:
commit
6db65e687c
1 changed files with 17 additions and 3 deletions
|
|
@ -279,11 +279,14 @@ function ToolEntry({ part }: ToolEntryProps) {
|
||||||
|
|
||||||
const copyAction = useMemo(() => toolCopyPayload(part, view), [part, view])
|
const copyAction = useMemo(() => toolCopyPayload(part, view), [part, view])
|
||||||
|
|
||||||
|
// The header trailing slot only carries the live duration timer while the
|
||||||
|
// tool is running. The copy control used to live here too, but an
|
||||||
|
// `opacity-0` (yet still clickable) button straddling the caret/duration made
|
||||||
|
// the disclosure caret hard to hit. Copy now lives in the expanded body's
|
||||||
|
// top-right, where it can't fight the caret for the right edge.
|
||||||
const trailing =
|
const trailing =
|
||||||
isPending && !embedded ? (
|
isPending && !embedded ? (
|
||||||
<ActivityTimerText className={TOOL_HEADER_DURATION_CLASS} seconds={elapsed} />
|
<ActivityTimerText className={TOOL_HEADER_DURATION_CLASS} seconds={elapsed} />
|
||||||
) : !isPending && copyAction.text ? (
|
|
||||||
<CopyButton appearance="tool-row" label={copyAction.label} stopPropagation text={copyAction.text} />
|
|
||||||
) : undefined
|
) : undefined
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -322,7 +325,18 @@ function ToolEntry({ part }: ToolEntryProps) {
|
||||||
</div>
|
</div>
|
||||||
{isPending && <PendingToolApproval part={part} />}
|
{isPending && <PendingToolApproval part={part} />}
|
||||||
{open && (
|
{open && (
|
||||||
<div className="grid w-full min-w-0 max-w-full gap-1.5 overflow-hidden p-1.5">
|
<div className="relative grid w-full min-w-0 max-w-full gap-1.5 overflow-hidden p-1.5">
|
||||||
|
{copyAction.text && (
|
||||||
|
<CopyButton
|
||||||
|
appearance="inline"
|
||||||
|
className="absolute right-1.5 top-1.5 z-10 h-5 gap-0 rounded-md border border-(--ui-stroke-tertiary) bg-background/80 px-1 opacity-60 backdrop-blur-sm transition-opacity hover:opacity-100 focus-visible:opacity-100"
|
||||||
|
iconClassName="size-3"
|
||||||
|
label={copyAction.label}
|
||||||
|
showLabel={false}
|
||||||
|
stopPropagation
|
||||||
|
text={copyAction.text}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{!embedded && view.previewTarget && isPreviewableTarget(view.previewTarget) && (
|
{!embedded && view.previewTarget && isPreviewableTarget(view.previewTarget) && (
|
||||||
<PreviewAttachment source="tool-result" target={view.previewTarget} />
|
<PreviewAttachment source="tool-result" target={view.previewTarget} />
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue