@tano.page/workbench 0.14.0 → 0.16.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 (248) hide show
  1. package/package.json +50 -16
  2. package/src/App.vue +82 -752
  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/agent-identities.ts +1 -97
  17. package/src/assistant/agent-task-context.ts +1 -54
  18. package/src/assistant/attachments.ts +1 -1
  19. package/src/assistant/completion.ts +1 -61
  20. package/src/assistant/components/AssistantChangeList.vue +98 -21
  21. package/src/assistant/components/AssistantPanel.vue +425 -8
  22. package/src/assistant/components/PluginToolProposalCard.vue +235 -0
  23. package/src/assistant/connection-actions.ts +237 -0
  24. package/src/assistant/document-mentions.ts +1 -33
  25. package/src/assistant/engine.ts +1 -532
  26. package/src/assistant/execution.ts +6 -33
  27. package/src/assistant/files.ts +5 -13
  28. package/src/assistant/hash.ts +1 -4
  29. package/src/assistant/inbox.ts +1 -148
  30. package/src/assistant/language.ts +10 -37
  31. package/src/assistant/mention-autocomplete.ts +69 -0
  32. package/src/assistant/plugin-bridge-builder.ts +146 -0
  33. package/src/assistant/prompts.ts +1 -58
  34. package/src/assistant/proposal-actions.ts +336 -0
  35. package/src/assistant/results.ts +20 -86
  36. package/src/assistant/store.ts +167 -327
  37. package/src/assistant/structures.ts +1 -155
  38. package/src/assistant/tasks.ts +8 -96
  39. package/src/assistant/tool-rules.ts +1 -7
  40. package/src/assistant/workspace-bridge.ts +1 -1
  41. package/src/composables/use-document-actions.ts +38 -20
  42. package/src/composables/use-file-tree-controller.ts +7 -12
  43. package/src/composables/use-workbench-help.ts +177 -0
  44. package/src/composables/use-workbench-history.ts +2 -4
  45. package/src/composables/use-workbench-lifecycle.ts +249 -0
  46. package/src/composables/use-workbench-modals.ts +6 -1
  47. package/src/composables/use-workbench-outline.ts +0 -5
  48. package/src/composables/use-workbench-settings.ts +185 -0
  49. package/src/composables/use-workbench-shortcuts.ts +40 -1021
  50. package/src/composables/use-workbench-views.ts +325 -0
  51. package/src/data-tables/data-tables.ts +1 -2
  52. package/src/documents/components/DocumentActionMenu.vue +279 -0
  53. package/src/documents/components/DocumentHistoryPanel.vue +3 -1
  54. package/src/documents/components/DocumentInspector.vue +168 -0
  55. package/src/documents/components/DocumentPane.vue +482 -0
  56. package/src/documents/description-merge.ts +1 -9
  57. package/src/features.ts +1 -0
  58. package/src/files/components/FileMetadataPanel.vue +49 -15
  59. package/src/fonts/Inter-Latin-Italic.woff2 +0 -0
  60. package/src/fonts/Inter-Latin.woff2 +0 -0
  61. package/src/fonts/TanoUISansSC-Bold.woff2 +0 -0
  62. package/src/fonts/TanoUISansSC-Medium.woff2 +0 -0
  63. package/src/fonts/TanoUISansSC-Regular.woff2 +0 -0
  64. package/src/help/help-milestones.ts +3 -5
  65. package/src/i18n/locale-catalogs.ts +7 -6
  66. package/src/i18n/locale-registry.ts +8 -6
  67. package/src/i18n/locales/de-DE.json +371 -3
  68. package/src/i18n/locales/en-US.json +371 -2
  69. package/src/i18n/locales/es-ES.json +371 -3
  70. package/src/i18n/locales/ja-JP.json +370 -2
  71. package/src/i18n/locales/zh-TW.json +370 -2
  72. package/src/mail/components/MailAccountDialog.vue +450 -0
  73. package/src/mail/components/MailComposerDialog.vue +326 -0
  74. package/src/mail/components/MailProviderIcon.vue +30 -0
  75. package/src/mail/components/MailWorkspaceView.vue +821 -0
  76. package/src/mail/components/SidebarMail.vue +134 -0
  77. package/src/mail/mail-avatar.ts +17 -0
  78. package/src/mail/mail-bridge.ts +68 -0
  79. package/src/mail/mail-calendar.ts +208 -0
  80. package/src/mail/mail-markdown.ts +195 -0
  81. package/src/mail/types.ts +226 -0
  82. package/src/objects/components/ObjectDetailModal.vue +1001 -0
  83. package/src/objects/content-references.ts +6 -56
  84. package/src/objects/wiki-links.ts +1 -48
  85. package/src/objects/workspace-objects.ts +3 -4
  86. package/src/plan-sync/types.ts +6 -3
  87. package/src/plans/calendar-interaction.ts +194 -0
  88. package/src/plans/calendar.ts +65 -9
  89. package/src/plans/components/CalendarAgendaView.vue +165 -0
  90. package/src/plans/components/CalendarDayPopover.vue +172 -39
  91. package/src/plans/components/CalendarFilterBar.vue +128 -0
  92. package/src/plans/components/CalendarMonthView.vue +224 -0
  93. package/src/plans/components/CalendarQuickCreateDialog.vue +269 -0
  94. package/src/plans/components/CalendarTimelineView.vue +517 -0
  95. package/src/plans/components/CalendarTopbarControls.vue +101 -0
  96. package/src/plans/components/CalendarView.vue +264 -748
  97. package/src/plans/components/CalendarYearView.vue +138 -0
  98. package/src/plans/components/PlanArchiveDialog.vue +295 -0
  99. package/src/plans/components/PlanConnectionsDialog.vue +1 -1
  100. package/src/plans/components/PlanDateField.vue +6 -4
  101. package/src/plans/components/PlanDetailPanel.vue +227 -32
  102. package/src/plans/components/PlanEventList.vue +16 -4
  103. package/src/plans/components/SidebarPlan.vue +22 -15
  104. package/src/plans/components/TaskRepeatControls.vue +169 -30
  105. package/src/plans/components/calendar-shared.css +192 -0
  106. package/src/plans/composables/use-calendar-interactions.ts +396 -0
  107. package/src/plans/composables/use-calendar-scroll.ts +420 -0
  108. package/src/plans/local-reminders.ts +149 -0
  109. package/src/plans/personal-plans.ts +10 -1
  110. package/src/plans/plan-date.ts +8 -1
  111. package/src/plans/plan-migration.ts +95 -0
  112. package/src/plans/recurrence.ts +95 -0
  113. package/src/plans/task-repeat.ts +8 -8
  114. package/src/plans/timeline-layout.ts +92 -0
  115. package/src/plugins/assistant-bridge.ts +520 -0
  116. package/src/plugins/attachment-reader.ts +3 -1
  117. package/src/plugins/cache-storage.ts +42 -2
  118. package/src/plugins/components/PluginAutomations.vue +3 -3
  119. package/src/plugins/components/PluginCatalogBrowser.vue +17 -8
  120. package/src/plugins/components/PluginChangeSummary.vue +16 -3
  121. package/src/plugins/components/PluginConnections.vue +1 -1
  122. package/src/plugins/components/PluginCustomView.vue +2 -2
  123. package/src/plugins/components/PluginDetailPage.vue +136 -57
  124. package/src/plugins/components/PluginDeveloperArea.vue +192 -0
  125. package/src/plugins/components/PluginDocumentSlot.vue +63 -0
  126. package/src/plugins/components/PluginExplorer.vue +21 -25
  127. package/src/plugins/components/PluginImportDialog.vue +410 -0
  128. package/src/plugins/components/PluginInstaller.vue +273 -288
  129. package/src/plugins/components/PluginListItem.vue +3 -0
  130. package/src/plugins/components/PluginMaintenance.vue +37 -34
  131. package/src/plugins/components/PluginRepositoryStorage.vue +4 -2
  132. package/src/plugins/components/PluginRuntimePanel.vue +3 -3
  133. package/src/plugins/components/PluginSettingsForm.vue +112 -0
  134. package/src/plugins/components/PluginStatusBar.vue +161 -0
  135. package/src/plugins/components/PluginSurface.vue +18 -6
  136. package/src/plugins/components/PluginUiDialog.vue +452 -0
  137. package/src/plugins/components/PluginsTabPage.vue +61 -0
  138. package/src/plugins/components/plugin-center.css +5 -0
  139. package/src/plugins/data.ts +9 -86
  140. package/src/plugins/editor-plugin-adapters.ts +169 -0
  141. package/src/plugins/excalidraw/bundle.tano-plugin.json +1 -1
  142. package/src/plugins/excalidraw/manifest.json +12 -1
  143. package/src/plugins/host.ts +662 -43
  144. package/src/plugins/native.ts +2 -10
  145. package/src/plugins/overlay-mapping.ts +125 -0
  146. package/src/plugins/packages.ts +73 -1
  147. package/src/plugins/plugin-data.ts +2 -3
  148. package/src/plugins/plugin-permissions.ts +57 -0
  149. package/src/plugins/plugin-rpc-router.ts +558 -0
  150. package/src/plugins/plugin-sdk.ts +1 -94
  151. package/src/plugins/plugin-ui-dialogs.ts +167 -0
  152. package/src/plugins/policy.ts +53 -3
  153. package/src/plugins/presentation-preview/bundle.tano-plugin.json +1 -1
  154. package/src/plugins/presentation-preview/manifest.json +2 -1
  155. package/src/plugins/queries.ts +1 -73
  156. package/src/plugins/sandbox.ts +15 -1
  157. package/src/plugins/use-plugin-actions.ts +67 -20
  158. package/src/plugins/user-plugins.ts +254 -0
  159. package/src/plugins/view-header.ts +2 -7
  160. package/src/plugins/word-preview/bundle.tano-plugin.json +1 -1
  161. package/src/plugins/word-preview/manifest.json +13 -1
  162. package/src/plugins/workbench.ts +175 -2
  163. package/src/plugins/worker.js +105 -8
  164. package/src/plugins/workspace-plugin-runtime.ts +23 -7
  165. package/src/plugins/workspace-plugins.ts +212 -21
  166. package/src/runtime.ts +103 -4
  167. package/src/settings/components/SettingsAppearancePage.vue +46 -0
  168. package/src/settings/components/SettingsDocumentsPage.vue +0 -1
  169. package/src/settings/components/SettingsPanel.vue +8 -3
  170. package/src/settings/components/WorkbenchSettings.vue +20 -7
  171. package/src/settings/components/settings-context.ts +1 -1
  172. package/src/settings/components/settings-search.ts +2 -3
  173. package/src/settings/settings-tab.ts +1 -0
  174. package/src/shell/command-palette.ts +3 -3
  175. package/src/shell/components/EditorToolbar.vue +8 -9
  176. package/src/shell/components/EditorTools.vue +1 -5
  177. package/src/shell/components/PaneTopbar.vue +393 -0
  178. package/src/shell/components/SelectionToolbar.vue +0 -2
  179. package/src/shell/components/SidebarNavigation.vue +22 -2
  180. package/src/shell/components/WorkbenchContextMenus.vue +58 -34
  181. package/src/shell/components/WorkbenchModals.vue +47 -62
  182. package/src/shell/components/WorkbenchPanes.vue +371 -1342
  183. package/src/shell/components/WorkbenchSidebar.vue +486 -0
  184. package/src/shell/components/WorkspaceBreadcrumb.vue +6 -14
  185. package/src/shell/components/WorkspaceViewSwitcher.vue +12 -7
  186. package/src/shell/pane-registry.ts +69 -0
  187. package/src/shell/use-surface-dismissal.ts +219 -0
  188. package/src/shell/use-workbench-commands.ts +599 -0
  189. package/src/shell/use-workbench-keybindings.ts +337 -0
  190. package/src/shell/use-workbench.ts +531 -1153
  191. package/src/shell/workbench-async-components.ts +14 -5
  192. package/src/shell/workbench-context.ts +30 -3
  193. package/src/stores/mail.ts +414 -0
  194. package/src/stores/plan-sync.ts +2 -1
  195. package/src/stores/plans.ts +2 -9
  196. package/src/stores/workspace-document-io.ts +807 -0
  197. package/src/stores/workspace-file-ops.ts +1 -1
  198. package/src/stores/workspace-knowledge.ts +2 -114
  199. package/src/stores/workspace-lifecycle.ts +459 -0
  200. package/src/stores/workspace-plugins-state.ts +254 -259
  201. package/src/stores/workspace-session.ts +287 -0
  202. package/src/stores/workspace-tabs-layout.ts +6 -44
  203. package/src/stores/workspace-types.ts +50 -0
  204. package/src/stores/workspace.ts +184 -1363
  205. package/src/styles/agent-diff-modals.css +0 -7
  206. package/src/styles/dark-theme.css +3 -3
  207. package/src/styles/inspector.css +0 -59
  208. package/src/styles/layout-themes.css +346 -0
  209. package/src/styles/mail.css +1568 -0
  210. package/src/styles/mobile.css +2 -2
  211. package/src/styles/recent-and-media.css +0 -17
  212. package/src/styles/theme-contract.css +3 -3
  213. package/src/styles/workbench-shell.css +110 -17
  214. package/src/styles/workspace-states.css +9 -33
  215. package/src/styles.css +0 -1
  216. package/src/tabs/components/DesktopTabs.vue +19 -14
  217. package/src/tabs/components/NewTabPicker.vue +10 -4
  218. package/src/tabs/tab-label.ts +0 -1
  219. package/src/windows/AuxiliaryWindows.vue +2 -2
  220. package/src/windows/use-window-event-bridge.ts +152 -0
  221. package/src/workspace/components/TemplateLibrary.vue +1 -1
  222. package/src/workspace/components/WorkspaceGeneralSettings.vue +0 -13
  223. package/src/workspace/components/WorkspaceIconPicker.vue +30 -7
  224. package/src/workspace/components/WorkspacePickerMenu.vue +317 -0
  225. package/src/workspace/workspace-comments.ts +11 -151
  226. package/src/workspace/workspace-welcome.ts +1 -1
  227. package/src/assistant/locales/de-DE.json +0 -126
  228. package/src/assistant/locales/en-US.json +0 -126
  229. package/src/assistant/locales/es-ES.json +0 -126
  230. package/src/assistant/locales/ja-JP.json +0 -126
  231. package/src/assistant/locales/zh-CN.json +0 -126
  232. package/src/assistant/locales/zh-TW.json +0 -126
  233. package/src/assistant/task-prompts.json +0 -39
  234. package/src/documents/components/FormulaMenu.vue +0 -50
  235. package/src/files/components/FileDatabasePage.vue +0 -152
  236. package/src/files/components/FolderHomeIcon.vue +0 -12
  237. package/src/objects/components/ObjectDatabasePage.vue +0 -100
  238. package/src/objects/components/ObjectPanel.vue +0 -554
  239. package/src/plans/components/PersonalPlanDialog.vue +0 -105
  240. package/src/shell/components/WorkspaceViewPage.vue +0 -127
  241. package/src/shell/components/WorkspaceViewTab.vue +0 -24
  242. package/src/styles/object-panel.css +0 -163
  243. package/src/workspace/components/GitInspectionPanel.vue +0 -35
  244. package/src/workspace/components/WorkspaceSyncPanel.vue +0 -50
  245. package/src/workspace/welcome-slogans.ts +0 -11
  246. package/src/workspace/workspace-git.ts +0 -35
  247. package/src/workspace/workspace-sync.ts +0 -46
  248. package/src/workspace/workspace-views.ts +0 -48
@@ -4,6 +4,7 @@ const { window, document } = useWindowContext();
4
4
 
5
5
  import { vSurfaceMotion } from '@tano/editor/surface-motion';
6
6
  import { computed, ref, watch, onMounted, onBeforeUnmount } from 'vue';
7
+ import { X } from 'lucide-vue-next';
7
8
  import { useWorkspaceStore } from '../../stores/workspace';
8
9
  import type { FileMetadataState } from '../file-metadata';
9
10
  import { t } from '../../i18n/i18n';
@@ -13,6 +14,11 @@ const props = defineProps<{ fileId: string; workspaceId: string }>();
13
14
  const emit = defineEmits<{ close: [] }>();
14
15
  const store = useWorkspaceStore();
15
16
  const file = computed(() => store.workspace?.id === props.workspaceId ? store.fileRegistry?.get(props.fileId) : undefined);
17
+ function formatSize(bytes: number): string {
18
+ if (bytes < 1024) return `${bytes} B`;
19
+ if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
20
+ return `${(bytes / (1024 * 1024)).toFixed(2)} MB`;
21
+ }
16
22
  const state = ref<FileMetadataState>();
17
23
  const tags = ref(''); const properties = ref('{}'); const error = ref(''); const busy = ref(false);
18
24
  const owner = ref(''); const status = ref(''); const linkTarget = ref('');
@@ -81,27 +87,37 @@ async function save() {
81
87
  <div v-surface-motion="'FileMetadataPanel:0'" class="file-metadata-backdrop" @click.self="!busy && emit('close')" @keydown.esc.stop="!busy && emit('close')">
82
88
  <section ref="panel" role="dialog" aria-modal="true" :aria-label="t('文件属性')" class="file-metadata-panel" @keydown="trapFocus">
83
89
  <div ref="scrollElement" class="file-metadata-scroll"><div>
84
- <div class="heading"><strong>{{ t('文件属性') }}</strong><button :disabled="busy" @click="emit('close')">{{ t('关闭') }}</button></div>
90
+ <div class="heading"><h2>{{ t('文件属性') }}</h2><button type="button" class="icon-button" :aria-label="t('关闭')" :disabled="busy" @click="emit('close')"><X :size="18" /></button></div>
85
91
  <template v-if="file">
86
- <dl><dt>{{ t('路径') }}</dt><dd>{{ file.path }}</dd><dt>File ID</dt><dd>{{ file.id }}</dd><dt>MIME</dt><dd>{{ file.mimeType }}</dd><dt>{{ t('大小') }}</dt><dd>{{ file.size }} bytes</dd><dt>SHA-256</dt><dd>{{ file.revision || '—' }}</dd></dl>
87
- <p v-if="isMarkdown(file.path)">{{ t('Markdown 属性在文档内编辑,关联来自正文引用。') }}</p>
92
+ <dl class="summary-meta"><dt>{{ t('路径') }}</dt><dd>{{ file.path }}</dd><dt>{{ t('大小') }}</dt><dd>{{ formatSize(file.size) }}</dd></dl>
93
+ <p v-if="isMarkdown(file.path)" class="meta-hint">{{ t('Markdown 属性在文档内编辑,关联来自正文引用。') }}</p>
88
94
  <template v-else>
89
95
  <form @submit.prevent="save">
90
96
  <label>{{ t('负责人') }}<input v-model="owner" :disabled="busy || !state || store.workspace?.readOnly || file.readOnly" maxlength="200" /></label>
91
97
  <label>{{ t('状态') }}<input v-model="status" list="file-status-options" :disabled="busy || !state || store.workspace?.readOnly || file.readOnly" maxlength="100" /></label>
92
98
  <datalist id="file-status-options"><option>{{ t('待处理') }}</option><option>{{ t('进行中') }}</option><option>{{ t('已完成') }}</option></datalist>
93
99
  <label>{{ t('标签(逗号分隔)') }}<input v-model="tags" :disabled="busy || !state || workspaceId !== store.workspace?.id || store.workspace?.readOnly || file.readOnly" /></label>
94
- <label>{{ t('属性(JSON)') }}<textarea class="panel-scrollbar" v-model="properties" rows="8" :disabled="busy || !state || store.workspace?.readOnly || file.readOnly" spellcheck="false" /></label>
95
- <button type="submit" :disabled="busy || !state || store.workspace?.readOnly || file.readOnly">{{ t('保存') }}</button>
100
+ <details class="technical-details">
101
+ <summary>{{ t('技术详情') }}</summary>
102
+ <dl class="tech-meta"><dt>File ID</dt><dd><code>{{ file.id }}</code></dd><dt>MIME</dt><dd><code>{{ file.mimeType }}</code></dd><dt>SHA-256</dt><dd><code>{{ file.revision || '—' }}</code></dd></dl>
103
+ <label>{{ t('属性(JSON)') }}<textarea class="panel-scrollbar" v-model="properties" rows="6" :disabled="busy || !state || store.workspace?.readOnly || file.readOnly" spellcheck="false" /></label>
104
+ </details>
105
+ <div class="form-actions"><button type="submit" class="primary-button" :disabled="busy || !state || store.workspace?.readOnly || file.readOnly">{{ t('保存') }}</button></div>
96
106
  </form>
97
- <section :aria-label="t('关联对象')">
107
+ <section class="relations-section" :aria-label="t('关联对象')">
98
108
  <h3>{{ t('关联对象') }}</h3>
99
- <ul><li v-for="row in links" :key="row.id">{{ targets.find(target => referenceKey(target) === referenceKey(linkedTarget(row)))?.name ?? referenceKey(linkedTarget(row)) }} <button :disabled="busy || store.workspace?.readOnly" @click="removeLink(row)">{{ t('移除关联') }}</button></li></ul>
100
- <label>{{ t('选择对象') }}<select v-model="linkTarget" :aria-label="t('选择对象')" :disabled="busy || store.workspace?.readOnly || !store.capabilities.features.objectReferences"><option value="">{{ t('选择对象') }}</option><option v-for="target in targets" :key="referenceKey(target)" :value="referenceKey(target)">{{ target.name }} · {{ target.type }}</option></select></label>
101
- <button :disabled="busy || !linkTarget || store.workspace?.readOnly" @click="addLink">{{ t('添加关联') }}</button>
102
- <p v-if="!store.capabilities.features.objectReferences">{{ t('请在工作区设置中启用「工作区对象与引用」。') }}</p>
109
+ <ul v-if="links.length" class="link-list"><li v-for="row in links" :key="row.id"><span>{{ targets.find(target => referenceKey(target) === referenceKey(linkedTarget(row)))?.name ?? referenceKey(linkedTarget(row)) }}</span><button type="button" class="secondary-button" :disabled="busy || store.workspace?.readOnly" @click="removeLink(row)">{{ t('移除关联') }}</button></li></ul>
110
+ <div class="link-picker">
111
+ <select v-model="linkTarget" :aria-label="t('选择对象')" :disabled="busy || store.workspace?.readOnly || !store.capabilities.features.objectReferences"><option value="">{{ t('选择对象') }}</option><option v-for="target in targets" :key="referenceKey(target)" :value="referenceKey(target)">{{ target.name }} · {{ target.type }}</option></select>
112
+ <button type="button" class="secondary-button" :disabled="busy || !linkTarget || store.workspace?.readOnly" @click="addLink">{{ t('添加关联') }}</button>
113
+ </div>
114
+ <p v-if="!store.capabilities.features.objectReferences" class="meta-hint">{{ t('请在工作区设置中启用「工作区对象与引用」。') }}</p>
103
115
  </section>
104
116
  </template>
117
+ <details v-if="isMarkdown(file.path)" class="technical-details">
118
+ <summary>{{ t('技术详情') }}</summary>
119
+ <dl class="tech-meta"><dt>File ID</dt><dd><code>{{ file.id }}</code></dd><dt>MIME</dt><dd><code>{{ file.mimeType }}</code></dd><dt>SHA-256</dt><dd><code>{{ file.revision || '—' }}</code></dd></dl>
120
+ </details>
105
121
  </template>
106
122
  <p v-else role="status">{{ t('文件已移动或删除。') }}</p>
107
123
  <p v-if="error" role="alert">{{ error }}</p>
@@ -113,9 +129,27 @@ async function save() {
113
129
  <style scoped>
114
130
  .file-metadata-backdrop { position: fixed; inset: 0; z-index: 1200; background: #0006; display: grid; place-items: center; padding: 16px; }
115
131
  .file-metadata-panel { background: var(--surface, var(--paper)); color: var(--text); width: min(520px, 100%); max-height: 90dvh; overflow: hidden; display: flex; padding: 0; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px #0003; }
116
- .file-metadata-scroll { flex: 1; min-width: 0; min-height: 0; overflow: auto; padding: 24px; }
117
- .heading { display: flex; justify-content: space-between; align-items: center; }
118
- dl { display: grid; grid-template-columns: 80px 1fr; gap: 8px; font-size: 13px; } dt { color: var(--muted); } dd { margin: 0; overflow-wrap: anywhere; }
119
- label { display: grid; gap: 6px; margin: 12px 0; } input, textarea { width: 100%; box-sizing: border-box; background: var(--paper); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px; } textarea { font: 13px/1.5 var(--font-mono); }
120
- button { padding: 6px 12px; } [role=alert] { color: var(--danger, #b33); overflow-wrap: anywhere; }
132
+ .file-metadata-scroll { flex: 1; min-width: 0; min-height: 0; overflow: auto; padding: 22px 24px; }
133
+ .heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
134
+ .heading h2 { margin: 0; font-size: 16px; font-weight: 600; }
135
+ dl { display: grid; grid-template-columns: 76px 1fr; gap: 6px 10px; font-size: 13px; margin: 10px 0 14px; }
136
+ dt { color: var(--muted); }
137
+ dd { margin: 0; overflow-wrap: anywhere; }
138
+ code { font: 12px/1.4 var(--font-mono); color: var(--text-secondary, var(--muted)); }
139
+ .meta-hint { font-size: 12px; color: var(--muted); margin: 8px 0 12px; }
140
+ label { display: grid; gap: 6px; margin: 12px 0; font-size: 13px; }
141
+ input, textarea, select { width: 100%; box-sizing: border-box; background: var(--paper); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px; font: inherit; }
142
+ textarea { font: 12.5px/1.5 var(--font-mono); }
143
+ .technical-details { margin: 14px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
144
+ .technical-details > summary { cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--muted); user-select: none; }
145
+ .tech-meta { margin: 10px 0 6px; font-size: 12px; }
146
+ .form-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
147
+ .relations-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
148
+ .relations-section h3 { margin: 0 0 10px; font-size: 13.5px; font-weight: 600; }
149
+ .link-list { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
150
+ .link-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
151
+ .link-picker { display: flex; gap: 8px; align-items: center; }
152
+ .link-picker select { flex: 1; min-width: 0; }
153
+ .link-picker button { flex-shrink: 0; }
154
+ [role=alert] { color: var(--danger, #b33); overflow-wrap: anywhere; font-size: 13px; }
121
155
  </style>
Binary file
@@ -1,5 +1,5 @@
1
1
  import { documentLinkDetails, parseDocumentMarkdown } from '@tano/editor/document-links';
2
- import { validEventDate, validEventTime } from '@tano/protocol';
2
+ import { isActionableTask, isPlanCompleted, isPlanObject, validEventDate, validEventTime } from '@tano/protocol';
3
3
  import type { WorkspaceObject } from '@tano/protocol';
4
4
  import type { Root, RootContent } from 'mdast';
5
5
  import type { HelpChecklistId } from './help-content';
@@ -66,15 +66,13 @@ export function newMarkdownMilestones(before: string, after: string): HelpCheckl
66
66
 
67
67
  /** Receives only successfully saved user changes, not hydrated or remote records. */
68
68
  export function planMilestones(before: WorkspaceObject | undefined, after: WorkspaceObject): HelpChecklistId[] {
69
- if (!['event', 'task'].includes(after.type)) return [];
69
+ if (!isPlanObject(after)) return [];
70
70
  const result: HelpChecklistId[] = before ? [] : ['plan'];
71
71
  const previous = before?.properties ?? {}, current = after.properties;
72
72
  if ((validEventDate(current.date) && current.date !== previous.date) ||
73
73
  (validEventTime(current.start) && validEventTime(current.end) &&
74
74
  (current.start !== previous.start || current.end !== previous.end))) result.push('plan-date');
75
75
  if (after.description.trim() && after.description !== before?.description) result.push('plan-description');
76
- const complete = (object?: WorkspaceObject) => object?.properties.completed === true ||
77
- (object?.type === 'task' && ['done', 'completed'].includes(String(object.properties.status)));
78
- if ((after.type === 'task' || current.checkable === true) && complete(after) && !complete(before)) result.push('plan-complete');
76
+ if (isActionableTask(after) && isPlanCompleted(after) && !(before && isPlanCompleted(before))) result.push('plan-complete');
79
77
  return result;
80
78
  }
@@ -1,17 +1,18 @@
1
+ import {
2
+ assistantCatalog as protocolAssistantCatalog,
3
+ type AssistantCopy,
4
+ } from '@tano/protocol/assistant-language';
1
5
  import { localeDefinition, type UiLocale } from './locale-registry';
2
- // Small synchronous fallbacks also serve non-UI consumers of assistantCopy().
3
- import chineseAssistant from '../assistant/locales/zh-CN.json';
4
- import englishAssistant from '../assistant/locales/en-US.json';
5
6
  import type { PluralCatalog } from './plurals';
6
7
 
7
8
  export type Messages = Readonly<Record<string, string>>;
8
- export interface LocaleCatalogs { messages: Messages; icons: Messages; assistant: typeof chineseAssistant; plurals: PluralCatalog }
9
+ export interface LocaleCatalogs { messages: Messages; icons: Messages; assistant: AssistantCopy; plurals: PluralCatalog }
9
10
  const catalogs = new Map<UiLocale, LocaleCatalogs>();
10
11
  const pending = new Map<UiLocale, Promise<void>>();
11
12
 
12
13
  export function loadedLocale(locale: UiLocale) { return catalogs.get(locale); }
13
- export function assistantCatalog(locale: UiLocale) {
14
- return catalogs.get(locale)?.assistant ?? (locale === 'zh-CN' ? chineseAssistant : englishAssistant);
14
+ export function assistantCatalog(locale: UiLocale): AssistantCopy {
15
+ return catalogs.get(locale)?.assistant ?? protocolAssistantCatalog(locale);
15
16
  }
16
17
 
17
18
  /** Deduplicate concurrent imports; a failed request remains retryable. */
@@ -1,45 +1,47 @@
1
+ import { loadAssistantLocale } from '@tano/protocol/assistant-language';
2
+
1
3
  /** One registration per language, including small recovery copy and lazy catalogs. */
2
4
  export const localeRegistry = [
3
5
  { value: 'zh-CN', label: '简体中文', language: 'Simplified Chinese',
4
6
  startup: { opening: '正在打开同页...', loading: '正在加载工作台,首次启动可能需要一些时间', retry: '重新加载', failure: '无法打开同页', timeout: '打开同页超时,工作台加载已超过 30 秒,请重新加载。' },
5
7
  loadMessages: async () => ({}),
6
8
  loadIcons: async () => ({}),
7
- loadAssistant: () => import('../assistant/locales/zh-CN.json').then(module => module.default),
9
+ loadAssistant: () => loadAssistantLocale('zh-CN'),
8
10
  loadPlurals: async () => ({}),
9
11
  },
10
12
  { value: 'en-US', label: 'English', language: 'English',
11
13
  startup: { opening: 'Opening Tano...', loading: 'Loading the workbench. The first launch may take a moment.', retry: 'Reload', failure: 'Unable to open Tano', timeout: 'Opening Tano timed out after 30 seconds. Please reload.' },
12
14
  loadMessages: () => import('./locales/en-US.json').then(module => module.default),
13
15
  loadIcons: () => import('./locales/icon-labels-en.json').then(module => module.default),
14
- loadAssistant: () => import('../assistant/locales/en-US.json').then(module => module.default),
16
+ loadAssistant: () => loadAssistantLocale('en-US'),
15
17
  loadPlurals: () => import('./locales/plurals-en-US.json').then(module => module.default),
16
18
  },
17
19
  { value: 'zh-TW', label: '繁體中文', language: 'Traditional Chinese',
18
20
  startup: { opening: '正在開啟同頁...', loading: '正在載入工作臺,首次啟動可能需要一些時間', retry: '重新載入', failure: '無法開啟同頁', timeout: '開啟同頁已超過 30 秒,請重新載入。' },
19
21
  loadMessages: () => import('./locales/zh-TW.json').then(module => module.default),
20
22
  loadIcons: () => import('./locales/icon-labels-zh-TW.json').then(module => module.default),
21
- loadAssistant: () => import('../assistant/locales/zh-TW.json').then(module => module.default),
23
+ loadAssistant: () => loadAssistantLocale('zh-TW'),
22
24
  loadPlurals: async () => ({}),
23
25
  },
24
26
  { value: 'ja-JP', label: '日本語', language: 'Japanese',
25
27
  startup: { opening: 'Tano を開いています...', loading: 'ワークスペースを読み込んでいます。初回起動には時間がかかることがあります。', retry: '再読み込み', failure: 'Tano を開けませんでした', timeout: 'Tano の起動が 30 秒でタイムアウトしました。再読み込みしてください。' },
26
28
  loadMessages: () => import('./locales/ja-JP.json').then(module => module.default),
27
29
  loadIcons: () => import('./locales/icon-labels-ja-JP.json').then(module => module.default),
28
- loadAssistant: () => import('../assistant/locales/ja-JP.json').then(module => module.default),
30
+ loadAssistant: () => loadAssistantLocale('ja-JP'),
29
31
  loadPlurals: async () => ({}),
30
32
  },
31
33
  { value: 'es-ES', label: 'Español', language: 'Spanish',
32
34
  startup: { opening: 'Abriendo Tano...', loading: 'Cargando el espacio de trabajo. El primer inicio puede tardar un momento.', retry: 'Recargar', failure: 'No se pudo abrir Tano', timeout: 'Tano no se ha abierto en 30 segundos. Recarga la página.' },
33
35
  loadMessages: () => import('./locales/es-ES.json').then(module => module.default),
34
36
  loadIcons: () => import('./locales/icon-labels-es-ES.json').then(module => module.default),
35
- loadAssistant: () => import('../assistant/locales/es-ES.json').then(module => module.default),
37
+ loadAssistant: () => loadAssistantLocale('es-ES'),
36
38
  loadPlurals: () => import('./locales/plurals-es-ES.json').then(module => module.default),
37
39
  },
38
40
  { value: 'de-DE', label: 'Deutsch', language: 'German',
39
41
  startup: { opening: 'Tano wird geöffnet...', loading: 'Der Arbeitsbereich wird geladen. Der erste Start kann einen Moment dauern.', retry: 'Neu laden', failure: 'Tano konnte nicht geöffnet werden', timeout: 'Tano konnte innerhalb von 30 Sekunden nicht geöffnet werden. Bitte neu laden.' },
40
42
  loadMessages: () => import('./locales/de-DE.json').then(module => module.default),
41
43
  loadIcons: () => import('./locales/icon-labels-de-DE.json').then(module => module.default),
42
- loadAssistant: () => import('../assistant/locales/de-DE.json').then(module => module.default),
44
+ loadAssistant: () => loadAssistantLocale('de-DE'),
43
45
  loadPlurals: () => import('./locales/plurals-de-DE.json').then(module => module.default),
44
46
  },
45
47
  ] as const;