feat(ChatMessages): expose registerMessageRef#6275
feat(ChatMessages): expose registerMessageRef#6275
registerMessageRef#6275Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/content/docs/2.components/chat-messages.md`:
- Line 448: The table cell for the `registerMessageRef` signature is broken by
the unescaped union pipe in `ComponentPublicInstance | null`; update the table
entry for `registerMessageRef(id: string, element: ComponentPublicInstance |
null)` to escape the pipe (e.g., `ComponentPublicInstance \| null`) so the `|`
is not treated as a Markdown column separator and the table renders correctly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 14812679-c85d-4832-a30b-2ea371b946c8
📒 Files selected for processing (2)
docs/content/docs/2.components/chat-messages.mdsrc/runtime/components/ChatMessages.vue
commit: |
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
d1913ee to
4f1fd8e
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/runtime/components/ChatMessages.vue`:
- Line 70: The slot prop type for registerMessageRef is too narrow and the ref
cleanup is missing; update the slot signature for default (and the other
occurrence referenced) so registerMessageRef accepts Element |
ComponentPublicInstance | null, and modify the implementation of
registerMessageRef (the function that currently stores refs in the message refs
map around the code handling lines ~127–132 and the similar block at ~319) to
delete the map entry when the callback receives null (i.e., on unmount) instead
of leaving stale entries; ensure you update both the type declarations and the
runtime logic that adds/removes entries in the refs map (refer to
registerMessageRef and the message refs map usage).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e34604dd-809a-455b-8542-74a84f20f6d7
📒 Files selected for processing (2)
docs/content/docs/2.components/chat-messages.mdsrc/runtime/components/ChatMessages.vue
✅ Files skipped from review due to trivial changes (1)
- docs/content/docs/2.components/chat-messages.md
| :style="{ '--last-message-height': `${lastMessageHeight}px` }" | ||
| > | ||
| <slot> | ||
| <slot :register-message-ref="registerMessageRef"> |
There was a problem hiding this comment.
Do we really need to expose this in default slot? Isn't it enough to access it through a template ref? 🤔
There was a problem hiding this comment.
Personally, I’d prefer to avoid creating a template ref every time I need one when I’m dealing with simpler cases. I see the template ref as necessary for more complex scenarios.
🔗 Linked issue
❓ Type of change
📚 Description
To be able to reuse the scroll logic even when the default slot is used
📝 Checklist