Register Sources as action component#109638
Conversation
Jetpack Cloud Live (direct link)
Automattic for Agencies Live (direct link)
Dashboard Live (dotcom) (direct link)
|
463c246 to
a59dc2f
Compare
|
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
|
Correct me if I'm wrong, but I'm not sure we need the component-type message action. Most actions follow a button-based design (e.g., ChatGPT, Gemini, Claude). The sources UI feels like a common feature and more of an info-related element than an action. It might make sense to include it directly in the WDYT? |
|
Alright, that's better than leaving the bug there. I'll test and review the PRs tmr. |

Fixes AI-927
Summary
SourcesDisplayfrom being injected into message content (viaextractSourcesFromContent) to being registered as atype: 'component'message action via a newuseSourcesActionhookposition: absoluteCSS hack that caused the sources panel to overlap subsequent messages when expanded mid-conversationMotivation
The
SourcesDisplaycomponent usedposition: absoluteto visually align with the feedback action icons. This worked for the last message but broke mid-conversation — the expanded panel overlapped messages below it. By registering Sources as a component action, it participates in normal document flow and the overlap issue is resolved.Changes
use-sources-action.ts— hook that registersSourcesDisplayas a component action on agent messages with sources dataorchestrator-chat/index.tsx— wiresuseSourcesActionconvert-tool-messages-to-components.ts— removedextractSourcesFromContent; sources data blocks now pass through untouched (read by the hook instead)Test plan
Depends on 312-ghe-Automattic/agenttic
cd apps/agents-manager && yarn dev --sync?agent=wpcom-workflow-support_chatto the URLPre-merge Checklist