You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Sticky code block header (language + copy button) while scrolling long code #53519
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement
When an assistant message contains a long code block (desktop/web UI), the copy button sits at the top of the block and only appears on hover, so it is gone by the time you scroll down through the code.
Request: a slim sticky header on each code block (language label on the left, always-visible copy button on the right) that stays pinned while scrolling through tall code, like ChatGPT's code header. No height cap — the block still extends fully. Benefit: the user can copy at any scroll position without scrolling back up, and the language label is always visible.
System info / reproduce
macOS 27.0, desktop app (dev build from dev), opencode 1.18.34. Repro: open any session, render a code block taller than the viewport, scroll down — the copy button scrolls away with the top of the block.
Related, but that issue asked for hover-or-sticky on the button alone, was auto-closed for template non-compliance, and never resolved. This request goes further (a full header strip with the language label, always visible) and I have a PR implementing it — it supersedes rather than duplicates #28942.
Please use the Bug Report issue template. The current description has useful details, but it doesn’t include the template fields; please also add relevant system and app/browser version information to help reproduce the issue.
Please edit this issue to address the above within 72 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
#28942: Reports that the copy button on long code blocks is difficult to reach and requests hover or sticky behavior.
If you believe this was flagged incorrectly, please let a maintainer know.
changed the title [-]Code block copy button scrolls away in long code blocks[/-][+][FEATURE]: Sticky code block header (language + copy button) while scrolling long code[/+]on Oct 6, 2026
Updating this issue to follow the Feature Request template so it is not auto-closed:
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement: When an assistant message contains a long code block (desktop/web UI), the copy button sits at the top of the block and only appears on hover, so it is gone by the time you scroll down through the code. Request: a slim sticky header on each code block (language label + always-visible copy button) that stays pinned while scrolling through tall code, like ChatGPT's code header. No height cap — the block still extends fully.
System info: macOS 27.0, desktop app (dev build from dev), opencode 1.18.34. Repro: open any session, render a code block taller than the viewport, scroll down — the copy button scrolls away with the top of the block.
On the flagged duplicate #28942: related, but that issue asked for hover-or-sticky on the button alone, was auto-closed for template non-compliance, and never resolved. This request goes further (a full header strip with the language label, always visible) and I have a PR implementing it: it supersedes rather than duplicates #28942.
Thanks for adding the Feature Request details, verification checkbox, and system/reproduction information. The issue description itself still contains only the original one-line request. Please move the template content into the issue description so the issue uses the required template.
Thanks for the detailed request, @imsoul11! You're asking for a slim sticky header on code blocks in the desktop/web UI, with the language label on the left and an always-visible copy button on the right. It would stay pinned while you scroll through a tall block, so you can copy from anywhere without scrolling back up.
In the current code the copy button sits at the top of each block and only appears on hover, so what you see is how it was built. That makes this an improvement rather than a bug. Maintainers will consider it, and your PR will help with that.
One small thing: the issue says opencode 1.18.34, which is a v1 version, but a desktop build from dev is v2. Could you check the version your desktop app shows? If it really is 1.x, please note that v1 only gets critical fixes.
Thanks for the review! Checked: this checkout's packages/desktop/package.json, packages/app/package.json and packages/opencode/package.json are all version 1.18.34 on dev — so the reported version is correct for a dev build from this tree. Happy to re-verify against a different version if maintainers want that.
Activity
github-actions commentedon Oct 6, 2026
This issue doesn’t fully meet our contributing guidelines.
What needs to be fixed:
Please edit this issue to address the above within 72 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
If you believe this was flagged incorrectly, please let a maintainer know.
[-]Code block copy button scrolls away in long code blocks[/-][+][FEATURE]: Sticky code block header (language + copy button) while scrolling long code[/+]imsoul11 commentedon Oct 6, 2026
Updating this issue to follow the Feature Request template so it is not auto-closed:
Describe the enhancement: When an assistant message contains a long code block (desktop/web UI), the copy button sits at the top of the block and only appears on hover, so it is gone by the time you scroll down through the code. Request: a slim sticky header on each code block (language label + always-visible copy button) that stays pinned while scrolling through tall code, like ChatGPT's code header. No height cap — the block still extends fully.
System info: macOS 27.0, desktop app (dev build from
dev), opencode 1.18.34. Repro: open any session, render a code block taller than the viewport, scroll down — the copy button scrolls away with the top of the block.On the flagged duplicate #28942: related, but that issue asked for hover-or-sticky on the button alone, was auto-closed for template non-compliance, and never resolved. This request goes further (a full header strip with the language label, always visible) and I have a PR implementing it: it supersedes rather than duplicates #28942.
github-actions commentedon Oct 6, 2026
Thanks for adding the Feature Request details, verification checkbox, and system/reproduction information. The issue description itself still contains only the original one-line request. Please move the template content into the issue description so the issue uses the required template.
github-actions commentedon Oct 6, 2026
Thanks for updating the issue with the Feature Request template, verification checkbox, and system/reproduction details!
opencodejr commentedon Oct 27, 2026
Thanks for the detailed request, @imsoul11! You're asking for a slim sticky header on code blocks in the desktop/web UI, with the language label on the left and an always-visible copy button on the right. It would stay pinned while you scroll through a tall block, so you can copy from anywhere without scrolling back up.
In the current code the copy button sits at the top of each block and only appears on hover, so what you see is how it was built. That makes this an improvement rather than a bug. Maintainers will consider it, and your PR will help with that.
One small thing: the issue says
opencode 1.18.34, which is a v1 version, but a desktop build fromdevis v2. Could you check the version your desktop app shows? If it really is 1.x, please note that v1 only gets critical fixes.Related:
imsoul11 commentedon Oct 28, 2026
Thanks for the review! Checked: this checkout's
packages/desktop/package.json,packages/app/package.jsonandpackages/opencode/package.jsonare all version1.18.34ondev— so the reported version is correct for a dev build from this tree. Happy to re-verify against a different version if maintainers want that.