画布agent交互优化 #105

Merged
kdletters merged 20 commits from editor-agent-improve-interaction into master 2026-07-28 15:22:50 +08:00
Member

输入框尺寸根据输入内容调整高度,达到最大高度后再出现翻页条。
before:
shotmd-1784699696.jpg
after:
shotmd-1784699381.jpg
shotmd-1784699431.jpg

调整对话切换角标样式
before:
shotmd-1784699673.jpg
after:
shotmd-1784699465.jpg

新建对话按钮禁用 当已在一个新对话中

输入框尺寸根据输入内容调整高度,达到最大高度后再出现翻页条。 before: ![shotmd-1784699696.jpg](/attachments/20491333-efe9-44f3-ba6c-1d84579473b2) after: ![shotmd-1784699381.jpg](/attachments/6018e4e1-6ccc-4de7-92de-5d3f5fb43846) ![shotmd-1784699431.jpg](/attachments/8e91351e-29a5-4220-a7e2-e09554b00935) 调整对话切换角标样式 before: ![shotmd-1784699673.jpg](/attachments/7c3470ab-6f7d-4aa8-9660-4db8e942bd28) after: ![shotmd-1784699465.jpg](/attachments/e8342741-c1a4-4669-9ad4-c8b34cfeaf30) 新建对话按钮禁用 当已在一个新对话中
k88936 added 4 commits 2026-07-22 12:22:08 +08:00
fix: always keep draft
Project CI / Frontend tests (pull_request) Successful in 1m33s
Project CI / Repository checks (pull_request) Successful in 2m36s
Project CI / Native shell tests (pull_request) Successful in 8m2s
Project CI / Backend tests (pull_request) Successful in 8m28s
3815aa4353
k88936 requested review from kdletters 2026-07-22 13:07:49 +08:00
Member

前端修改可以加点图片看看改动前后的差异

前端修改可以加点图片看看改动前后的差异
Member

[P1] 创建或切换会话未完成时仍能发送。发送按钮 (line 716) 未检查 isCreatingConversation / isLoadingMessages:
新建 pending 时会把草稿发进旧会话,随后又切到新空会话。
历史会话加载时,hook 会静默跳过发送 (line 410),但面板已清空草稿和附件,内容直接丢失。

[P2] 新建期间下拉仍可操作。禁用条件 (line 313) 未包含 isCreatingConversation;用户后选的历史会话会被迟到的创建回包再次覆盖。

[P2] 输入框没有旧浏览器降级。实现 (line 700) 仅依赖 field-sizing: content。默认 Browserslist 仍包含 Safari/iOS 18.5–18.7,而 WebKit 到 Safari 26.2 才加入该属性。模拟不支持时,五行草稿始终只有 40px 高,与 PR 文档要求的自动增长不符。

[P1] 创建或切换会话未完成时仍能发送。[发送按钮 (line 716)](/home/dsk/.codex/worktrees/9450/Genarrative/src/components/image-editor/EditorAgentConversation/EditorAgentConversationPanelView.tsx:716) 未检查 isCreatingConversation / isLoadingMessages: 新建 pending 时会把草稿发进旧会话,随后又切到新空会话。 历史会话加载时,[hook 会静默跳过发送 (line 410)](/home/dsk/.codex/worktrees/9450/Genarrative/src/components/image-editor/EditorAgentConversation/useEditorAgentConversation.ts:410),但面板已清空草稿和附件,内容直接丢失。 [P2] 新建期间下拉仍可操作。[禁用条件 (line 313)](/home/dsk/.codex/worktrees/9450/Genarrative/src/components/image-editor/EditorAgentConversation/EditorAgentConversationPanelView.tsx:313) 未包含 isCreatingConversation;用户后选的历史会话会被迟到的创建回包再次覆盖。 [P2] 输入框没有旧浏览器降级。[实现 (line 700)](/home/dsk/.codex/worktrees/9450/Genarrative/src/components/image-editor/EditorAgentConversation/EditorAgentConversationPanelView.tsx:700) 仅依赖 field-sizing: content。默认 Browserslist 仍包含 Safari/iOS 18.5–18.7,而 [WebKit 到 Safari 26.2 才加入该属性](https://webkit.org/blog/17640/webkit-features-for-safari-26-2/)。模拟不支持时,五行草稿始终只有 40px 高,与 PR 文档要求的自动增长不符。
k88936 added 2 commits 2026-07-22 14:39:01 +08:00
fix: extract draft input box to EditorAgentDraftTextarea component for unified handling of auto-sizing and add fallback behavior
Project CI / Repository checks (pull_request) Successful in 3m11s
Project CI / Native shell tests (pull_request) Successful in 7m9s
Project CI / Backend tests (pull_request) Successful in 7m59s
Project CI / Frontend tests (pull_request) Successful in 6m15s
c864dfc05e
k88936 added 1 commit 2026-07-22 18:08:23 +08:00
Merge branch 'master' into editor-agent-improve-interaction
Project CI / Repository checks (pull_request) Successful in 1m2s
Project CI / Frontend tests (pull_request) Successful in 40s
Project CI / Native shell tests (pull_request) Successful in 2m21s
Project CI / Backend tests (pull_request) Successful in 3m5s
a5c43e8743
# Conflicts:
#	src/components/image-editor/EditorAgentConversation/EditorAgentConversationPanelView.test.tsx
k88936 added 1 commit 2026-07-23 10:12:00 +08:00
Merge branch 'master' into editor-agent-improve-interaction
Project CI / Frontend tests (pull_request) Successful in 40s
Project CI / Repository checks (pull_request) Successful in 53s
Project CI / Native shell tests (pull_request) Successful in 3m36s
Project CI / Backend tests (pull_request) Successful in 3m37s
c6d98ebd5c
Member

[P2] 静默 refresh 仍可能覆盖新建会话
useEditorAgentConversation.ts (line 237) 的 loadConversation 只校验自己的 request id;createConversation (line 329) 成功后不会让旧 load 失效。路径还是:A 会话 job 完成触发 silent refresh,用户新建 B,B 先返回切 active,A 的 refresh 后返回又 applyConversationDetail(A) 把 active 改回 A。会话刷新是否传递会话ID?

[P2] textarea fallback 仍少算 2px border
EditorAgentDraftTextarea.tsx (line 20) 仍把 scrollHeight 直接写到 border-box 的 style.height。真实 Chromium 复测两行:styleHeight=56px / clientHeight=54 / scrollHeight=56 / overflowY=hidden,底部仍会被裁 2px。应把 offsetHeight - clientHeight 的边框差计入高度,测试也该断 overflowY=hidden 时 scrollHeight <= clientHeight。

[P2] 静默 refresh 仍可能覆盖新建会话 [useEditorAgentConversation.ts (line 237)](/home/dsk/.codex/worktrees/9450/Genarrative/src/components/image-editor/EditorAgentConversation/useEditorAgentConversation.ts:237) 的 loadConversation 只校验自己的 request id;[createConversation (line 329)](/home/dsk/.codex/worktrees/9450/Genarrative/src/components/image-editor/EditorAgentConversation/useEditorAgentConversation.ts:329) 成功后不会让旧 load 失效。路径还是:A 会话 job 完成触发 silent refresh,用户新建 B,B 先返回切 active,A 的 refresh 后返回又 applyConversationDetail(A) 把 active 改回 A。会话刷新是否传递会话ID? [P2] textarea fallback 仍少算 2px border [EditorAgentDraftTextarea.tsx (line 20)](/home/dsk/.codex/worktrees/9450/Genarrative/src/components/image-editor/EditorAgentConversation/EditorAgentDraftTextarea.tsx:20) 仍把 scrollHeight 直接写到 border-box 的 style.height。真实 Chromium 复测两行:styleHeight=56px / clientHeight=54 / scrollHeight=56 / overflowY=hidden,底部仍会被裁 2px。应把 offsetHeight - clientHeight 的边框差计入高度,测试也该断 overflowY=hidden 时 scrollHeight <= clientHeight。
k88936 added 1 commit 2026-07-23 13:52:35 +08:00
fix: textarea fallback 高度加入 offsetHeight - clientHeight 的边框差,溢出判断也改用完整 border-box 高度。
Project CI / Backend tests (pull_request) Failing after 11s
Project CI / Repository checks (pull_request) Failing after 12s
Project CI / Frontend tests (pull_request) Successful in 30s
Project CI / Native shell tests (pull_request) Successful in 1m59s
62bbd3876a
k88936 added 1 commit 2026-07-23 13:54:00 +08:00
fix: prevent silent refresh from overwriting newly created conversations in EditorAgentConversation
Project CI / Repository checks (pull_request) Failing after 11s
Project CI / Backend tests (pull_request) Failing after 11s
Project CI / Frontend tests (pull_request) Successful in 32s
Project CI / Native shell tests (pull_request) Successful in 2m25s
6ab64efb4a
k88936 added 1 commit 2026-07-23 13:54:13 +08:00
Merge branch 'master' into editor-agent-improve-interaction
Project CI / Repository checks (pull_request) Successful in 51s
Project CI / Frontend tests (pull_request) Successful in 36s
Project CI / Native shell tests (pull_request) Successful in 2m8s
Project CI / Backend tests (pull_request) Successful in 3m45s
5d1cb4f0ed
k88936 added 1 commit 2026-07-23 15:06:55 +08:00
Merge branch 'master' into editor-agent-improve-interaction
Project CI / Frontend tests (pull_request) Successful in 44s
Project CI / Repository checks (pull_request) Successful in 58s
Project CI / Native shell tests (pull_request) Successful in 2m22s
Project CI / Backend tests (pull_request) Failing after 36s
887bab384a
k88936 added 1 commit 2026-07-23 15:44:11 +08:00
Merge branch 'master' into editor-agent-improve-interaction
Project CI / Repository checks (pull_request) Successful in 59s
Project CI / Frontend tests (pull_request) Successful in 1m35s
Project CI / Native shell tests (pull_request) Successful in 3m2s
Project CI / Backend tests (pull_request) Successful in 3m54s
91493aa330
k88936 added 1 commit 2026-07-24 10:14:18 +08:00
Merge branch 'master' into editor-agent-improve-interaction
Project CI / Frontend tests (pull_request) Successful in 2m34s
Project CI / Repository checks (pull_request) Successful in 2m57s
Project CI / Native shell tests (pull_request) Successful in 3m16s
Project CI / Backend tests (pull_request) Successful in 4m24s
611335b884
k88936 added 2 commits 2026-07-24 18:04:46 +08:00
fix: refresh can cancel an in-flight activation
Project CI / Repository checks (pull_request) Successful in 1m29s
Project CI / Frontend tests (pull_request) Successful in 2m31s
Project CI / Backend tests (pull_request) Successful in 3m32s
Project CI / Native shell tests (pull_request) Successful in 2m57s
6d604999be
kdletters added this to the 美术画布 project 2026-07-24 20:17:09 +08:00
kdletters modified the project from 美术画布 to 美术Agent 2026-07-24 20:17:19 +08:00
k88936 was assigned by kdletters 2026-07-24 20:17:26 +08:00
k88936 added 1 commit 2026-07-27 10:26:09 +08:00
Merge branch 'master' into editor-agent-improve-interaction
Project CI / Repository checks (pull_request) Successful in 56s
Project CI / Frontend tests (pull_request) Successful in 2m3s
Project CI / Backend tests (pull_request) Successful in 3m47s
Project CI / Native shell tests (pull_request) Successful in 2m36s
b907c48e85
kdletters requested changes 2026-07-28 11:48:07 +08:00
Dismissed
kdletters left a comment
Member

[P2] 请求 ID 会碰撞,旧刷新可能提前结束新会话切换的加载态。useEditorAgentConversation.ts (line 237) 在 refresh 被 activation 压制时生成 ID 却不登记;紧接着再次切换会复用这个 ID。旧 refresh 返回后,第 278 行 (line 278) 会把仍在进行的切换错误地标记为加载完成。顺序是:A → 切 B → 刷新 A → 切 C → 刷新先返回。此时用户可以发送,消息仍会发到旧会话 A。现有测试只覆盖两请求,没有覆盖这组三请求交错。

IME 还有旧版 Safari/WebKit 兼容缺口:EditorAgentDraftTextarea.tsx (line 89) 只检查 isComposing。旧 WebKit 在候选词确认时可能返回 false,通常还需兼容 keyCode === 229。该行为原本就在 master,不算 PR 105 引入的回归;WebKit 已于 2026 年 4 月修复并回灌 Safari 分支,但旧客户端仍受影响。WebKit 165004修复 311717

[P2] 请求 ID 会碰撞,旧刷新可能提前结束新会话切换的加载态。[useEditorAgentConversation.ts (line 237)](http://192.168.35.82/git/GenarrativeAI/Genarrative/home/dsk/.codex/worktrees/9450/Genarrative/src/components/image-editor/EditorAgentConversation/useEditorAgentConversation.ts:237) 在 refresh 被 activation 压制时生成 ID 却不登记;紧接着再次切换会复用这个 ID。旧 refresh 返回后,[第 278 行 (line 278)](http://192.168.35.82/git/GenarrativeAI/Genarrative/home/dsk/.codex/worktrees/9450/Genarrative/src/components/image-editor/EditorAgentConversation/useEditorAgentConversation.ts:278) 会把仍在进行的切换错误地标记为加载完成。顺序是:A → 切 B → 刷新 A → 切 C → 刷新先返回。此时用户可以发送,消息仍会发到旧会话 A。现有测试只覆盖两请求,没有覆盖这组三请求交错。 IME 还有旧版 Safari/WebKit 兼容缺口:[EditorAgentDraftTextarea.tsx (line 89)](http://192.168.35.82/git/GenarrativeAI/Genarrative/home/dsk/.codex/worktrees/9450/Genarrative/src/components/image-editor/EditorAgentConversation/EditorAgentDraftTextarea.tsx:89) 只检查 isComposing。旧 WebKit 在候选词确认时可能返回 false,通常还需兼容 keyCode === 229。该行为原本就在 master,不算 PR 105 引入的回归;WebKit 已于 2026 年 4 月修复并回灌 Safari 分支,但旧客户端仍受影响。[WebKit 165004](https://bugs.webkit.org/show_bug.cgi?id=165004)、[修复 311717](https://bugs.webkit.org/show_bug.cgi?id=311717)。
k88936 added 2 commits 2026-07-28 12:09:55 +08:00
fix: IME 判断增加 keyCode !== 229
Project CI / Repository checks (pull_request) Failing after 10s
Project CI / Backend tests (pull_request) Failing after 10s
Project CI / Frontend tests (pull_request) Successful in 1m40s
Project CI / Native shell tests (pull_request) Successful in 2m12s
e145d031c0
k88936 added 1 commit 2026-07-28 12:10:26 +08:00
Merge branch 'master' into editor-agent-improve-interaction
Project CI / Repository checks (pull_request) Successful in 52s
Project CI / Frontend tests (pull_request) Successful in 1m42s
Project CI / Native shell tests (pull_request) Successful in 2m12s
Project CI / Backend tests (pull_request) Successful in 2m53s
b1bcd7bf5e
k88936 requested review from kdletters 2026-07-28 12:18:01 +08:00
kdletters scheduled this pull request to auto merge when all checks succeed 2026-07-28 15:21:59 +08:00
kdletters approved these changes 2026-07-28 15:22:48 +08:00
kdletters merged commit 78e6959ca4 into master 2026-07-28 15:22:50 +08:00
kdletters deleted branch editor-agent-improve-interaction 2026-07-28 15:22:50 +08:00
Sign in to join this conversation.