Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

desktop: code blocks hide horizontal scrollbars and cannot wrap long lines

未关闭 适合新手
#60,143 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
70/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
css, typescript

调研方向

从 packages/session-ui/src/components/markdown.css 开始,issue 指出了隐藏 pre 块滚动条的样式。检查溢出的代码块如何设置样式,以及现有组件是否支持换行选项。完成标准是在桌面和 Web UI 中,都能通过可见的水平滚动条查看长行,或让长行自动换行;如果有相关样式和测试,也请检查。

由索引模型根据 Issue 内容生成。

描述

Description

Long single-line code in a fenced block is clipped at the viewport edge. The block scrolls horizontally, but the scrollbar is hidden by CSS:

pre {
  overflow: auto;
  scrollbar-width: none;
  &::-webkit-scrollbar { display: none; }
}

(packages/session-ui/src/components/markdown.css)

On Windows there is no visible affordance. The only ways to reach the rest of the line are Shift+wheel or selecting text and dragging. There is also no wrap option. A code block taller than the viewport loses its copy button while scrolling too (tracked separately in #53519).

This was reported in #49535, but that issue was closed as a v1 issue, not fixed.

Plugins

env-guard.ts, headroom-compress.ts, memory-inject.ts, modelscope-imagegen.ts (none related)

OpenCode version

2.2.1 desktop (bundled CLI 2.2.1), channel latest

Steps to reproduce
  1. Ask the assistant to output a fenced code block with a very long single line (e.g. 2000+ characters).
  2. Look at the right edge of the code block.
  3. No horizontal scrollbar appears; the overflow is only reachable with Shift+wheel or by selecting text and dragging.
Screenshot

No screenshot attached.

Operating System

Windows 11 Pro 10.0.26300 x64

Terminal

Desktop app

Expected Behavior
  • Show a horizontal scrollbar when the block overflows (always, or on hover/focus), and/or
  • Add a "wrap long lines" toggle for code blocks.

The same shared styles affect the web UI, so this is not desktop-only.

主要语言
TypeScript
星标
221k
派生
29.6k
平均合并
5 小时 32 分钟
30 天内合并 PR
492

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

anomalyco/opencode 的其他 Issue

查看 anomalyco/opencode 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。