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

[Bug]: 聊天区超长行内代码横向溢出被裁切——既无折行也无横向滚动

已关闭
#3,121 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
markdown
领域
desktop, frontend

调研方向

Start at the markdown component registration and rendering paths for the codePre and codeContent parts, then reproduce the long inline-code case in the desktop chat message view. Compare it with the existing fenced-code scrolling behavior; done means long inline code remains fully viewable by wrapping or horizontal scrolling without regressing fenced code blocks.

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

描述

EN TL;DR — A long inline code span overflows the chat message container and gets clipped: there is no wrapping and no horizontal scrollbar, so the overflowing content is simply lost. Fenced code blocks in the same container scroll correctly, so this is specific to inline code.

环境

  • OpenBitFun 1.0.1 桌面版
  • Windows 10 22H2(19045)/ WebView2
  • 消息区宽度:默认(未调窄)

复现步骤

  1. 让模型输出一条包含超长行内代码的消息(例如一整条长路径、长命令或长标识符串,约 80 字符以上)
  2. 观察该行内代码的渲染结果

实际结果

行内代码横向溢出消息容器边界,超出部分被裁切——既看不到,也无法横向滚动查看。表现为:那一行文字在容器的右边缘处被硬切断,右侧没有出现任何滚动条,超出部分无法通过任何方式查看。

对照:同一容器中的围栏代码块表现正常(可以横向滚动),问题只出现在行内代码上。

预期行为

行内代码应在容器内折行,或至少提供横向滚动,不应静默丢失内容。

补充信息(供定位参考)

以下是从当前版本可查证的信息:

  • markdown 组件注册的 parts 共有 14 个,其中代码相关的是 codeBlock / codeToolbar / codeBody / codePre / codeContent,没有行内代码对应的 part;
  • 从渲染实现看,codePre 对应 <pre> 元素、codeContent 对应 <code> 元素;行内代码同样是 <code> 元素,其是否归属于 codeContent part 无法从 registry 或前端产物中确认;
  • 当前未给行内代码提供 overflow 兜底(既没有折行,也没有横向滚动),因此溢出内容既不可见也不可滚。

参考:外观包契约中 markdown 组件的 codeContent / codePre 属于 paint 属性档,该档允许 whiteSpace、wordBreak、overflowWrap(枚举包含 pre-wrap / anywhere / break-word),也就是说如果行内代码归属于这两个 part 之一,用户可以通过外观包从样式层缓解该问题。但目前注册表没有暴露行内代码的 part 归属,用户侧无法确认。

主要语言
Rust
星标
2.3k
派生
236
平均合并
3 小时 38 分钟
30 天内合并 PR
329

环境准备

从这里开始

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

GCWing/OpenBitFun 的其他 Issue

查看 GCWing/OpenBitFun 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

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