feat(input): 支持顶部拖拽缩放输入框【已审核 PR】 - #2033
Draft
Andreaseszhang wants to merge 1 commit into
Draft
Conversation
Made-with: Proma
Andreaseszhang
marked this pull request as draft
September 9, 2026 07:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
为 Agent 与 Chat 的输入框增加仅通过顶部边缘进行的拖拽缩放能力。高度按 Agent 会话与 Chat 对话分别持久化;输入框总高度始终受真实可用空间与对话 viewport 60% 的较小值限制,避免挤压消息区。
改动
apps/electron/src/renderer/components/ai-elements/composer-resize.ts— 新增共享的高度上限、拖拽高度、持久化键和安全 localStorage 读写逻辑。apps/electron/src/renderer/components/ai-elements/resizable-composer.tsx— 新增useComposerResize,处理顶部 Pointer 拖拽、Pointer Capture、失焦/取消/卸载清理、ResizeObserver 重约束与拖后 TipTap 焦点恢复。apps/electron/src/renderer/components/agent/AgentView.tsx— 接入 Agent 会话级 composer 拖拽、内部 chrome 滚动和实际消息视图区测量。apps/electron/src/renderer/components/chat/ChatInput.tsx、apps/electron/src/renderer/components/chat/ChatView.tsx— 接入 Chat 对话级 composer 拖拽及 viewport / 消息区域标记。apps/electron/src/renderer/components/ai-elements/rich-text-input.tsx— 增加显式fillHeight高度链,确保放大后 TipTap 的可见编辑区均可点击落光标。docs/plans/2026-09-09-resizable-chat-composer.md— 记录实现边界与验证路径。测试方法
bun run --cwd apps/electron typecheck。bun run --cwd apps/electron build:renderer。备注
Made with Proma · GitHub