desktop: code blocks hide horizontal scrollbars and cannot wrap long lines
维护者通常 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
- Ask the assistant to output a fenced code block with a very long single line (e.g. 2000+ characters).
- Look at the right edge of the code block.
- 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
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
anomalyco/opencode 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
anomalyco/opencode#60174 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
anomalyco/opencode#60121 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
anomalyco/opencode#59973 · 1 条评论 ·
维护者通常 1 天内回复
-
triaging
难度 2/5 1-3 小时 新手友好度 72/100
anomalyco/opencode#59942 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
anomalyco/opencode#59886 · 1 条评论 ·
维护者通常 1 天内回复
查看 anomalyco/opencode 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
CopilotKit/openmuse#215 ·
维护者通常 3 天内回复
-
b:minor bug
难度 2/5 1-3 小时 新手友好度 76/100
software-mansion/argent#1698 ·
维护者通常 1 天内回复
-
e2e-failure ready-to-code
难度 2/5 1-3 小时 新手友好度 72/100
redhat-developer/rhdh-plugin-export-overlays#4624 · 1 条评论 ·
维护者通常 1 天内回复