fix(app): remove copy button from summary
This commit is contained in:
@@ -6,7 +6,6 @@ import {
|
|||||||
type PermissionRequest,
|
type PermissionRequest,
|
||||||
TextPart,
|
TextPart,
|
||||||
ToolPart,
|
ToolPart,
|
||||||
UserMessage,
|
|
||||||
} from "@opencode-ai/sdk/v2/client"
|
} from "@opencode-ai/sdk/v2/client"
|
||||||
import { useData } from "../context"
|
import { useData } from "../context"
|
||||||
import { useDiffComponent } from "../context/diff"
|
import { useDiffComponent } from "../context/diff"
|
||||||
@@ -21,8 +20,6 @@ import { Accordion } from "./accordion"
|
|||||||
import { StickyAccordionHeader } from "./sticky-accordion-header"
|
import { StickyAccordionHeader } from "./sticky-accordion-header"
|
||||||
import { FileIcon } from "./file-icon"
|
import { FileIcon } from "./file-icon"
|
||||||
import { Icon } from "./icon"
|
import { Icon } from "./icon"
|
||||||
import { IconButton } from "./icon-button"
|
|
||||||
import { Tooltip } from "./tooltip"
|
|
||||||
import { Card } from "./card"
|
import { Card } from "./card"
|
||||||
import { Dynamic } from "solid-js/web"
|
import { Dynamic } from "solid-js/web"
|
||||||
import { Button } from "./button"
|
import { Button } from "./button"
|
||||||
@@ -352,7 +349,6 @@ export function SessionTurn(
|
|||||||
const hasDiffs = createMemo(() => (data.store.session_diff?.[props.sessionID]?.length ?? 0) > 0)
|
const hasDiffs = createMemo(() => (data.store.session_diff?.[props.sessionID]?.length ?? 0) > 0)
|
||||||
const hideResponsePart = createMemo(() => !working() && !!responsePartId())
|
const hideResponsePart = createMemo(() => !working() && !!responsePartId())
|
||||||
|
|
||||||
const [responseCopied, setResponseCopied] = createSignal(false)
|
|
||||||
const [rootRef, setRootRef] = createSignal<HTMLDivElement | undefined>()
|
const [rootRef, setRootRef] = createSignal<HTMLDivElement | undefined>()
|
||||||
const [stickyRef, setStickyRef] = createSignal<HTMLDivElement | undefined>()
|
const [stickyRef, setStickyRef] = createSignal<HTMLDivElement | undefined>()
|
||||||
|
|
||||||
@@ -362,13 +358,6 @@ export function SessionTurn(
|
|||||||
const next = Math.ceil(height)
|
const next = Math.ceil(height)
|
||||||
root.style.setProperty("--session-turn-sticky-height", `${next}px`)
|
root.style.setProperty("--session-turn-sticky-height", `${next}px`)
|
||||||
}
|
}
|
||||||
const handleCopyResponse = async () => {
|
|
||||||
const content = response()
|
|
||||||
if (!content) return
|
|
||||||
await navigator.clipboard.writeText(content)
|
|
||||||
setResponseCopied(true)
|
|
||||||
setTimeout(() => setResponseCopied(false), 2000)
|
|
||||||
}
|
|
||||||
|
|
||||||
function duration() {
|
function duration() {
|
||||||
const msg = message()
|
const msg = message()
|
||||||
@@ -589,15 +578,6 @@ export function SessionTurn(
|
|||||||
{/* Response */}
|
{/* Response */}
|
||||||
<Show when={!working() && (response() || hasDiffs())}>
|
<Show when={!working() && (response() || hasDiffs())}>
|
||||||
<div data-slot="session-turn-summary-section">
|
<div data-slot="session-turn-summary-section">
|
||||||
<div data-slot="session-turn-summary-copy">
|
|
||||||
<Tooltip value={responseCopied() ? "Copied!" : "Copy"} placement="top" gutter={8}>
|
|
||||||
<IconButton
|
|
||||||
icon={responseCopied() ? "check" : "copy"}
|
|
||||||
variant="secondary"
|
|
||||||
onClick={handleCopyResponse}
|
|
||||||
/>
|
|
||||||
</Tooltip>
|
|
||||||
</div>
|
|
||||||
<div data-slot="session-turn-summary-header">
|
<div data-slot="session-turn-summary-header">
|
||||||
<h2 data-slot="session-turn-summary-title">Response</h2>
|
<h2 data-slot="session-turn-summary-title">Response</h2>
|
||||||
<Markdown
|
<Markdown
|
||||||
|
|||||||
Reference in New Issue
Block a user