feat(app): keep assistant copy visible on dev builds (#62992)

This commit is contained in:
James Long
2026-11-09 18:47:45 -06:00
committed by GitHub
Unverified
parent 82bdcc37f1
commit 0c57a51787
5 changed files with 35 additions and 4 deletions
@@ -131,6 +131,9 @@ export function createTimelineCache(
get agents() {
return agents()
},
get copyAlwaysVisible() {
return data.copyAlwaysVisible
},
get backgroundCompaction() {
return backgroundCompaction()
},
@@ -39,6 +39,8 @@ export function SessionUIProvider(
const language = useLanguage()
const settings = useSettings()
const directory = () => props.directory
const releaseChannel = import.meta.env.VITE_OPENCODE_CHANNEL ?? "local"
const copyAlwaysVisible = releaseChannel === "dev" || releaseChannel === "local"
const readImage = createMemo<ReadMarkdownImage>(() => {
const dir = directory()
@@ -208,6 +210,7 @@ export function SessionUIProvider(
directory={directory()}
sessionID={params.id}
agents={settings.visibility.customAgents()}
copyAlwaysVisible={copyAlwaysVisible}
shellRunning={(id) => !!data.shell.get(id)}
shellOutput={(input) => serverSDK.api.shell.output(input)}
readMedia={(uri, mime, signal) => serverSDK.media.load(uri, mime, signal)}
@@ -582,10 +582,20 @@
justify-content: flex-start;
gap: 4px;
/* Hover actions show and hide at once, without a fade. */
/* Production keeps the whole footer hover-only. Dev channels keep the copy control visible and
hide only the metadata. Keeping the metadata in flow means the copy control does not move. */
@media (hover: hover) {
opacity: 0;
pointer-events: none;
&:not([data-copy-always-visible]) {
opacity: 0;
pointer-events: none;
}
}
&[data-copy-always-visible] [data-slot="text-part-meta"] {
@media (hover: hover) {
opacity: 0;
pointer-events: none;
}
}
[data-component="tooltip-v2-trigger"] {
@@ -663,6 +673,12 @@
opacity: 1;
pointer-events: auto;
}
&:hover [data-slot="text-part-copy-wrapper"][data-copy-always-visible] [data-slot="text-part-meta"],
&:focus-within [data-slot="text-part-copy-wrapper"][data-copy-always-visible] [data-slot="text-part-meta"] {
opacity: 1;
pointer-events: auto;
}
}
[data-timeline-row="AssistantPart"][data-timeline-spacing="content"] [data-component="text-part"] {
+5
View File
@@ -72,6 +72,8 @@ export const {
sessionID?: string
/** Whether message meta names the agent; the app follows its Show agent setting. Defaults to true. */
agents?: boolean
/** Whether the assistant copy control stays visible at rest; the app enables this on dev/local builds. */
copyAlwaysVisible?: boolean
shellRunning?: (id: string) => boolean
shellOutput?: (input: ShellOutputInput) => Promise<ShellOutputOutput>
turnDiff?: TurnDiffSource
@@ -95,6 +97,9 @@ export const {
get agents() {
return props.agents ?? true
},
get copyAlwaysVisible() {
return props.copyAlwaysVisible === true
},
get backgroundCompaction() {
return props.backgroundCompaction === true
},
@@ -1213,7 +1213,11 @@ export function AssistantTextContent(props: {
function copyFooter() {
return (
<div data-slot="text-part-copy-wrapper" data-interrupted={interrupted() ? "" : undefined}>
<div
data-slot="text-part-copy-wrapper"
data-interrupted={interrupted() ? "" : undefined}
data-copy-always-visible={data.copyAlwaysVisible ? "" : undefined}
>
<MessageActionButton
icon={copy.copied() ? "check" : "copy"}
size="small"