Skip to content

fix(chat): inline ChatPrompt props instead of extending external type#56

Merged
benjamincanac merged 2 commits into
mainfrom
fix/chat-prompt-props-extends
May 20, 2026
Merged

fix(chat): inline ChatPrompt props instead of extending external type#56
benjamincanac merged 2 commits into
mainfrom
fix/chat-prompt-props-extends

Conversation

@benjamincanac
Copy link
Copy Markdown
Contributor

@benjamincanac benjamincanac commented May 20, 2026

Summary

  • defineProps<ChatPromptProps & {...}>() in app/components/chat/ChatPrompt.vue triggers [vite:vue] [@vue/compiler-sfc] Failed to resolve extends base type under nuxt@4.4.6, blocking the Vercel build on chore(deps): update dependency nuxt to ^4.4.6 #54.
  • Drop the external type extension and inline only the props we actually forward to UChatPrompt (variant, disabled, class), so the SFC compiler doesn't have to chase the type chain into node_modules/@nuxt/ui.
  • Unblocks the nuxt patch bump (chore(deps): update dependency nuxt to ^4.4.6 #54). Worth a separate upstream report to nuxt/nuxt since main (with nuxt@4.4.5) compiles fine.

Test plan

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added selectable visual variants, a disabled state, and custom class support for the chat prompt, enabling new styling and behavior options.
  • Refactor

    • Streamlined component prop definitions for improved maintainability without changing visible behavior or events.

Review Change Stack

Extending ChatPromptProps from @nuxt/ui via `defineProps<ChatPromptProps & {...}>()`
trips @vue/compiler-sfc's "resolve extends base type" pass under nuxt 4.4.6,
breaking the Vercel build. Replace with explicit local props (only the ones
we actually forward to UChatPrompt) so the SFC compiler doesn't need to chase
the type chain into node_modules.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

📝 Walkthrough

Walkthrough

ChatPrompt.vue replaces the external ChatPromptProps type with an inline defineProps declaration listing status, error, selectedModel, and optional variant, disabled, and class, and removes error's nullable annotation.

Changes

ChatPrompt prop typing refactor

Layer / File(s) Summary
Inline prop definition
app/components/chat/ChatPrompt.vue
defineProps removes the external ChatPromptProps type intersection and instead explicitly declares all props inline: status, error, selectedModel, variant, disabled, and class.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰
A nibble, a tweak, a tidy line—
Props hop home, all clean, all fine.
No borrowed types to fetch or chase,
ChatPrompt blooms in its own space.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: replacing an external type extension (ChatPromptProps) with inlined prop definitions in ChatPrompt.vue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/chat-prompt-props-extends

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

`error?: Error | null` and `variant?: string` were too loose for
UChatPrompt's `Error | undefined` and `'outline' | 'soft' | 'subtle' | 'naked'`
signatures, causing typecheck to fail. Narrow both to match.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
app/components/chat/ChatPrompt.vue (1)

10-10: ⚡ Quick win

Replace any with a proper type for the class prop.

Using any defeats TypeScript's type safety. Consider using a more specific type that matches Vue's class binding expectations, such as string | Record<string, boolean> | (string | Record<string, boolean>)[].

♻️ Proposed type improvement
-  class?: any
+  class?: string | Record<string, boolean> | (string | Record<string, boolean>)[]
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/components/chat/ChatPrompt.vue` at line 10, The prop declaration for
class in ChatPrompt.vue currently uses the unsafe type any; replace it with a
Vue-compatible class binding type such as string | Record<string, boolean> |
Array<string | Record<string, boolean>> (or the equivalent union) on the class
prop to restore type safety; update the prop definition for class in the
component (the prop named "class") and adjust any usages that rely on the
previous any type to satisfy the new union.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@app/components/chat/ChatPrompt.vue`:
- Line 10: The prop declaration for class in ChatPrompt.vue currently uses the
unsafe type any; replace it with a Vue-compatible class binding type such as
string | Record<string, boolean> | Array<string | Record<string, boolean>> (or
the equivalent union) on the class prop to restore type safety; update the prop
definition for class in the component (the prop named "class") and adjust any
usages that rely on the previous any type to satisfy the new union.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 29d69f55-acd5-4e3d-96f0-02adf71e2ebc

📥 Commits

Reviewing files that changed from the base of the PR and between a88288e and ccc8b38.

📒 Files selected for processing (1)
  • app/components/chat/ChatPrompt.vue

@benjamincanac benjamincanac merged commit 022b375 into main May 20, 2026
4 checks passed
@benjamincanac benjamincanac deleted the fix/chat-prompt-props-extends branch May 20, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant