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:

  1. Providing a custom design to display user messages that start a /goal flow.
  2. 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 message validator to accept message_type or role. Classic chat user turns carry no message_type and would trip a prop warning.
  • Declare and forward get-context-item-content and open-file-path. open-file-path was a latent bug: duo_chat_message.vue already listened for it, but MessageMap never 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:unit and yarn test:unit-vue3), 2471 passing.
  • New message_user_prompt.spec.js covers the ported user-specific cases plus content precedence, streaming/smooth, and the get-context-item-content payload.
  • duo_chat_message.spec.js is re-based onto an assistant default message, with a new user messages block asserting delegation, gl-pl-7, scoped trustedUrls, event proxying, and that an errored user message still renders the error box.
  • message_registry.spec.js covers 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.

🤖 Generated with Claude Code

Edited by Enrique Alcántara

Merge request reports

Loading
Loading