Skip to content

[UI] Message column width is hardcoded to 960px and its resize handle is hidden #27

Closed as duplicate

Description

@Yum-wu

现象 / What happens

DS Bot 会话里,消息列宽度被钉死在 960px,没有经典 agent 模式那样的可拖动条纹;输入框也不能跟着变宽。

In a DS Bot conversation the message column is pinned to 960px and the draggable resize handles that plain agent mode shows are absent.

根因 / Cause

三处都在生成的 client.js 里(单文件 bundle,可用 grep -n 直接定位):

1. 把手被无条件隐藏 — client.js:2100

[class*="_widthHandle"]{display:none!important}

2. 列宽变量被钉死 — client.js:2401

[class*="_body"]:has(> [class*="_scrollBody"]){--dsh-chat-content-width:min(960px,100%)}

--dsh-chat-content-width 是 DSH 用来限制正文列宽的变量(会话列 max-width:var(--dsh-chat-content-width)),
DSH 自己的默认值是 748px,并且拖动把手时会改写它。DS Bot 这一条把它固定成 min(960px,100%)。

3. 输入框跟着写死 — client.js:2451

[class*="_root"]:has(> [data-composer-card])>[data-composer-card]{max-width:min(992px,100%)!important}

992 = 960 + 32,对应 DSH 的设计关系 --dsh-composer-card-max-width: calc(var(--dsh-chat-content-width) + 32px)
(输入框比正文列每边宽 16px)。这个 992 是常量,列宽一变就对不齐。

影响 / Impact

  • 宽屏上正文列固定在 960px,两侧留白浪费,用户无法自行调整。
  • 因为 (3) 是常量,即使用户自定义 CSS 把列宽改大,输入框也不会跟随,两者中心错位。

建议 / Suggested change

  1. 不再隐藏把手(或至少给一个开关)。
  2. 让 --dsh-chat-content-width 用 DSH 默认值 / 拖动后的值,而不是 min(960px,100%)。
  3. 把 992px 换成 calc(var(--dsh-chat-content-width,748px) + 32px),与 DSH 的 --dsh-composer-card-max-width 一致。

本地按这三条改过(4 处,含把手显隐),Playwright 实测:
默认列宽 1120 / 输入框 1152,中心偏差 0px;拖动把手后两者同步跟随。

环境 / Environment

DS Bot 0.1.0
DSH 0.2.0-rc.2
Surface DSH Web (Chrome, 1536 CSS px)
OS win32 x64

No API keys, tokens or personal data in this report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions