refactor(chat): render user messages through the message registry
What does this MR do?
Follow-up MR: feat(chat): export UserMessage and let a sub-ty... (!696 - merged)
It moves user message rendering to its own Vue component and register it in the Message Registry. This refactoring enables two capabilities needed to display /goal messages:
- Providing a custom design to display user messages that start a
/goalflow. - Still relying the built-in user message component for the overall design but adding a few decorations on top.
This MR removes the message_user.vue component because it was dead code. duo_chat_message.vue was capturing both classic AND agentic chat user messages.
Supporting fixes in MessageMap
- Relax the
messagevalidator to acceptmessage_typeorrole. Classic chat user turns carry nomessage_typeand would trip a prop warning. - Declare and forward
get-context-item-contentandopen-file-path.open-file-pathwas a latent bug:duo_chat_message.vuealready listened for it, butMessageMapnever declared or re-emitted it, so it worked accidentally under Vue 3 (listeners land in$attrs) and was dead under Vue 2.
Behaviour change
Direct MessageMap consumers see a different user bubble. message_user.vue itself was never exported, but MessageMap is part of the public API, and rendering a user message through it directly previously produced the orphaned full-width gl-bg-blue-100 bar. It now produces the same right-aligned bubble the chat UI has always shown. This is a consistency fix rather than a regression — the old bar was unreachable from DuoChatMessage — but it is the one consumer-visible rendering change here.
Screenshots or screen recordings
See visual screenshot changes in this MR.
Testing
- Full suite green on both Vue versions (
yarn test:unitandyarn test:unit-vue3), 2471 passing. - New
message_user_prompt.spec.jscovers the ported user-specific cases plus content precedence, streaming/smooth, and theget-context-item-contentpayload. duo_chat_message.spec.jsis re-based onto an assistant default message, with a newuser messagesblock asserting delegation,gl-pl-7, scopedtrustedUrls, event proxying, and that an errored user message still renders the error box.message_registry.spec.jscovers both user shapes, case-insensitivity, and that a host descriptor can now override the built-in user renderer — the capability this unlocks.
Integration merge requests
No public API change: message_user.vue was exported from neither src/index.js nor message_types/index.js.
- GitLab: n/a
- CustomersDot: n/a
- Status Page: n/a