Phase 007: migrate every remaining view from naive-ui to Arco Design Vue
The project now has exactly one UI library. Every naive-ui component in
packages/client/src is replaced by its Arco equivalent across 24 views and
roughly 80 components, and naive-ui is dropped from package.json along with
its transitive vueuc / @css-render / vdirs / seemly dependencies.
The migration is rendering-layer only. No store logic, no API contract, and
no /chat-run payload was touched.
Three classes of leftover were invisible to `grep naive-ui` and are now
covered by tests/client/no-naive-ui.test.ts, which asserts all three:
- dead .n-* class names in style blocks
- dead --n-* custom properties
- naive-ui in package.json
Notable behavioural traps handled along the way, recorded in
docs/arco-migration-rules.md:
- a-input-password defaults to masked; passing default-visibility="false"
would have exposed API keys in clear text
- a-upload fires a real XHR unless auto-upload is false
- nested Trigger components fight over the first element child, so the
group-chat settings dropdown was flattened
- Arco renders tooltip default-slot text inline, which was silently
collapsing the chat and group-chat toolbars
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { NButton, NSwitch, NSelect, NInputNumber } from 'naive-ui'
|
||||
import { useMessage } from '@/composables/useMessage'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useSettingsStore } from '@/stores/hermes/settings'
|
||||
@@ -92,51 +91,51 @@ async function testCompletionNotification() {
|
||||
<template>
|
||||
<section class="settings-section">
|
||||
<SettingRow :label="t('settings.display.theme')" :hint="t('settings.display.themeHint')">
|
||||
<NSelect :value="brightness" :options="themeOptions" size="small" :consistent-menu-width="false" class="input-sm" @update:value="handleThemeChange" />
|
||||
<a-select :model-value="brightness" :options="themeOptions" size="small" class="input-sm" @update:model-value="v => handleThemeChange(String(v))" />
|
||||
</SettingRow>
|
||||
<SettingRow :label="t('settings.display.streaming')" :hint="t('settings.display.streamingHint')">
|
||||
<NSwitch :value="settingsStore.display.streaming" @update:value="v => save({ streaming: v })" />
|
||||
<a-switch :model-value="settingsStore.display.streaming" @update:model-value="v => save({ streaming: v })" />
|
||||
</SettingRow>
|
||||
<SettingRow :label="t('settings.display.compact')" :hint="t('settings.display.compactHint')">
|
||||
<NSwitch :value="settingsStore.display.compact" @update:value="v => save({ compact: v })" />
|
||||
<a-switch :model-value="settingsStore.display.compact" @update:model-value="v => save({ compact: v })" />
|
||||
</SettingRow>
|
||||
<SettingRow :label="t('settings.display.showReasoning')" :hint="t('settings.display.showReasoningHint')">
|
||||
<NSwitch :value="settingsStore.display.show_reasoning" @update:value="v => save({ show_reasoning: v })" />
|
||||
<a-switch :model-value="settingsStore.display.show_reasoning" @update:model-value="v => save({ show_reasoning: v })" />
|
||||
</SettingRow>
|
||||
<SettingRow :label="t('settings.display.showCost')" :hint="t('settings.display.showCostHint')">
|
||||
<NSwitch :value="settingsStore.display.show_cost" @update:value="v => save({ show_cost: v })" />
|
||||
<a-switch :model-value="settingsStore.display.show_cost" @update:model-value="v => save({ show_cost: v })" />
|
||||
</SettingRow>
|
||||
<SettingRow :label="t('settings.display.inlineDiffs')" :hint="t('settings.display.inlineDiffsHint')">
|
||||
<NSwitch :value="settingsStore.display.inline_diffs" @update:value="v => save({ inline_diffs: v })" />
|
||||
<a-switch :model-value="settingsStore.display.inline_diffs" @update:model-value="v => save({ inline_diffs: v })" />
|
||||
</SettingRow>
|
||||
<SettingRow :label="t('settings.display.bellOnComplete')" :hint="t('settings.display.bellOnCompleteHint')">
|
||||
<NSwitch :value="settingsStore.display.bell_on_complete" @update:value="v => save({ bell_on_complete: v })" />
|
||||
<a-switch :model-value="settingsStore.display.bell_on_complete" @update:model-value="v => save({ bell_on_complete: v })" />
|
||||
</SettingRow>
|
||||
<SettingRow :label="t('settings.display.notifyOnComplete')" :hint="`${t('settings.display.notifyOnCompleteHint')} ${t('settings.display.notifyOnCompleteMacHint')}`">
|
||||
<div class="notify-controls">
|
||||
<NSwitch :value="settingsStore.display.notify_on_complete" @update:value="handleNotifyOnCompleteChange" />
|
||||
<NButton size="tiny" secondary @click="testCompletionNotification">
|
||||
<a-switch :model-value="settingsStore.display.notify_on_complete" @update:model-value="v => handleNotifyOnCompleteChange(v as boolean)" />
|
||||
<a-button size="mini" type="secondary" @click="testCompletionNotification">
|
||||
{{ t('settings.display.notifyOnCompleteTestButton') }}
|
||||
</NButton>
|
||||
</a-button>
|
||||
</div>
|
||||
</SettingRow>
|
||||
<SettingRow :label="t('settings.display.chatInputHeight')" :hint="t('settings.display.chatInputHeightHint')">
|
||||
<div class="chat-input-height-controls">
|
||||
<NInputNumber
|
||||
:value="chatInputHeight"
|
||||
<a-input-number
|
||||
:model-value="chatInputHeight ?? undefined"
|
||||
:min="MIN_CHAT_INPUT_HEIGHT"
|
||||
:max="MAX_CHAT_INPUT_HEIGHT"
|
||||
:step="8"
|
||||
:show-button="false"
|
||||
hide-button
|
||||
size="small"
|
||||
class="input-sm"
|
||||
@update:value="handleChatInputHeightChange"
|
||||
@update:model-value="v => handleChatInputHeightChange(v ?? null)"
|
||||
>
|
||||
<template #suffix>px</template>
|
||||
</NInputNumber>
|
||||
<NButton size="tiny" secondary @click="resetChatInputHeight">
|
||||
</a-input-number>
|
||||
<a-button size="mini" type="secondary" @click="resetChatInputHeight">
|
||||
{{ t('common.reset') }}
|
||||
</NButton>
|
||||
</a-button>
|
||||
</div>
|
||||
</SettingRow>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user