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

Open
#3,121 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
markdown
Domain
desktop, frontend

Research direction

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.

Written by the indexing model from the issue text.

Description

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 属性档,该档允许 whiteSpacewordBreakoverflowWrap(枚举包含 pre-wrap / anywhere / break-word),也就是说如果行内代码归属于这两个 part 之一,用户可以通过外观包从样式层缓解该问题。但目前注册表没有暴露行内代码的 part 归属,用户侧无法确认。

Dominant language
Rust
Stars
2.3k
Forks
236
Avg merge
2h 59m
Merged PRs (30d)
598

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GCWing/OpenBitFun

All issues in GCWing/OpenBitFun

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.