Skip to content

[0137] 调整AI对话输入框默认高度为三行并支持自适应延伸#3395

Merged
da-liii merged 2 commits into
mainfrom
da/0137/input
May 18, 2026
Merged

[0137] 调整AI对话输入框默认高度为三行并支持自适应延伸#3395
da-liii merged 2 commits into
mainfrom
da/0137/input

Conversation

@da-liii
Copy link
Copy Markdown
Contributor

@da-liii da-liii commented May 18, 2026

摘要

调整 Chat Tab 输入框的默认高度和自适应行为:

  • 默认高度从固定一行改为三行(kInputDefaultLines = 3
  • 支持根据段落数自适应向上延伸,最大 10 行
  • 通过 QTimer 轮询文档段落数,动态调整输入框高度
  • 修复默认状态下高度被内部编辑器撑大的问题(同时约束 min/max 高度)
  • 减小输入框内部段落间距(par-par-sep 从默认 0.5fns 降至 0.05fn

已知限制

当前通过段落数(DOCUMENT 子节点数)估算高度,因此:

  • 按回车键创建新段落时高度能正确增加
  • 粘贴不带换行的长文本时,高度不会随视觉行数自动增加

测试

  • 本地构建通过 xmake b stem
  • 启动后新建 Chat 标签页,输入框默认高度为三行
  • 连续按回车键,输入框高度向上延伸
  • 删除内容后高度相应收缩

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

[0137] 调整AI对话输入框高度为默认两行并支持自适应延伸

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

wip

wip

[0137] 修复新建聊天时输入框默认高度不为两行的问题

在创建输入框时同时设置 minimumHeight 和 maximumHeight,
确保默认空文档状态下高度严格固定为两行。
同时调整 adjust_input_height 使其同步更新 max 高度,
并补上了 kInputMaxLines 的上限限制。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

[0137] 更新任务文档:默认高度调整为三行

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

[0137] 将输入框默认高度从两行改为三行

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

[0137] 更新任务文档:行高从22像素调整为18像素

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

[0137] 将输入框行高从22像素减小为18像素

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

[0137] 更新任务文档:行高恢复为22像素

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

[0137] 将输入框行高恢复为22像素

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

[0137] 减小输入框内部文档的行间距

通过 WITH 节点将 input-buffer 的 par-sep 从默认 0.2fn 降至 0.05fn。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

[0137] 将行间距属性从 par-sep 修正为 par-par-sep

输入框中段落间距由 par-par-sep 控制,而非 par-sep。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

[0137] 更新任务文档:添加已知限制说明

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

[0137] 格式化代码

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@da-liii da-liii merged commit 5003c66 into main May 18, 2026
5 checks passed
@da-liii da-liii deleted the da/0137/input branch May 18, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants