feat(ask): float, drag, or collapse the blocking question card - #623
Open
yunsheng111 wants to merge 1 commit into
Open
feat(ask): float, drag, or collapse the blocking question card#623yunsheng111 wants to merge 1 commit into
yunsheng111 wants to merge 1 commit into
Conversation
The ask_user_question card sits over the composer and squeezes the message list. Let the user reclaim the panel: - Float: detach the card into a viewport-fixed, draggable mini window via createPortal, clamped to the window on every move. - Collapse: shrink the live card to its header with a chevron; keep the pending question visible so an agent blocked on an answer is never hidden outright. - Both states survive a question-set swap on the same instance, and are skipped in the read-only/answered view. - 13 locales gain collapse/expand/float/dock strings. Refs: xintaofei#285
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.
feat(ask): float, drag, or collapse the blocking question card
Closes #622 (extends the earlier #285 "挡字" fix)
问题
#285 关闭后,提问卡被限制为
max-h-[88svh]+ 内部滚动,但卡片仍悬浮在输入框上方,挤压消息列表的可见区域。长对话中用户看不到自己正在回复的消息流,且卡片没有任何收起/移开的手段,只能等 Agent 提交或跳过。改动
AskQuestionCard新增两个互不影响的布局控制,把面板空间交还给用户:createPortal把卡片从消息流取出,变成视口固定、可拖拽的迷你窗口;拖拽全程按 8px 安全边距 clamp 在视口内,setPointerCapture保证拖出卡片不丢事件;再点一次停回面板。细节:
collapse / expand / float / dock文案;验证
vitest run src/components/chat/ask-question-card.test.tsx→ 30/30 passedcore.autocrlf工作树行尾,提交内容无 CRLF变更文件
src/components/chat/ask-question-card.tsx(+~280 行:折叠/浮窗/拖拽)src/components/chat/ask-question-card.test.tsx(+115 行)src/i18n/messages/{ar,de,en,es,fr,ja,ko,pt,zh-CN,zh-TW}.json(每语言 +4 键)讨论点
若作者更倾向只做折叠、或把浮窗改成侧边栏挂靠,可以本 PR 为起点调整。