diff --git a/frontend/src-tauri/capabilities/main.json b/frontend/src-tauri/capabilities/main.json index ab5c673..280df55 100644 --- a/frontend/src-tauri/capabilities/main.json +++ b/frontend/src-tauri/capabilities/main.json @@ -18,6 +18,10 @@ "allow-workspace-recent", "allow-workspace-revoke", "core:window:allow-destroy", + "core:window:allow-close", + "core:window:allow-minimize", + "core:window:allow-toggle-maximize", + "core:window:allow-start-dragging", "allow-editor-capabilities" ] } diff --git a/frontend/src-tauri/tauri.conf.json b/frontend/src-tauri/tauri.conf.json index 9c82cae..d5d2d23 100644 --- a/frontend/src-tauri/tauri.conf.json +++ b/frontend/src-tauri/tauri.conf.json @@ -10,7 +10,7 @@ "frontendDist": "../dist" }, "app": { - "windows": [{"label": "main", "title": "NotesAgent Preview", "width": 1200, "height": 800, "minWidth": 640, "minHeight": 480}], + "windows": [{"label": "main", "title": "NotesAgent Preview", "width": 1200, "height": 800, "minWidth": 640, "minHeight": 480, "decorations": false}], "security": { "csp": "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; font-src 'self' data:; connect-src ipc: http://ipc.localhost; frame-src 'self' blob:; object-src 'none'; base-uri 'self'", "capabilities": ["main"] diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 547ed72..06f082e 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -2,17 +2,29 @@ import { computed } from 'vue' import { useRoute } from 'vue-router' import AppShell from '@/components/common/AppShell.vue' +import TitleBar from '@/components/common/TitleBar.vue' +import { isDesktop } from '@/services/platform/desktop' const route = useRoute() const isVaultEntry = computed(() => route.path === '/') +const desktop = isDesktop() diff --git a/frontend/src/components/common/TitleBar.vue b/frontend/src/components/common/TitleBar.vue index 3d7a9f3..da5819a 100644 --- a/frontend/src/components/common/TitleBar.vue +++ b/frontend/src/components/common/TitleBar.vue @@ -7,11 +7,14 @@ import { useThemeStore } from '@/stores/theme' import { Moon, Sunny } from '@element-plus/icons-vue' import AppIcon from './AppIcon.vue' import { t } from '@/i18n' +import { isDesktop } from '@/services/platform/desktop' +import { minimizeWindow, requestWindowClose, toggleMaximizeWindow } from '@/services/platform/windowControls' const route = useRoute() const workspaceStore = useWorkspaceStore() const editorStore = useEditorStore() const themeStore = useThemeStore() +const desktop = isDesktop() const pageTitle = computed(() => { const name = route.name as string @@ -25,6 +28,11 @@ const pageTitle = computed(() => { plugins: t('Plugin 与 MCP', 'Plugins and MCP'), themes: t('主题管理', 'Theme Management'), settings: t('设置', 'Settings'), + 'vault-entry': t('选择知识库', 'Select Knowledge Base'), + community: t('社区目录', 'Community Catalog'), + benchmarks: 'Benchmark', + logs: t('运行日志', 'Operation Logs'), + media: t('音视频转写', 'Media Transcription'), } return titles[name] || 'NotesAgent' }) @@ -38,32 +46,36 @@ const currentFileName = computed(() => { }) const isDirty = computed(() => editorStore.saveStatus === 'dirty' || editorStore.saveStatus === 'conflict') + +function toggleFromTitlebar(event: MouseEvent) { + if (desktop && !(event.target as HTMLElement).closest('button')) void toggleMaximizeWindow() +}