You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
背景
插件在会话里加动作时,回答侧有官方槽位
conversation.chat.assistant-actions:插件注册后由 React 直接渲染,是一等公民,即时出现,不会被重渲染抹掉。但用户消息(user 行)没有对应的动作槽位。目前实时 Slot 树里,user 相关只有:
conversation.chat.user.content(factory,内容)conversation.chat.user.images(内容图片)conversation.chat.node的userkey(整体节点渲染,属于shadows-shipped-ui)没有
conversation.chat.user-actions这类动作位。现状与问题
插件想在用户消息上加动作(例如“编辑这条消息”),只能把按钮 DOM 注入到
[data-chat-flow-kind="user"]的动作条里。结果是:MutationObserver再补回去,视觉上会闪、会卡;useLayoutEffect、同步补注入、缓存等优化,也达不到官方按钮的稳定与即时。建议
为“用户消息”增加一个 list 槽位,例如
conversation.chat.user-actions:sessionlistid/order/label(与conversation.chat.assistant-actions一致)assistant-actions同构,至少能拿到sessionId、该消息的seq/messageId,以及当前会话的 hooks 上下文;本地回显/未落盘消息按现有语义处理这样插件动作就能像官方按钮一样由 React 渲染,不再需要 DOM 注入,不会延迟/闪烁,也不会随平台 DOM 调整而失效。
若短期不方便开放,至少希望能提供一个稳定的“用户消息动作条容器”槽位或公开插入点。
环境
conversation.chat.assistant-actions注册正常;用户消息动作只能注入,体验明显差一档All reactions