Conversation
📝 WalkthroughWalkthroughA docs-only ChatShimmer component was removed from docs/app and replaced by a new runtime component at src/runtime/components/ChatShimmer.vue with its prop renamed from Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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 (2)
docs/content/docs/2.components/chat-shimmer.md (1)
12-45: Consider documenting theasprop.The documentation covers
label,duration, andspreadprops well. Theasprop (for rendering as different elements) is defined inChatShimmerPropsbut not explicitly documented here. Users might find it useful to know they can render the shimmer as adivor other elements.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/content/docs/2.components/chat-shimmer.md` around lines 12 - 45, Add a short "as" prop section to the ChatShimmer docs explaining that ChatShimmer supports an as prop (defined on ChatShimmerProps) to render the shimmer as a different element (e.g., 'div', 'span', or a custom component); show the default value, a brief example snippet using as: 'div' and as: 'span', and mention that it forwards standard element props/attributes to the rendered element so consumers can pass className, id, etc.test/components/ChatShimmer.spec.ts (1)
12-19: Consider adding test coverage for theasprop.The
ChatShimmerPropsinterface includes anasprop that allows rendering as different elements/components, but this isn't covered in the test variations.💡 Optional: Add test for `as` prop
renderEach(ChatShimmer, [ // Props ['with label', { props }], ['with duration', { props: { ...props, duration: 3 } }], ['with spread', { props: { ...props, spread: 4 } }], ['with class', { props: { ...props, class: 'custom-class' } }], - ['with ui', { props: { ...props, ui: { base: 'font-bold' } } }] + ['with ui', { props: { ...props, ui: { base: 'font-bold' } } }], + ['with as', { props: { ...props, as: 'div' } }] ])🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@test/components/ChatShimmer.spec.ts` around lines 12 - 19, Add a test case covering the ChatShimmer "as" prop by updating the renderEach block for ChatShimmer (where renderEach is used to enumerate prop variations) to include a variation like 'with as' that passes props with as set (e.g., as: 'section' or as: MyCustomComponent) so the component renders the specified element/component; locate the renderEach invocation for ChatShimmer in ChatShimmer.spec.ts and add the new entry to the array alongside the existing 'with label'/'with duration' cases, ensuring the test supplies a valid value for the as prop from ChatShimmerProps.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@docs/content/docs/2.components/chat-shimmer.md`:
- Around line 12-45: Add a short "as" prop section to the ChatShimmer docs
explaining that ChatShimmer supports an as prop (defined on ChatShimmerProps) to
render the shimmer as a different element (e.g., 'div', 'span', or a custom
component); show the default value, a brief example snippet using as: 'div' and
as: 'span', and mention that it forwards standard element props/attributes to
the rendered element so consumers can pass className, id, etc.
In `@test/components/ChatShimmer.spec.ts`:
- Around line 12-19: Add a test case covering the ChatShimmer "as" prop by
updating the renderEach block for ChatShimmer (where renderEach is used to
enumerate prop variations) to include a variation like 'with as' that passes
props with as set (e.g., as: 'section' or as: MyCustomComponent) so the
component renders the specified element/component; locate the renderEach
invocation for ChatShimmer in ChatShimmer.spec.ts and add the new entry to the
array alongside the existing 'with label'/'with duration' cases, ensuring the
test supplies a valid value for the as prop from ChatShimmerProps.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b685696e-032c-4d4d-be84-64886165dbba
⛔ Files ignored due to path filters (2)
test/components/__snapshots__/ChatShimmer-vue.spec.ts.snapis excluded by!**/*.snaptest/components/__snapshots__/ChatShimmer.spec.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (9)
docs/app/components/chat/ChatReasoning.vuedocs/app/components/chat/ChatShimmer.vuedocs/app/components/chat/ChatTool.vuedocs/content/docs/2.components/chat-shimmer.mdsrc/runtime/components/ChatShimmer.vuesrc/runtime/types/index.tssrc/theme/chat-shimmer.tssrc/theme/index.tstest/components/ChatShimmer.spec.ts
💤 Files with no reviewable changes (1)
- docs/app/components/chat/ChatShimmer.vue
commit: |
Co-Authored-By: Hugo <71938701+HugoRCD@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/runtime/components/ChatShimmer.vue (1)
46-50: Consider clarifying theuicomputed naming to avoid confusion.The computed
ui(line 50) shadows the propui(line 29), which is why the eslint-disable comment exists. While functional, consider renaming the computed to something likeuiVariantsoruiStylesto improve readability and remove the need for the eslint-disable.♻️ Optional refactor to improve clarity
const appConfig = useAppConfig() as ChatShimmer['AppConfig'] const uiProp = useComponentUI('chatShimmer', props) -// eslint-disable-next-line vue/no-dupe-keys -const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.chatShimmer || {}) })) +const uiStyles = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.chatShimmer || {}) }))Then in the template:
- :class="ui({ class: [uiProp?.base, props.class] })" + :class="uiStyles({ class: [uiProp?.base, props.class] })"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/runtime/components/ChatShimmer.vue` around lines 46 - 50, The computed property currently named ui shadows the existing prop ui (created by useComponentUI('chatShimmer', props)), causing the eslint-disable; rename the computed from ui to a clearer name like uiVariants or uiStyles (update the computed declaration and any places in the template or script that reference the computed) so the prop and computed no longer conflict and you can remove the eslint-disable-next-line vue/no-dupe-keys.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@playgrounds/nuxt/server/api/chat.post.ts`:
- Line 28: The call to toUIMessageStreamResponse() in the server message
streaming pipeline no longer forwards reasoning parts by default; update the
invocation of toUIMessageStreamResponse() (in the handler that produces the
streamed UI messages) to pass sendReasoning: true so that message.parts contains
reasoning entries for the frontend (the reasoning UI depends on those parts
being present).
---
Nitpick comments:
In `@src/runtime/components/ChatShimmer.vue`:
- Around line 46-50: The computed property currently named ui shadows the
existing prop ui (created by useComponentUI('chatShimmer', props)), causing the
eslint-disable; rename the computed from ui to a clearer name like uiVariants or
uiStyles (update the computed declaration and any places in the template or
script that reference the computed) so the prop and computed no longer conflict
and you can remove the eslint-disable-next-line vue/no-dupe-keys.
🪄 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: dbafd412-9609-4634-9972-055d9d2c6f0a
⛔ Files ignored due to path filters (4)
docs/public/components/dark/chat-shimmer.pngis excluded by!**/*.pngdocs/public/components/light/chat-shimmer.pngis excluded by!**/*.pngtest/components/__snapshots__/ChatShimmer-vue.spec.ts.snapis excluded by!**/*.snaptest/components/__snapshots__/ChatShimmer.spec.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (6)
playgrounds/nuxt/app/composables/useNavigation.tsplaygrounds/nuxt/app/pages/components/chat-shimmer.vueplaygrounds/nuxt/server/api/chat.post.tssrc/runtime/components/ChatShimmer.vuesrc/runtime/keyframes.csssrc/theme/chat-shimmer.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/theme/chat-shimmer.ts
🔗 Linked issue
❓ Type of change
📚 Description
📝 Checklist