@tano.page/workbench 0.14.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/package.json +21 -8
  2. package/src/App.vue +76 -17
  3. package/src/appearance/appearance.ts +14 -4
  4. package/src/appearance/components/ThemePresetPreview.vue +52 -8
  5. package/src/appearance/interface-font.ts +99 -0
  6. package/src/appearance/theme.ts +26 -10
  7. package/src/appearance/use-interface-font.ts +30 -0
  8. package/src/assets/mail-provider-icons/NOTICE.txt +27 -0
  9. package/src/assets/mail-provider-icons/aliyun-mail.svg +3 -0
  10. package/src/assets/mail-provider-icons/gmail.svg +1 -0
  11. package/src/assets/mail-provider-icons/icloud.svg +12 -0
  12. package/src/assets/mail-provider-icons/netease-126.svg +5 -0
  13. package/src/assets/mail-provider-icons/netease-163.svg +5 -0
  14. package/src/assets/mail-provider-icons/qq.svg +9 -0
  15. package/src/assets/mail-provider-icons/tencent-exmail.svg +4 -0
  16. package/src/assistant/components/AssistantChangeList.vue +98 -21
  17. package/src/assistant/components/AssistantPanel.vue +424 -7
  18. package/src/assistant/components/PluginToolProposalCard.vue +235 -0
  19. package/src/assistant/engine.ts +56 -3
  20. package/src/assistant/files.ts +5 -13
  21. package/src/assistant/inbox.ts +1 -148
  22. package/src/assistant/locales/de-DE.json +4 -1
  23. package/src/assistant/locales/en-US.json +4 -1
  24. package/src/assistant/locales/es-ES.json +4 -1
  25. package/src/assistant/locales/ja-JP.json +4 -1
  26. package/src/assistant/locales/zh-CN.json +4 -1
  27. package/src/assistant/locales/zh-TW.json +4 -1
  28. package/src/assistant/mention-autocomplete.ts +69 -0
  29. package/src/assistant/prompts.ts +7 -0
  30. package/src/assistant/results.ts +20 -86
  31. package/src/assistant/store.ts +319 -12
  32. package/src/assistant/structures.ts +7 -5
  33. package/src/assistant/tasks.ts +3 -5
  34. package/src/assistant/workspace-bridge.ts +1 -1
  35. package/src/composables/use-document-actions.ts +38 -20
  36. package/src/composables/use-file-tree-controller.ts +7 -12
  37. package/src/composables/use-workbench-history.ts +2 -4
  38. package/src/composables/use-workbench-modals.ts +6 -1
  39. package/src/composables/use-workbench-outline.ts +0 -5
  40. package/src/composables/use-workbench-shortcuts.ts +26 -22
  41. package/src/data-tables/data-tables.ts +1 -2
  42. package/src/documents/components/DocumentHistoryPanel.vue +3 -1
  43. package/src/features.ts +1 -0
  44. package/src/fonts/Inter-Latin-Italic.woff2 +0 -0
  45. package/src/fonts/Inter-Latin.woff2 +0 -0
  46. package/src/fonts/TanoUISansSC-Bold.woff2 +0 -0
  47. package/src/fonts/TanoUISansSC-Medium.woff2 +0 -0
  48. package/src/fonts/TanoUISansSC-Regular.woff2 +0 -0
  49. package/src/help/help-milestones.ts +3 -5
  50. package/src/i18n/locales/de-DE.json +349 -3
  51. package/src/i18n/locales/en-US.json +349 -2
  52. package/src/i18n/locales/es-ES.json +349 -3
  53. package/src/i18n/locales/ja-JP.json +348 -2
  54. package/src/i18n/locales/zh-TW.json +348 -2
  55. package/src/mail/components/MailAccountDialog.vue +449 -0
  56. package/src/mail/components/MailComposerDialog.vue +325 -0
  57. package/src/mail/components/MailProviderIcon.vue +30 -0
  58. package/src/mail/components/MailWorkspaceView.vue +820 -0
  59. package/src/mail/components/SidebarMail.vue +133 -0
  60. package/src/mail/mail-avatar.ts +17 -0
  61. package/src/mail/mail-bridge.ts +68 -0
  62. package/src/mail/mail-calendar.ts +208 -0
  63. package/src/mail/mail-markdown.ts +195 -0
  64. package/src/mail/types.ts +226 -0
  65. package/src/objects/components/ObjectDetailModal.vue +1001 -0
  66. package/src/objects/workspace-objects.ts +1 -1
  67. package/src/plan-sync/types.ts +6 -3
  68. package/src/plans/calendar-interaction.ts +194 -0
  69. package/src/plans/calendar.ts +63 -7
  70. package/src/plans/components/CalendarDayPopover.vue +172 -39
  71. package/src/plans/components/CalendarView.vue +1736 -276
  72. package/src/plans/components/PlanArchiveDialog.vue +295 -0
  73. package/src/plans/components/PlanDateField.vue +6 -4
  74. package/src/plans/components/PlanDetailPanel.vue +227 -32
  75. package/src/plans/components/PlanEventList.vue +16 -4
  76. package/src/plans/components/SidebarPlan.vue +22 -15
  77. package/src/plans/components/TaskRepeatControls.vue +169 -30
  78. package/src/plans/local-reminders.ts +149 -0
  79. package/src/plans/personal-plans.ts +10 -1
  80. package/src/plans/plan-date.ts +8 -1
  81. package/src/plans/plan-migration.ts +95 -0
  82. package/src/plans/recurrence.ts +95 -0
  83. package/src/plans/task-repeat.ts +8 -8
  84. package/src/plans/timeline-layout.ts +92 -0
  85. package/src/plugins/assistant-bridge.ts +520 -0
  86. package/src/plugins/attachment-reader.ts +3 -1
  87. package/src/plugins/cache-storage.ts +42 -2
  88. package/src/plugins/components/PluginAutomations.vue +3 -3
  89. package/src/plugins/components/PluginCatalogBrowser.vue +17 -8
  90. package/src/plugins/components/PluginChangeSummary.vue +16 -3
  91. package/src/plugins/components/PluginConnections.vue +1 -1
  92. package/src/plugins/components/PluginCustomView.vue +2 -2
  93. package/src/plugins/components/PluginDetailPage.vue +129 -54
  94. package/src/plugins/components/PluginDocumentSlot.vue +63 -0
  95. package/src/plugins/components/PluginExplorer.vue +15 -21
  96. package/src/plugins/components/PluginImportDialog.vue +410 -0
  97. package/src/plugins/components/PluginInstaller.vue +39 -145
  98. package/src/plugins/components/PluginListItem.vue +3 -0
  99. package/src/plugins/components/PluginMaintenance.vue +21 -6
  100. package/src/plugins/components/PluginRuntimePanel.vue +3 -3
  101. package/src/plugins/components/PluginSettingsForm.vue +111 -0
  102. package/src/plugins/components/PluginStatusBar.vue +161 -0
  103. package/src/plugins/components/PluginSurface.vue +18 -6
  104. package/src/plugins/components/PluginUiDialog.vue +452 -0
  105. package/src/plugins/excalidraw/bundle.tano-plugin.json +1 -1
  106. package/src/plugins/excalidraw/manifest.json +12 -1
  107. package/src/plugins/host.ts +662 -43
  108. package/src/plugins/native.ts +2 -10
  109. package/src/plugins/overlay-mapping.ts +125 -0
  110. package/src/plugins/packages.ts +73 -1
  111. package/src/plugins/plugin-permissions.ts +57 -0
  112. package/src/plugins/plugin-sdk.ts +174 -8
  113. package/src/plugins/policy.ts +53 -3
  114. package/src/plugins/presentation-preview/bundle.tano-plugin.json +1 -1
  115. package/src/plugins/presentation-preview/manifest.json +2 -1
  116. package/src/plugins/queries.ts +3 -1
  117. package/src/plugins/sandbox.ts +15 -1
  118. package/src/plugins/use-plugin-actions.ts +67 -20
  119. package/src/plugins/user-plugins.ts +254 -0
  120. package/src/plugins/word-preview/bundle.tano-plugin.json +1 -1
  121. package/src/plugins/word-preview/manifest.json +13 -1
  122. package/src/plugins/workbench.ts +175 -2
  123. package/src/plugins/worker.js +105 -8
  124. package/src/plugins/workspace-plugin-runtime.ts +23 -7
  125. package/src/plugins/workspace-plugins.ts +212 -21
  126. package/src/runtime.ts +101 -3
  127. package/src/settings/components/SettingsAppearancePage.vue +46 -0
  128. package/src/settings/components/SettingsDocumentsPage.vue +0 -1
  129. package/src/settings/components/settings-search.ts +2 -3
  130. package/src/shell/components/SidebarNavigation.vue +22 -2
  131. package/src/shell/components/WorkbenchContextMenus.vue +21 -8
  132. package/src/shell/components/WorkbenchModals.vue +27 -46
  133. package/src/shell/components/WorkbenchPanes.vue +267 -84
  134. package/src/shell/components/WorkspaceBreadcrumb.vue +6 -14
  135. package/src/shell/components/WorkspaceViewSwitcher.vue +12 -7
  136. package/src/shell/use-workbench.ts +116 -145
  137. package/src/shell/workbench-async-components.ts +14 -5
  138. package/src/stores/mail.ts +414 -0
  139. package/src/stores/plan-sync.ts +2 -1
  140. package/src/stores/plans.ts +2 -9
  141. package/src/stores/workspace-knowledge.ts +1 -113
  142. package/src/stores/workspace-plugins-state.ts +537 -14
  143. package/src/stores/workspace-tabs-layout.ts +5 -43
  144. package/src/stores/workspace.ts +69 -66
  145. package/src/styles/agent-diff-modals.css +0 -7
  146. package/src/styles/dark-theme.css +3 -3
  147. package/src/styles/inspector.css +0 -59
  148. package/src/styles/layout-themes.css +346 -0
  149. package/src/styles/mail.css +1568 -0
  150. package/src/styles/mobile.css +2 -2
  151. package/src/styles/recent-and-media.css +0 -17
  152. package/src/styles/theme-contract.css +3 -3
  153. package/src/styles/workbench-shell.css +110 -17
  154. package/src/styles/workspace-states.css +9 -33
  155. package/src/styles.css +1 -1
  156. package/src/tabs/components/DesktopTabs.vue +0 -3
  157. package/src/tabs/components/NewTabPicker.vue +10 -4
  158. package/src/tabs/tab-label.ts +0 -1
  159. package/src/workspace/components/WorkspaceGeneralSettings.vue +0 -13
  160. package/src/workspace/components/WorkspaceIconPicker.vue +28 -6
  161. package/src/workspace/workspace-comments.ts +11 -151
  162. package/src/workspace/workspace-welcome.ts +1 -1
  163. package/src/documents/components/FormulaMenu.vue +0 -50
  164. package/src/files/components/FileDatabasePage.vue +0 -152
  165. package/src/files/components/FolderHomeIcon.vue +0 -12
  166. package/src/objects/components/ObjectDatabasePage.vue +0 -100
  167. package/src/objects/components/ObjectPanel.vue +0 -554
  168. package/src/plans/components/PersonalPlanDialog.vue +0 -105
  169. package/src/shell/components/WorkspaceViewPage.vue +0 -127
  170. package/src/shell/components/WorkspaceViewTab.vue +0 -24
  171. package/src/styles/object-panel.css +0 -163
  172. package/src/workspace/components/GitInspectionPanel.vue +0 -35
  173. package/src/workspace/components/WorkspaceSyncPanel.vue +0 -50
  174. package/src/workspace/welcome-slogans.ts +0 -11
  175. package/src/workspace/workspace-git.ts +0 -35
  176. package/src/workspace/workspace-sync.ts +0 -46
  177. package/src/workspace/workspace-views.ts +0 -48
@@ -10,7 +10,9 @@ import {
10
10
  watch,
11
11
  } from 'vue';
12
12
  import { storeToRefs } from 'pinia';
13
- import { Bot, Settings2 } from 'lucide-vue-next';
13
+ import { Bot, Mail, Settings2 } from 'lucide-vue-next';
14
+ import { isFeatureEnabled } from '../features';
15
+ import { MAIL_TAB_ID } from '../mail/types';
14
16
  import { version as appVersion } from '../../package.json';
15
17
  import { defaultSelectionContext } from '@tano/editor/selection-context';
16
18
  import {
@@ -18,6 +20,8 @@ import {
18
20
  isDataTableFilePath,
19
21
  isMarkdown,
20
22
  isObjectPath,
23
+ isPlanObject,
24
+ isPlanObjectType,
21
25
  isWorkspaceInternalPath,
22
26
  parentPath,
23
27
  relativeWorkspaceReference,
@@ -25,7 +29,6 @@ import {
25
29
  safeRemoteImage,
26
30
  type FileEntry,
27
31
  type ReferenceIdentity,
28
- type ReferenceTarget,
29
32
  } from '@tano/protocol';
30
33
  import { native } from '../workspace/adapter';
31
34
  import { agentInboxKey, useAgentInboxController } from '../assistant/agent-controller';
@@ -53,6 +56,8 @@ import { GRAPH_TAB_ID } from '../documents/document-graph';
53
56
  import type { HelpAvailability, HelpContext } from '../help/help-content';
54
57
  import { t, uiLocale } from '../i18n/i18n';
55
58
  import { planKey } from '../plans/personal-plans';
59
+ import { expandRecurringPlans } from '../plans/recurrence';
60
+ import { LocalReminderScheduler } from '../plans/local-reminders';
56
61
  import { mobile } from '../platform/platform';
57
62
  import { nativeListen as listen } from '../platform/native-bridge';
58
63
  import { pluginPreviewStatus, pluginViewHeader } from '../plugins/view-header';
@@ -82,7 +87,6 @@ import {
82
87
  import { retainWorkbenchSession } from './workbench-session';
83
88
  import type { ObjectRecord } from '../objects/workspace-objects';
84
89
  import { PLUGINS_TAB_ID } from '../plugins/workspace-plugins';
85
- import { createWorkspaceSync, syncEvent } from '../workspace/workspace-sync';
86
90
 
87
91
  export interface WorkbenchProps {
88
92
  initialWorkspace?: string;
@@ -209,7 +213,6 @@ export function useWorkbench(props: WorkbenchProps, emit: (event: 'ready') => vo
209
213
  const importRecords = ref<ImportRecord[]>([]);
210
214
  const agentPanel = ref(false);
211
215
  const recyclePanel = ref(false);
212
- const systemSyncPanel = ref(false);
213
216
  const templateLibraryOpen = ref(false);
214
217
  const templatePaneId = ref('');
215
218
  const templateSource = ref('');
@@ -238,9 +241,20 @@ export function useWorkbench(props: WorkbenchProps, emit: (event: 'ready') => vo
238
241
  scope: 'account',
239
242
  detachable: true,
240
243
  };
244
+ const mailEnabled = isFeatureEnabled('desktopMailClient') && native && !mobile;
245
+ const mailTabView: WorkbenchViewTab = {
246
+ id: MAIL_TAB_ID,
247
+ get label() {
248
+ return t('邮箱');
249
+ },
250
+ icon: Mail,
251
+ scope: 'account',
252
+ detachable: false,
253
+ };
241
254
  store.registerViews([
242
255
  ...extensionViews,
243
256
  settingsTabView,
257
+ ...(mailEnabled ? [mailTabView] : []),
244
258
  { id: ASSISTANT_TAB_ID, label: t('助手'), icon: Bot },
245
259
  ]);
246
260
  store.setBeforeWorkspaceChange(async () => {
@@ -385,6 +399,24 @@ export function useWorkbench(props: WorkbenchProps, emit: (event: 'ready') => vo
385
399
  ]),
386
400
  );
387
401
 
402
+ function openMail() {
403
+ if (!mailEnabled) return;
404
+ if (navigationContext.value === 'home') personalPlanScope = plans.view;
405
+ calendar.rememberCalendar();
406
+ navigation.openInHome(MAIL_TAB_ID);
407
+ calendar.restoreCalendar();
408
+ if (!store.workspace) homeContent.value = MAIL_TAB_ID;
409
+ else store.openViewTab(MAIL_TAB_ID);
410
+ if (compactPanes.value) sidebar.value = false;
411
+ }
412
+ watch(
413
+ () => navigation.homeModule.value,
414
+ (mod) => {
415
+ if (!mailEnabled && mod === MAIL_TAB_ID) navigation.homeModule.value = 'plan';
416
+ },
417
+ { immediate: true },
418
+ );
419
+
388
420
  // Header / toolbar visibility item descriptors
389
421
  const sidebarNavigationItems = computed(() => [
390
422
  {
@@ -393,6 +425,16 @@ export function useWorkbench(props: WorkbenchProps, emit: (event: 'ready') => vo
393
425
  return t('计划');
394
426
  },
395
427
  },
428
+ ...(mailEnabled
429
+ ? [
430
+ {
431
+ id: MAIL_TAB_ID,
432
+ get label() {
433
+ return t('邮箱');
434
+ },
435
+ },
436
+ ]
437
+ : []),
396
438
  ...extensionViews
397
439
  .filter((view) => view.sidebar)
398
440
  .map((view) => ({ id: view.id, label: view.label })),
@@ -492,7 +534,7 @@ export function useWorkbench(props: WorkbenchProps, emit: (event: 'ready') => vo
492
534
  {
493
535
  id: 'calendar-events',
494
536
  get label() {
495
- return t('管理事件');
537
+ return t('已归档事项');
496
538
  },
497
539
  },
498
540
  ];
@@ -587,35 +629,26 @@ export function useWorkbench(props: WorkbenchProps, emit: (event: 'ready') => vo
587
629
  assistant.setManaged((id) => editing.isManaging(id));
588
630
  inlineRunner.setManaged((id) => editing.isManaging(id));
589
631
 
590
- const workspaceSync = createWorkspaceSync(store, extensions);
591
- function openSystemSync(event?: Event) {
592
- const id = (event as CustomEvent | undefined)?.detail?.workspaceId;
593
- if (!native || mobile || !store.workspace || store.isWeb || (id && id !== store.workspace.id))
594
- return;
595
- workspaceMenu.value = false;
596
- systemSyncPanel.value = true;
597
- void workspaceSync.action('status');
632
+ let reminderTimer: ReturnType<typeof setInterval> | undefined;
633
+ const reminderScheduler = new LocalReminderScheduler({
634
+ onRemind: (item) => {
635
+ store.report(t('日程提醒:{0}', [item.record.object.name]));
636
+ },
637
+ });
638
+ function checkPlanReminders() {
639
+ if (typeof document !== 'undefined' && document.visibilityState === 'hidden') return;
640
+ const now = new Date();
641
+ const windowStart = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 1);
642
+ const windowEnd = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 2);
643
+ const records = expandRecurringPlans(plans.recordsFor('all'), windowStart, windowEnd);
644
+ reminderScheduler.check(records, now.getTime());
598
645
  }
599
- let syncTimer: ReturnType<typeof setInterval> | undefined;
600
646
  onMounted(() => {
601
- window.addEventListener(syncEvent, openSystemSync);
602
- if (native && !mobile)
603
- syncTimer = setInterval(() => {
604
- void workspaceSync.tick();
605
- }, 30_000);
647
+ reminderTimer = setInterval(checkPlanReminders, 60_000);
606
648
  });
607
649
  onBeforeUnmount(() => {
608
- window.removeEventListener(syncEvent, openSystemSync);
609
- clearInterval(syncTimer);
610
- workspaceSync.reset();
650
+ clearInterval(reminderTimer);
611
651
  });
612
- watch(
613
- () => store.workspace?.id,
614
- () => {
615
- systemSyncPanel.value = false;
616
- workspaceSync.reset();
617
- },
618
- );
619
652
 
620
653
  const updates = useUpdatesStore();
621
654
  const updateLock = computed(() => ['downloading', 'installing'].includes(updates.state.phase));
@@ -679,7 +712,6 @@ export function useWorkbench(props: WorkbenchProps, emit: (event: 'ready') => vo
679
712
  activeWindow,
680
713
  editing,
681
714
  extensions,
682
- workspaceSync,
683
715
  attachments,
684
716
  localNative,
685
717
  compactPanes,
@@ -774,7 +806,6 @@ export function useWorkbench(props: WorkbenchProps, emit: (event: 'ready') => vo
774
806
  selectContext,
775
807
  openEntry: (file, newTab) => openEntry(file, newTab),
776
808
  openImport,
777
- showFileObject,
778
809
  createNewEntry: (kind, parent) => modals.createNewEntry(kind, parent),
779
810
  removeDocument: (target) => modals.removeDocument(target),
780
811
  removeDocuments: (entries) => modals.removeDocuments(entries),
@@ -812,43 +843,30 @@ export function useWorkbench(props: WorkbenchProps, emit: (event: 'ready') => vo
812
843
  markInitialPageRouteSuperseded: history.markInitialPageRouteSuperseded,
813
844
  });
814
845
 
815
- // Objects, plans & asset import
816
- const objectPanel = ref(false);
817
- // Keep drafts across close/reopen, but don't load the panel until it is first requested.
818
- const objectPanelMounted = ref(false);
819
- watch(
820
- objectPanel,
821
- (open) => {
822
- if (open) objectPanelMounted.value = true;
823
- },
824
- { flush: 'sync' },
825
- );
826
- const selectedObjectId = ref<string>();
827
- const selectedResourceIdentity = shallowRef<ReferenceIdentity>();
828
- const selectedPersonal = ref(false);
846
+ // Objects & plans
847
+ const objectDetail = shallowRef<{ record?: ObjectRecord; initialType?: string }>();
848
+ const planArchiveOpen = ref(false);
829
849
  const planDetail = shallowRef<ObjectRecord>();
830
- const assetInput = ref<HTMLInputElement>();
831
- const assetImportBusy = ref(false);
832
850
 
833
- function showObjects(id?: string) {
834
- selectedPersonal.value = false;
835
- selectedResourceIdentity.value = undefined;
836
- selectedObjectId.value = id;
837
- objectPanel.value = true;
851
+ function openObjectDetail(record: ObjectRecord) {
852
+ planDetail.value = undefined;
853
+ objectDetail.value = { record };
854
+ workspaceMenu.value = false;
855
+ if (compactPanes.value) sidebar.value = false;
856
+ }
857
+ function createPluginObject(initialType: string) {
858
+ planDetail.value = undefined;
859
+ objectDetail.value = { initialType };
838
860
  workspaceMenu.value = false;
839
861
  }
840
- function showFileObject(identity: ReferenceIdentity) {
841
- if (!['document', 'asset'].includes(identity.type)) return;
842
- selectedPersonal.value = false;
843
- selectedObjectId.value = undefined;
844
- selectedResourceIdentity.value = identity;
845
- objectPanel.value = true;
862
+ function openPlanArchive() {
863
+ planArchiveOpen.value = true;
846
864
  workspaceMenu.value = false;
847
865
  }
848
866
  function showPlanEvent(key: string) {
849
867
  const personal = plans.personal.find((item) => planKey(item) === key);
850
868
  const local = store.objects.find(
851
- (item) => item.object.id === key && ['event', 'task'].includes(item.object.type),
869
+ (item) => item.object.id === key && isPlanObject(item.object),
852
870
  );
853
871
  const record =
854
872
  personal ??
@@ -866,15 +884,11 @@ export function useWorkbench(props: WorkbenchProps, emit: (event: 'ready') => vo
866
884
  store.report(t('事项已不存在,请刷新计划后重试'));
867
885
  return;
868
886
  }
869
- objectPanel.value = false;
887
+ objectDetail.value = undefined;
870
888
  if (record.source?.scope === 'workspace') selectContext('workspace');
871
889
  planDetail.value = record;
872
890
  if (compactPanes.value) sidebar.value = false;
873
891
  }
874
- function managePlanEvents() {
875
- showObjects();
876
- selectedPersonal.value = plans.view === 'personal';
877
- }
878
892
  async function openBreadcrumbDirectory(path: string, newTab = false) {
879
893
  const home = tree.folderHomes.value.get(path);
880
894
  if (home) await openEntry(home, newTab);
@@ -890,8 +904,9 @@ export function useWorkbench(props: WorkbenchProps, emit: (event: 'ready') => vo
890
904
  const handler = fileHandlers.resolve(file.path);
891
905
  if (isObjectPath(file.path)) {
892
906
  const record = store.objects.find((item) => item.path === file.path);
893
- if (record) showObjects(record.object.id);
894
- else store.report(t('对象文件不可用,请在工作区对象面板检查格式或重复 ID'));
907
+ if (!record) store.report(t('对象文件不可用,请检查格式或是否存在重复 ID'));
908
+ else if (isPlanObject(record.object)) showPlanEvent(record.object.id);
909
+ else openObjectDetail(record);
895
910
  return;
896
911
  }
897
912
  if (handler.preview === 'markdown' || handler.preview === 'table') {
@@ -912,39 +927,39 @@ export function useWorkbench(props: WorkbenchProps, emit: (event: 'ready') => vo
912
927
  async function openReference(identity: ReferenceIdentity) {
913
928
  const result = resolveReference(store.referenceTargets, identity);
914
929
  if (!result.target) {
930
+ if (result.error === 'unregistered') {
931
+ const legacy = store.objects.find(
932
+ (item) => item.object.type === identity.type && item.object.id === identity.id,
933
+ );
934
+ if (legacy) {
935
+ openObjectDetail(legacy);
936
+ return;
937
+ }
938
+ }
915
939
  store.report(t('当前工作区中引用目标不可用,请检查对象是否被移除或 ID 是否重复'));
916
940
  return;
917
941
  }
918
- if (identity.type !== 'document') {
919
- if (['event', 'task'].includes(identity.type)) showPlanEvent(identity.id);
920
- else if (['document', 'asset'].includes(identity.type)) showFileObject(identity);
921
- else showObjects(identity.id);
942
+ if (identity.type === 'document' || identity.type === 'asset') {
943
+ const file = workspace.value?.files.find(
944
+ (file) => file.id === identity.id && file.path === result.target!.path,
945
+ ) ?? workspace.value?.files.find((file) => file.id === identity.id);
946
+ if (file) await openEntry(file);
922
947
  return;
923
948
  }
924
- const file = workspace.value?.files.find((file) => file.id === identity.id);
925
- if (file) await openEntry(file);
926
- }
927
- async function openObjectResource(identity: ReferenceIdentity) {
928
- const result = resolveReference(store.referenceTargets, identity);
929
- if (!result.target || !['document', 'asset'].includes(identity.type)) return;
930
- const file = workspace.value?.files.find(
931
- (file) => file.id === identity.id && file.path === result.target!.path,
949
+ if (isPlanObjectType(identity.type)) {
950
+ showPlanEvent(identity.id);
951
+ return;
952
+ }
953
+ const record = store.objects.find(
954
+ (item) => item.object.type === identity.type && item.object.id === identity.id,
932
955
  );
933
- if (!file) return;
934
- if (identity.type === 'document') objectPanel.value = false;
935
- await openEntry(file);
956
+ if (record) openObjectDetail(record);
936
957
  }
937
958
  async function openObjectReference(identity: ReferenceIdentity) {
938
- if (identity.type === 'document') objectPanel.value = false;
959
+ if (identity.type === 'document' || identity.type === 'asset' || isPlanObjectType(identity.type))
960
+ objectDetail.value = undefined;
939
961
  await openReference(identity);
940
962
  }
941
- async function openWorkspaceViewSourceFile(file: FileEntry) {
942
- if (isMarkdown(file.path) || isDataTableFilePath(file.path)) await openEntry(file);
943
- else store.openAttachmentInNewTab(file);
944
- }
945
- function openWorkspaceViewSourceObject(identity: ReferenceIdentity) {
946
- void openObjectReference(identity);
947
- }
948
963
  async function openPlanReference(identity: ReferenceIdentity) {
949
964
  const current = planDetail.value;
950
965
  if (current?.source?.scope === 'personal') {
@@ -961,40 +976,6 @@ export function useWorkbench(props: WorkbenchProps, emit: (event: 'ready') => vo
961
976
  if (docSource && identity.type === 'document' && identity.id === docSource.fileId)
962
977
  await docs.revealAssistantSelection(docSource);
963
978
  }
964
- async function importObjectAssets(event: Event) {
965
- const inputEl = event.target as HTMLInputElement;
966
- const files = Array.from(inputEl.files ?? []);
967
- inputEl.value = '';
968
- const selectedWorkspace = workspace.value;
969
- if (
970
- !attachments ||
971
- !selectedWorkspace ||
972
- selectedWorkspace.readOnly ||
973
- !store.capabilities.features.objectReferences ||
974
- assetImportBusy.value
975
- )
976
- return;
977
- assetImportBusy.value = true;
978
- try {
979
- for (const file of files) {
980
- if (workspace.value?.id !== selectedWorkspace.id)
981
- throw new Error(t('工作区已切换,已导入的资产保留在原工作区'));
982
- await attachments.importAttachment(selectedWorkspace.id, '', file, false);
983
- }
984
- } catch (error) {
985
- store.report(error);
986
- } finally {
987
- if (workspace.value?.id === selectedWorkspace.id) await store.refresh();
988
- assetImportBusy.value = false;
989
- }
990
- }
991
- function assetPreview(target: ReferenceTarget) {
992
- return attachments &&
993
- target.type === 'asset' &&
994
- ['image/png', 'image/jpeg', 'image/gif', 'image/webp'].includes(target.mime ?? '')
995
- ? attachments.imageUrl(workspace.value, '', relativeWorkspaceReference('', target.path))
996
- : null;
997
- }
998
979
 
999
980
  // Settings window / tab / modal
1000
981
  const settingsPage = ref<SettingsPageId>(readSettingsPage());
@@ -1194,7 +1175,8 @@ export function useWorkbench(props: WorkbenchProps, emit: (event: 'ready') => vo
1194
1175
  commandPaletteOpened,
1195
1176
  importPanel,
1196
1177
  agentPanel,
1197
- objectPanel,
1178
+ objectDetail,
1179
+ planArchiveOpen,
1198
1180
  recyclePanel,
1199
1181
  historyPanel,
1200
1182
  historyPage,
@@ -1235,7 +1217,6 @@ export function useWorkbench(props: WorkbenchProps, emit: (event: 'ready') => vo
1235
1217
  toggleWorkspaceMenu,
1236
1218
  selectModule,
1237
1219
  openCalendar: calendar.openCalendar,
1238
- openSystemSync,
1239
1220
  openSettings,
1240
1221
  closeFileContextMenu: tree.closeFileContextMenu,
1241
1222
  closeDirectoryContextMenu: tree.closeDirectoryContextMenu,
@@ -1360,7 +1341,8 @@ export function useWorkbench(props: WorkbenchProps, emit: (event: 'ready') => vo
1360
1341
  importPanel.value ||
1361
1342
  templateLibraryOpen.value ||
1362
1343
  agentPanel.value ||
1363
- objectPanel.value ||
1344
+ objectDetail.value ||
1345
+ planArchiveOpen.value ||
1364
1346
  selectedDiff.value ||
1365
1347
  inlineAssist.selectionTodo.value ||
1366
1348
  recyclePanel.value ||
@@ -1526,7 +1508,7 @@ export function useWorkbench(props: WorkbenchProps, emit: (event: 'ready') => vo
1526
1508
  fileDragStart: tree.fileDragStart,
1527
1509
  finishTreeRename: tree.finishTreeRename,
1528
1510
  noteCount,
1529
- showObjects,
1511
+ createPluginObject,
1530
1512
  sidebarCalendarDate: calendar.sidebarCalendarDate,
1531
1513
  openCalendar: calendar.openCalendar,
1532
1514
  showPlanEvent,
@@ -1566,7 +1548,6 @@ export function useWorkbench(props: WorkbenchProps, emit: (event: 'ready') => vo
1566
1548
  extensions,
1567
1549
  extensionActions,
1568
1550
  commandPaletteOpened,
1569
- openSystemSync,
1570
1551
  openImport,
1571
1552
  openTemplateLibrary,
1572
1553
  openSettings,
@@ -1622,7 +1603,6 @@ export function useWorkbench(props: WorkbenchProps, emit: (event: 'ready') => vo
1622
1603
  touchLayout,
1623
1604
  showOutline: outlineCtrl.showOutline,
1624
1605
  touchOutlineOpen: outlineCtrl.touchOutlineOpen,
1625
- panel: outlineCtrl.panel,
1626
1606
  isTableTab,
1627
1607
  calendarToolItems,
1628
1608
  calendarPeriod: calendar.calendarPeriod,
@@ -1633,7 +1613,7 @@ export function useWorkbench(props: WorkbenchProps, emit: (event: 'ready') => vo
1633
1613
  calendarModeOptions: calendar.calendarModeOptions,
1634
1614
  calendarMode: calendar.calendarMode,
1635
1615
  selectCalendarMode: calendar.selectCalendarMode,
1636
- managePlanEvents,
1616
+ openPlanArchive,
1637
1617
  documentSuggestions,
1638
1618
  editing,
1639
1619
  suggestionModeBusy,
@@ -1683,14 +1663,16 @@ export function useWorkbench(props: WorkbenchProps, emit: (event: 'ready') => vo
1683
1663
  tableFileId,
1684
1664
  openAssistant: inlineAssist.openAssistant,
1685
1665
  parentPath,
1686
- openWorkspaceViewSourceFile,
1687
- openWorkspaceViewSourceObject,
1688
1666
  calendarScope: calendar.calendarScope,
1689
1667
  plans,
1690
1668
  showCalendarDay: calendar.showCalendarDay,
1691
1669
  showCalendarMonth: calendar.showCalendarMonth,
1692
1670
  openAssistantPage,
1693
1671
  SETTINGS_TAB_ID,
1672
+ MAIL_TAB_ID,
1673
+ mailEnabled,
1674
+ mailTabView,
1675
+ openMail,
1694
1676
  selectedVisualFontFamily: prefs.selectedVisualFontFamily,
1695
1677
  visualFontSize: prefs.visualFontSize,
1696
1678
  setPaneSearch: docs.setPaneSearch,
@@ -1776,25 +1758,14 @@ export function useWorkbench(props: WorkbenchProps, emit: (event: 'ready') => vo
1776
1758
  toggleOutlineSide: outlineCtrl.toggleOutlineSide,
1777
1759
  importPanel,
1778
1760
  importRecords,
1779
- systemSyncPanel,
1780
- workspaceSync,
1781
1761
  active,
1782
- importObjectAssets,
1783
- objectPanelMounted,
1784
- objectPanel,
1785
- selectedObjectId,
1786
- selectedResourceIdentity,
1787
- selectedPersonal,
1788
- assetImportBusy,
1789
- assetPreview,
1790
- openObjectResource,
1762
+ objectDetail,
1763
+ planArchiveOpen,
1791
1764
  openObjectReference,
1792
- assetInput,
1793
1765
  planDetail,
1794
1766
  openPlanReference,
1795
1767
  selectionTodo: inlineAssist.selectionTodo,
1796
1768
  workbenchCommands,
1797
- settingsWorkspace,
1798
1769
  openingSettingsWindow,
1799
1770
  openSettingsTab,
1800
1771
  openSettingsInNewWindow,
@@ -43,7 +43,12 @@ export const AssistantPanel = defineAsyncComponent(
43
43
  export const DiffDialog = defineAsyncComponent(() => import('../documents/components/DiffDialog.vue'));
44
44
  export const MobileRecycle = defineAsyncComponent(() => import('./components/MobileRecycle.vue'));
45
45
  export const SettingsPanel = defineAsyncComponent(() => import('../settings/components/SettingsPanel.vue'));
46
- export const ObjectPanel = defineAsyncComponent(() => import('../objects/components/ObjectPanel.vue'));
46
+ export const ObjectDetailModal = defineAsyncComponent(
47
+ () => import('../objects/components/ObjectDetailModal.vue'),
48
+ );
49
+ export const PlanArchiveDialog = defineAsyncComponent(
50
+ () => import('../plans/components/PlanArchiveDialog.vue'),
51
+ );
47
52
  export const PlanDetailPanel = defineAsyncComponent(
48
53
  () => import('../plans/components/PlanDetailPanel.vue'),
49
54
  );
@@ -58,14 +63,18 @@ export const CalendarView = loadingComponent(
58
63
  () => import('../plans/components/CalendarView.vue'),
59
64
  'document',
60
65
  );
66
+ export const MailWorkspaceView = loadingComponent(
67
+ () => import('../mail/components/MailWorkspaceView.vue'),
68
+ 'document',
69
+ );
70
+ export const SidebarMail = loadingComponent(
71
+ () => import('../mail/components/SidebarMail.vue'),
72
+ 'tree',
73
+ );
61
74
  export const DataTablePage = loadingComponent(
62
75
  () => import('../data-tables/components/DataTablePage.vue'),
63
76
  'spreadsheet',
64
77
  );
65
- export const WorkspaceViewTab = loadingComponent(
66
- () => import('./components/WorkspaceViewTab.vue'),
67
- 'document',
68
- );
69
78
  export const PluginInstaller = defineAsyncComponent(
70
79
  () => import('../plugins/components/PluginInstaller.vue'),
71
80
  );