Files
libredesk/frontend/shared-ui/components/ui/button/Button.vue
T
Abhinav Raut 976c45df3e add AI provider connection test and self-heal reasoning model param errors
Reasoning models like gpt-5 reject max_tokens and non-default temperature.
The client now reads the structured 400, renames max_tokens to
max_completion_tokens or drops the bad tuning param, and retries. This
removes the old rule that only sent max_completion_tokens when reasoning
effort was set.

Provider form gets a "Test connection" button that makes one live call
with the form values and shows the provider's real error. Embedding test
also checks the returned vector length against the Dimensions field.
Add an Anthropic preset (their OpenAI-compatible endpoint) and stop
pre-filling temperature since blank is safe on every model.

Fix the shared Button loader so the spinner is visible on non-filled
variants, and polish the copilot panel: bot avatars on messages, dot
loader while thinking, cleaner input box, and tab slide-in animation.
2026-07-13 03:01:10 +05:30

34 lines
1.1 KiB
Vue

<script setup>
import { Primitive } from 'reka-ui'
import { cn } from '../../../lib/utils'
import { buttonVariants } from '.'
import { Loader2 } from 'lucide-vue-next'
const props = defineProps({
variant: { type: null, required: false },
size: { type: null, required: false },
class: { type: null, required: false },
asChild: { type: Boolean, required: false },
as: { type: null, required: false, default: 'button' },
isLoading: { type: Boolean, required: false, default: false },
disabled: { type: Boolean, required: false, default: false }
})
</script>
<template>
<Primitive
:as="as"
:as-child="asChild"
:class="cn(buttonVariants({ variant, size }), 'relative', props.class)"
:disabled="isLoading || disabled"
>
<!-- display:contents keeps the button's flex/gap layout; the spinner inherits the variant's text color. -->
<span class="contents" :class="{ invisible: isLoading }"><slot /></span>
<span
v-if="isLoading"
class="absolute inset-0 flex items-center justify-center pointer-events-none"
>
<Loader2 class="h-5 w-5 animate-spin" />
</span>
</Primitive>
</template>