feat(ChatMessage): add color prop and header slot#6407
feat(ChatMessage): add color prop and header slot#6407maximepvrt wants to merge 4 commits intonuxt:v4from
color prop and header slot#6407Conversation
📝 WalkthroughWalkthroughAdds a Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
playgrounds/nuxt/app/pages/components/chat-message.vue (1)
19-21: Consider adding required props to UChatMessage.The
UChatMessagecomponent requiresid,role, andpartsprops (or the deprecatedcontent). Whilecontentis provided, consider using the recommendedpartsformat with properidandrolefor a complete example:♻️ Suggested enhancement
<Matrix v-slot="props" :attrs="attrs"> - <UChatMessage content="My message" v-bind="props" /> + <UChatMessage + id="demo-message" + role="user" + :parts="[{ type: 'text', text: 'My message' }]" + v-bind="props" + /> </Matrix>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@playgrounds/nuxt/app/pages/components/chat-message.vue` around lines 19 - 21, The UChatMessage usage currently passes only the deprecated content prop; update the Matrix slot render to provide UChatMessage with the required props: include a unique id, a role (e.g., "user" or "assistant"), and the parts array (instead of content) constructed from the slot props; locate the Matrix v-slot and replace the UChatMessage attributes so it receives id, role and parts (e.g., parts: [{ content_type: "text", text: "My message" }]) while still binding remaining props via v-bind="props".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@playgrounds/nuxt/app/pages/components/chat-message.vue`:
- Around line 19-21: The UChatMessage usage currently passes only the deprecated
content prop; update the Matrix slot render to provide UChatMessage with the
required props: include a unique id, a role (e.g., "user" or "assistant"), and
the parts array (instead of content) constructed from the slot props; locate the
Matrix v-slot and replace the UChatMessage attributes so it receives id, role
and parts (e.g., parts: [{ content_type: "text", text: "My message" }]) while
still binding remaining props via v-bind="props".
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bb48fc2c-84bf-4283-9508-db1616c6bbfd
⛔ Files ignored due to path filters (4)
test/components/__snapshots__/ChatMessage-vue.spec.ts.snapis excluded by!**/*.snaptest/components/__snapshots__/ChatMessage.spec.ts.snapis excluded by!**/*.snaptest/components/__snapshots__/ChatMessages-vue.spec.ts.snapis excluded by!**/*.snaptest/components/__snapshots__/ChatMessages.spec.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (6)
docs/content/docs/2.components/chat-message.mdplaygrounds/nuxt/app/composables/useNavigation.tsplaygrounds/nuxt/app/pages/components/chat-message.vuesrc/runtime/components/ChatMessage.vuesrc/theme/chat-message.tstest/components/ChatMessage.spec.ts
There was a problem hiding this comment.
🧹 Nitpick comments (1)
playgrounds/nuxt/app/pages/components/chat-message.vue (1)
19-21: Consider showcasing the newheaderslot in this playground.This page already demonstrates the new
colorbehavior well; adding a simple#headerexample would make the slot addition easier to discover interactively.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@playgrounds/nuxt/app/pages/components/chat-message.vue` around lines 19 - 21, Add a small example of the new header slot to the playground by updating the UChatMessage usage inside the Matrix v-slot block: keep the existing props and parts but add a header slot (e.g., a <template `#header`> or v-slot:header on UChatMessage) that renders simple header content like a title, role label or timestamp so users can interactively see the new header slot behavior alongside the existing color demo; modify the Matrix v-slot="props" / UChatMessage id="1" block to include that header slot example.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@playgrounds/nuxt/app/pages/components/chat-message.vue`:
- Around line 19-21: Add a small example of the new header slot to the
playground by updating the UChatMessage usage inside the Matrix v-slot block:
keep the existing props and parts but add a header slot (e.g., a <template
`#header`> or v-slot:header on UChatMessage) that renders simple header content
like a title, role label or timestamp so users can interactively see the new
header slot behavior alongside the existing color demo; modify the Matrix
v-slot="props" / UChatMessage id="1" block to include that header slot example.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4421a0cd-6c48-440d-b519-6e11e0c25535
📒 Files selected for processing (1)
playgrounds/nuxt/app/pages/components/chat-message.vue
commit: |
🔗 Linked issue
❓ Type of change
📚 Description
📝 Checklist