support chat mode

This commit is contained in:
Julian Freeman
2026-04-03 18:36:12 -04:00
parent ce4a42eec2
commit 41494ebad0
3 changed files with 691 additions and 3 deletions

View File

@@ -6,7 +6,8 @@ import {
FileText,
Sun,
Moon,
Clock
Clock,
MessageSquare
} from 'lucide-vue-next';
import { useSettingsStore } from './stores/settings';
import pkg from '../package.json';
@@ -14,6 +15,7 @@ import { cn } from './lib/utils';
// Import newly separated views
import TranslationView from './components/TranslationView.vue';
import ConversationView from './components/ConversationView.vue';
import SettingsView from './components/SettingsView.vue';
import LogsView from './components/LogsView.vue';
import HistoryView from './components/HistoryView.vue';
@@ -34,7 +36,7 @@ const toggleTheme = () => {
};
// Global Routing State
const view = ref<'translate' | 'settings' | 'logs' | 'history'>('translate');
const view = ref<'translate' | 'conversation' | 'settings' | 'logs' | 'history'>('translate');
</script>
@@ -55,6 +57,13 @@ const view = ref<'translate' | 'settings' | 'logs' | 'history'>('translate');
<Sun v-if="settings.isDark" class="w-5 h-5" />
<Moon v-else class="w-5 h-5" />
</button>
<button
@click="view = 'conversation'"
:class="cn('p-2 rounded-full transition-colors', view === 'conversation' ? 'bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400' : 'hover:bg-slate-200/50 dark:hover:bg-slate-800 text-slate-600 dark:text-slate-300')"
title="对话模拟"
>
<MessageSquare class="w-5 h-5" />
</button>
<button
@click="view = 'settings'"
:class="cn('p-2 rounded-full transition-colors', view === 'settings' ? 'bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400' : 'hover:bg-slate-200/50 dark:hover:bg-slate-800 text-slate-600 dark:text-slate-300')"
@@ -83,6 +92,7 @@ const view = ref<'translate' | 'settings' | 'logs' | 'history'>('translate');
<!-- Container for isolated views with keep-alive -->
<keep-alive>
<TranslationView v-if="view === 'translate'" />
<ConversationView v-else-if="view === 'conversation'" />
<SettingsView v-else-if="view === 'settings'" />
<LogsView v-else-if="view === 'logs'" />
<HistoryView v-else-if="view === 'history'" />