feat: add collapsible section for AI agent settings to reduce visual clutter

This commit is contained in:
jxxghp
2026-05-14 20:27:28 +08:00
parent 74c980c7a5
commit f3ab2a8eff
+25 -2
View File
@@ -191,6 +191,9 @@ const advancedDialog = ref(false)
const savingBasic = ref(false)
const testingLlm = ref(false)
// 智能助手配置项较多,默认收起以降低基础设置页的视觉占用。
const aiAgentSettingsCollapsed = ref(true)
type LlmSettingsSnapshot = {
AI_AGENT_ENABLE: boolean
LLM_PROVIDER: string
@@ -997,7 +1000,7 @@ watch(currentLlmSnapshotKey, (snapshotKey, previousSnapshotKey) => {
variant="outlined"
:class="['mt-6', isTransparentTheme ? 'ai-agent-settings-card-transparent' : 'ai-agent-settings-card']"
>
<VCardItem class="pb-2">
<VCardItem class="pb-3">
<template #prepend>
<VAvatar color="primary" variant="tonal" size="40">
<VIcon icon="mdi-robot-outline" />
@@ -1009,8 +1012,27 @@ watch(currentLlmSnapshotKey, (snapshotKey, previousSnapshotKey) => {
<VCardSubtitle>
{{ t('setting.system.aiAgentSectionDesc') }}
</VCardSubtitle>
<template #append>
<VTooltip location="top">
<template #activator="{ props }">
<VBtn
v-bind="props"
:icon="aiAgentSettingsCollapsed ? 'mdi-chevron-down' : 'mdi-chevron-up'"
variant="text"
color="primary"
size="small"
:aria-label="aiAgentSettingsCollapsed ? t('setting.about.expand') : t('setting.about.collapse')"
@click="aiAgentSettingsCollapsed = !aiAgentSettingsCollapsed"
/>
</template>
<span>{{
aiAgentSettingsCollapsed ? t('setting.about.expand') : t('setting.about.collapse')
}}</span>
</VTooltip>
</template>
</VCardItem>
<VCardText class="pt-2">
<VExpandTransition>
<VCardText v-show="!aiAgentSettingsCollapsed" class="pt-2">
<VRow>
<VCol cols="12" md="4">
<VSwitch
@@ -1440,6 +1462,7 @@ watch(currentLlmSnapshotKey, (snapshotKey, previousSnapshotKey) => {
</VCol>
</VRow>
</VCardText>
</VExpandTransition>
</VCard>
</VForm>
</VCardText>