@tutti-os/workspace-file-manager 0.0.15 → 0.0.17

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.
@@ -43,6 +43,8 @@ var workspaceFileManagerEn = {
43
43
  downloadLabel: "Download",
44
44
  dropToImportLabel: "Drop files here to import to the current folder",
45
45
  emptyDirectory: "No visible files in this folder",
46
+ collapseFolderLabel: "Collapse folder",
47
+ expandFolderLabel: "Expand folder",
46
48
  forwardLabel: "Forward",
47
49
  loading: "Loading",
48
50
  modifiedLabel: "Modified",
@@ -52,6 +54,7 @@ var workspaceFileManagerEn = {
52
54
  openLabel: "Open",
53
55
  openInAppBrowserLabel: "Tutti built-in browser",
54
56
  openInDefaultBrowserLabel: "Default Browser",
57
+ openInFileViewerLabel: "File viewer",
55
58
  openWithLabel: "Open With",
56
59
  openWithLoadingLabel: "Loading apps...",
57
60
  openWithOtherLabel: "Other...",
@@ -133,6 +136,8 @@ var workspaceFileManagerZhCN = {
133
136
  downloadLabel: "\u4E0B\u8F7D",
134
137
  dropToImportLabel: "\u5C06\u6587\u4EF6\u62D6\u5230\u8FD9\u91CC\u4EE5\u5BFC\u5165\u5230\u5F53\u524D\u6587\u4EF6\u5939",
135
138
  emptyDirectory: "\u8FD9\u4E2A\u6587\u4EF6\u5939\u91CC\u6CA1\u6709\u53EF\u89C1\u6587\u4EF6",
139
+ collapseFolderLabel: "\u6536\u8D77\u6587\u4EF6\u5939",
140
+ expandFolderLabel: "\u5C55\u5F00\u6587\u4EF6\u5939",
136
141
  forwardLabel: "\u524D\u8FDB",
137
142
  loading: "\u52A0\u8F7D\u4E2D",
138
143
  modifiedLabel: "\u4FEE\u6539\u65F6\u95F4",
@@ -142,6 +147,7 @@ var workspaceFileManagerZhCN = {
142
147
  openLabel: "\u6253\u5F00",
143
148
  openInAppBrowserLabel: "Tutti \u5185\u7F6E\u7684\u6D4F\u89C8\u5668",
144
149
  openInDefaultBrowserLabel: "\u9ED8\u8BA4\u6D4F\u89C8\u5668",
150
+ openInFileViewerLabel: "\u6587\u4EF6\u67E5\u770B\u5668",
145
151
  openWithLabel: "\u6253\u5F00\u65B9\u5F0F",
146
152
  openWithLoadingLabel: "\u6B63\u5728\u52A0\u8F7D\u5E94\u7528...",
147
153
  openWithOtherLabel: "\u5176\u4ED6...",
@@ -227,4 +233,4 @@ export {
227
233
  createWorkspaceFileManagerI18nRuntime,
228
234
  resolveRevealInFolderLabel
229
235
  };
230
- //# sourceMappingURL=chunk-MDBT2GS5.js.map
236
+ //# sourceMappingURL=chunk-V2LNXNYT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/i18n/workspaceFileManagerI18n.ts"],"sourcesContent":["import {\n createScopedLocaleObjectsI18nModuleManifest,\n createScopedI18nRuntime,\n type I18nDictionary,\n type I18nRuntime\n} from \"@tutti-os/ui-i18n-runtime\";\n\ntype WorkspaceFileManagerI18nLocale = \"en\" | \"zh-CN\";\nexport const workspaceFileManagerI18nNamespace = \"workspaceFileManager\";\nexport const tuttiI18nModule = createScopedLocaleObjectsI18nModuleManifest({\n localeObjectByLocale: {\n en: \"workspaceFileManagerEn\",\n \"zh-CN\": \"workspaceFileManagerZhCN\"\n },\n name: \"workspace-file-manager\",\n namespace: \"workspaceFileManager\",\n sourceRoot: \"packages/workspace/file-manager/src\"\n});\n\nconst workspaceFileManagerEn = {\n backLabel: \"Back\",\n arrangeApplicationLabel: \"Application\",\n arrangeCreatedLabel: \"Created\",\n arrangeDateAddedLabel: \"Date Added\",\n arrangeKindLabel: \"Kind\",\n arrangeLastOpenedLabel: \"Last Opened\",\n arrangeMenuLabel: \"Arrange\",\n arrangeNoneLabel: \"None\",\n breadcrumbRootLabel: \"workspace\",\n cancelLabel: \"Cancel\",\n closeLabel: \"Close\",\n copyLabel: \"Copy\",\n copyPathLabel: \"Copy path\",\n copyPathSuccessTitle: \"Path copied\",\n copySuccessTitle: \"Copied to clipboard\",\n createActionLabel: \"Create\",\n createDirectoryLabel: \"New folder\",\n createDirectoryPlaceholder: \"Folder name\",\n createFileLabel: \"New file\",\n createFilePlaceholder: \"File name\",\n createNameInvalid: \"Use a valid name without path separators\",\n createNameRequired: \"Enter a name to continue\",\n deleteConfirmDescription: \"Delete {{name}} from this workspace?\",\n deleteLabel: \"Delete\",\n deletingLabel: \"Deleting...\",\n downloadFailedTitle: \"Download failed\",\n downloadLabel: \"Download\",\n dropToImportLabel: \"Drop files here to import to the current folder\",\n emptyDirectory: \"No visible files in this folder\",\n collapseFolderLabel: \"Collapse folder\",\n expandFolderLabel: \"Expand folder\",\n forwardLabel: \"Forward\",\n loading: \"Loading\",\n modifiedLabel: \"Modified\",\n nameLabel: \"Name\",\n noSearchResults: \"No files matched your search\",\n openFailedTitle: \"Open failed\",\n openLabel: \"Open\",\n openInAppBrowserLabel: \"Tutti built-in browser\",\n openInDefaultBrowserLabel: \"Default Browser\",\n openInFileViewerLabel: \"File viewer\",\n openWithLabel: \"Open With\",\n openWithLoadingLabel: \"Loading apps...\",\n openWithOtherLabel: \"Other...\",\n openWithOtherPickerPrompt: \"Choose an application to open this file:\",\n revealInFileExplorerLabel: \"Reveal in File Explorer\",\n revealInFileManagerLabel: \"Reveal in File Manager\",\n revealInFinderLabel: \"Reveal in Finder\",\n unknownErrorMessage: \"Something went wrong. Please try again.\",\n previewBinary:\n \"This file looks binary, so the preview stays read-only for now.\",\n previewDecodeFailed:\n \"We couldn't decode this file as UTF-8 text for preview.\",\n previewDirectoryLabel: \"Folder\",\n previewEmptyLabel: \"Select a file or folder to view details\",\n previewFileTooLarge:\n \"This file is larger than {{maxSize}}, so inline preview is disabled.\",\n previewLoadingLabel: \"Loading preview...\",\n previewTooLarge:\n \"This text file is larger than {{maxSize}}, so inline preview is disabled.\",\n previewUnavailableDownloadBody:\n \"Download {{name}} to open it in another environment.\",\n previewUnavailableOpenBody: \"Open {{name}} in your local app instead.\",\n previewUnavailableTitle: \"Can't preview this file\",\n previewUnsupported: \"Inline preview isn't available for this file type yet.\",\n revealFailedTitle: \"Could not reveal in file manager\",\n renameActionLabel: \"Rename\",\n renameLabel: \"Rename\",\n renamePlaceholder: \"New name\",\n refreshLabel: \"Refresh\",\n retryLabel: \"Retry\",\n searchPlaceholder: \"Search files\",\n searchResultsLabel: \"Search results\",\n sizeLabel: \"Size\",\n unsupportedImportBody:\n \"Importing local files into the workspace is not wired up in this desktop build yet.\",\n unsupportedImportTitle: \"Import not available yet\",\n unsupportedViewBody:\n \"Opening {{name}} from the file manager is not supported in this desktop build yet.\",\n unsupportedViewTitle: \"Open not available yet\",\n importConflictDescription:\n \"{{count}} file from this import already exists in this folder tree. Replace it?\",\n importConflictReplaceLabel: \"Replace files\",\n importConflictReviewLabel: \"Existing path\",\n importConflictSummaryFiltered: \"Filtered: {{count}}\",\n importConflictSummaryIgnored: \"Ignored: {{count}}\",\n importConflictSummaryReasonIgnored: \"Ignored by rules: {{count}}\",\n importConflictSummaryReasonSymlink: \"Skipped symlinks: {{count}}\",\n importConflictSummaryReasonSystemMetadata:\n \"Skipped system metadata: {{count}}\",\n importConflictSummarySelected: \"Selected: {{count}}\",\n importConflictTitle: \"Replace existing file?\",\n importFailedTitle: \"Import failed\",\n importLabel: \"Import\",\n importTypeConflictDescription:\n \"{{count}} import path conflicts with an existing file or folder using an incompatible type. Resolve it before retrying.\",\n importTypeConflictTitle: \"Import path conflict\",\n layoutIconViewLabel: \"Icon view\",\n layoutIconViewTooltipLabel: \"Icon mode\",\n layoutListViewLabel: \"List view\",\n layoutListViewTooltipLabel: \"List mode\"\n} as const satisfies I18nDictionary;\n\nconst workspaceFileManagerZhCN = {\n backLabel: \"后退\",\n arrangeApplicationLabel: \"应用程序\",\n arrangeCreatedLabel: \"创建日期\",\n arrangeDateAddedLabel: \"添加日期\",\n arrangeKindLabel: \"种类\",\n arrangeLastOpenedLabel: \"上次打开日期\",\n arrangeMenuLabel: \"排列方式\",\n arrangeNoneLabel: \"无\",\n breadcrumbRootLabel: \"工作区\",\n cancelLabel: \"取消\",\n closeLabel: \"关闭\",\n copyLabel: \"复制\",\n copyPathLabel: \"复制路径\",\n copyPathSuccessTitle: \"复制成功\",\n copySuccessTitle: \"已复制到剪贴板\",\n createActionLabel: \"创建\",\n createDirectoryLabel: \"新建文件夹\",\n createDirectoryPlaceholder: \"文件夹名称\",\n createFileLabel: \"新建文件\",\n createFilePlaceholder: \"文件名称\",\n createNameInvalid: \"请输入有效名称,且不要包含路径分隔符\",\n createNameRequired: \"请输入名称后再继续\",\n deleteConfirmDescription: \"要从这个工作区删除 {{name}} 吗?\",\n deleteLabel: \"删除\",\n deletingLabel: \"删除中...\",\n downloadFailedTitle: \"下载失败\",\n downloadLabel: \"下载\",\n dropToImportLabel: \"将文件拖到这里以导入到当前文件夹\",\n emptyDirectory: \"这个文件夹里没有可见文件\",\n collapseFolderLabel: \"收起文件夹\",\n expandFolderLabel: \"展开文件夹\",\n forwardLabel: \"前进\",\n loading: \"加载中\",\n modifiedLabel: \"修改时间\",\n nameLabel: \"名称\",\n noSearchResults: \"没有匹配的文件\",\n openFailedTitle: \"打开失败\",\n openLabel: \"打开\",\n openInAppBrowserLabel: \"Tutti 内置的浏览器\",\n openInDefaultBrowserLabel: \"默认浏览器\",\n openInFileViewerLabel: \"文件查看器\",\n openWithLabel: \"打开方式\",\n openWithLoadingLabel: \"正在加载应用...\",\n openWithOtherLabel: \"其他...\",\n openWithOtherPickerPrompt: \"选择用来打开此文件的应用程序:\",\n revealInFileExplorerLabel: \"在文件资源管理器中显示\",\n revealInFileManagerLabel: \"在文件管理器中显示\",\n revealInFinderLabel: \"在 Finder 中显示\",\n unknownErrorMessage: \"出了点问题,请稍后再试。\",\n previewBinary: \"这个文件更像二进制内容,当前先保持只读占位。\",\n previewDecodeFailed: \"暂时无法按 UTF-8 文本解码这个文件。\",\n previewDirectoryLabel: \"文件夹\",\n previewEmptyLabel: \"选择文件或文件夹查看详情\",\n previewFileTooLarge: \"这个文件超过了 {{maxSize}},暂时不做内联预览。\",\n previewLoadingLabel: \"正在加载预览...\",\n previewTooLarge: \"这个文本文件超过了 {{maxSize}},暂时不做内联预览。\",\n previewUnavailableDownloadBody: \"下载 {{name}} 后再在其他环境中打开。\",\n previewUnavailableOpenBody: \"改为在本地应用中打开 {{name}}。\",\n previewUnavailableTitle: \"这个文件暂时无法预览\",\n previewUnsupported: \"这种文件类型暂时还不支持内联预览。\",\n revealFailedTitle: \"无法在文件管理器中显示\",\n renameActionLabel: \"重命名\",\n renameLabel: \"重命名\",\n renamePlaceholder: \"新名称\",\n refreshLabel: \"刷新\",\n retryLabel: \"重试\",\n searchPlaceholder: \"搜索文件\",\n searchResultsLabel: \"搜索结果\",\n sizeLabel: \"大小\",\n unsupportedImportBody:\n \"这个桌面版本暂时还没有把本地文件导入到工作区的链路接通。\",\n unsupportedImportTitle: \"暂不支持导入\",\n unsupportedViewBody:\n \"这个桌面版本暂时还不支持直接从文件管理器打开 {{name}}。\",\n unsupportedViewTitle: \"暂不支持打开\",\n importConflictDescription:\n \"这次导入里有 {{count}} 个文件在当前目录树中已经存在。要替换吗?\",\n importConflictReplaceLabel: \"替换文件\",\n importConflictReviewLabel: \"现有路径\",\n importConflictSummaryFiltered: \"已过滤:{{count}}\",\n importConflictSummaryIgnored: \"已忽略:{{count}}\",\n importConflictSummaryReasonIgnored: \"规则忽略:{{count}}\",\n importConflictSummaryReasonSymlink: \"已跳过符号链接:{{count}}\",\n importConflictSummaryReasonSystemMetadata: \"已跳过系统元数据:{{count}}\",\n importConflictSummarySelected: \"已选择:{{count}}\",\n importConflictTitle: \"替换已有文件?\",\n importFailedTitle: \"导入失败\",\n importLabel: \"导入\",\n importTypeConflictDescription:\n \"这次导入里有 {{count}} 个路径与现有文件或文件夹的类型不兼容。请先处理后再重试。\",\n importTypeConflictTitle: \"导入路径冲突\",\n layoutIconViewLabel: \"图标\",\n layoutIconViewTooltipLabel: \"图标模式\",\n layoutListViewLabel: \"列表\",\n layoutListViewTooltipLabel: \"列表模式\"\n} as const satisfies I18nDictionary;\n\nexport type WorkspaceFileManagerI18nKey = keyof typeof workspaceFileManagerEn;\n\nexport type WorkspaceFileManagerI18nRuntime =\n I18nRuntime<WorkspaceFileManagerI18nKey>;\n\nconst workspaceFileManagerDefaults: Record<\n WorkspaceFileManagerI18nLocale,\n I18nDictionary\n> = {\n en: workspaceFileManagerEn,\n \"zh-CN\": workspaceFileManagerZhCN\n};\n\nexport const workspaceFileManagerI18nResources: Record<\n WorkspaceFileManagerI18nLocale,\n I18nDictionary\n> = {\n en: {\n [workspaceFileManagerI18nNamespace]: workspaceFileManagerDefaults.en\n },\n \"zh-CN\": {\n [workspaceFileManagerI18nNamespace]: workspaceFileManagerDefaults[\"zh-CN\"]\n }\n};\n\nexport function createWorkspaceFileManagerI18nRuntime(\n runtime: I18nRuntime<string>\n): WorkspaceFileManagerI18nRuntime {\n return createScopedI18nRuntime<WorkspaceFileManagerI18nKey>(\n runtime,\n workspaceFileManagerI18nNamespace\n );\n}\n\nexport function resolveRevealInFolderLabel(\n copy: WorkspaceFileManagerI18nRuntime,\n platform: NodeJS.Platform\n): string {\n if (platform === \"darwin\") {\n return copy.t(\"revealInFinderLabel\");\n }\n if (platform === \"win32\") {\n return copy.t(\"revealInFileExplorerLabel\");\n }\n return copy.t(\"revealInFileManagerLabel\");\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AAGA,IAAM,oCAAoC;AAC1C,IAAM,kBAAkB,4CAA4C;AAAA,EACzE,sBAAsB;AAAA,IACpB,IAAI;AAAA,IACJ,SAAS;AAAA,EACX;AAAA,EACA,MAAM;AAAA,EACN,WAAW;AAAA,EACX,YAAY;AACd,CAAC;AAED,IAAM,yBAAyB;AAAA,EAC7B,WAAW;AAAA,EACX,yBAAyB;AAAA,EACzB,qBAAqB;AAAA,EACrB,uBAAuB;AAAA,EACvB,kBAAkB;AAAA,EAClB,wBAAwB;AAAA,EACxB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,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,IACA;AAAA,EACF;AACF;AAEO,SAAS,2BACd,MACA,UACQ;AACR,MAAI,aAAa,UAAU;AACzB,WAAO,KAAK,EAAE,qBAAqB;AAAA,EACrC;AACA,MAAI,aAAa,SAAS;AACxB,WAAO,KAAK,EAAE,2BAA2B;AAAA,EAC3C;AACA,SAAO,KAAK,EAAE,0BAA0B;AAC1C;","names":[]}
@@ -24,6 +24,7 @@ import {
24
24
  resolveWorkspaceFileExtension,
25
25
  resolveWorkspaceFileVisualKind,
26
26
  resolveWorkspaceImageMimeType,
27
+ resolveWorkspaceVideoMimeType,
27
28
  workspaceFilePreviewMaxBytes,
28
29
  workspaceFileTextMaxBytes
29
30
  } from "@tutti-os/workspace-file-preview";
@@ -215,11 +216,13 @@ function createWorkspaceFileManagerStore(input) {
215
216
  createDialog: null,
216
217
  currentDirectoryPath: persistedState?.currentDirectoryPath ?? initialDirectoryPath ?? workspaceFileManagerLogicalRoot,
217
218
  deleteDialog: null,
219
+ directoryExpansionByPath: {},
218
220
  inlineRenameEntryPath: null,
219
221
  inlineRenameValidation: null,
220
222
  dragDepth: 0,
221
223
  entries: [],
222
224
  error: null,
225
+ expandedDirectoryPaths: {},
223
226
  isLoading: false,
224
227
  isMutating: false,
225
228
  isSearching: false,
@@ -293,12 +296,14 @@ var WorkspaceFileManagerActivationController = class {
293
296
  host;
294
297
  loadDirectory;
295
298
  resolveErrorMessage;
299
+ resolveFileDefaultOpener;
296
300
  store;
297
301
  constructor(input) {
298
302
  this.copy = input.copy;
299
303
  this.host = input.host;
300
304
  this.loadDirectory = input.loadDirectory;
301
305
  this.resolveErrorMessage = input.resolveErrorMessage;
306
+ this.resolveFileDefaultOpener = input.resolveFileDefaultOpener;
302
307
  this.store = input.store;
303
308
  }
304
309
  async activateFile(request) {
@@ -368,6 +373,7 @@ var WorkspaceFileManagerActivationController = class {
368
373
  }
369
374
  async openEntry(entry) {
370
375
  this.store.contextMenu = null;
376
+ this.store.contextMenuEntryPath = null;
371
377
  if (entry.kind === "directory") {
372
378
  this.store.pendingDirectoryPath = entry.path;
373
379
  try {
@@ -379,6 +385,18 @@ var WorkspaceFileManagerActivationController = class {
379
385
  }
380
386
  return;
381
387
  }
388
+ const opener = this.resolveFileDefaultOpener?.(entry) ?? null;
389
+ if (opener && opener !== "fileViewer") {
390
+ const handled = await this.openFileWithConfiguredOpener(entry, opener);
391
+ if (handled) {
392
+ return;
393
+ }
394
+ }
395
+ await this.openFileInFileViewer(entry);
396
+ }
397
+ async openFileInFileViewer(entry) {
398
+ this.store.contextMenu = null;
399
+ this.store.contextMenuEntryPath = null;
382
400
  this.store.busyAction = "view";
383
401
  try {
384
402
  const result = await this.activateFile({
@@ -390,6 +408,39 @@ var WorkspaceFileManagerActivationController = class {
390
408
  this.store.busyAction = null;
391
409
  }
392
410
  }
411
+ async openFileWithConfiguredOpener(entry, opener) {
412
+ switch (opener) {
413
+ case "appBrowser":
414
+ if (!this.host.openFileInAppBrowser) {
415
+ return false;
416
+ }
417
+ await this.host.openFileInAppBrowser({
418
+ path: entry.path,
419
+ workspaceID: this.store.workspaceID
420
+ });
421
+ return true;
422
+ case "defaultBrowser":
423
+ if (!this.host.openFileInDefaultBrowser) {
424
+ return false;
425
+ }
426
+ await this.host.openFileInDefaultBrowser({
427
+ path: entry.path,
428
+ workspaceID: this.store.workspaceID
429
+ });
430
+ return true;
431
+ case "system":
432
+ if (!this.host.openFileInSystemDefault) {
433
+ return false;
434
+ }
435
+ await this.host.openFileInSystemDefault({
436
+ path: entry.path,
437
+ workspaceID: this.store.workspaceID
438
+ });
439
+ return true;
440
+ case "fileViewer":
441
+ return false;
442
+ }
443
+ }
393
444
  applyActivationResult(result, entry) {
394
445
  if (!result || result.disposition === "handled") {
395
446
  this.store.unsupportedDialog = null;
@@ -437,6 +488,26 @@ var WorkspaceFileManagerActivationController = class {
437
488
  }
438
489
  };
439
490
 
491
+ // src/services/internal/model/entryLookup.ts
492
+ function findWorkspaceFileEntry(state, entryPath) {
493
+ if (!entryPath) {
494
+ return null;
495
+ }
496
+ const directEntry = state.entries.find((entry) => entry.path === entryPath);
497
+ if (directEntry) {
498
+ return directEntry;
499
+ }
500
+ for (const directoryState of Object.values(state.directoryExpansionByPath)) {
501
+ const nestedEntry = directoryState.entries.find(
502
+ (entry) => entry.path === entryPath
503
+ );
504
+ if (nestedEntry) {
505
+ return nestedEntry;
506
+ }
507
+ }
508
+ return null;
509
+ }
510
+
440
511
  // src/services/internal/workspaceFileManagerMutationController.ts
441
512
  var WorkspaceFileManagerMutationController = class {
442
513
  host;
@@ -479,9 +550,7 @@ var WorkspaceFileManagerMutationController = class {
479
550
  if (!this.host.deleteEntry || !this.store.selectedPath) {
480
551
  return;
481
552
  }
482
- const entry = this.store.entries.find(
483
- (candidate) => candidate.path === this.store.selectedPath
484
- );
553
+ const entry = findWorkspaceFileEntry(this.store, this.store.selectedPath);
485
554
  await this.mutate(
486
555
  "delete",
487
556
  () => this.host.deleteEntry?.({
@@ -614,6 +683,8 @@ var WorkspaceFileManagerNavigationController = class {
614
683
  this.store.root = normalizeWorkspaceFilePath(listing.root);
615
684
  this.store.currentDirectoryPath = listing.directoryPath;
616
685
  this.store.entries = sortWorkspaceEntries(listing.entries);
686
+ this.store.directoryExpansionByPath = {};
687
+ this.store.expandedDirectoryPaths = {};
617
688
  this.store.selectedPath = null;
618
689
  } catch (error) {
619
690
  if (requestID === this.requestSeq) {
@@ -654,6 +725,8 @@ var WorkspaceFileManagerNavigationController = class {
654
725
  this.store.root = normalizeWorkspaceFilePath(listing.root);
655
726
  this.store.currentDirectoryPath = listing.directoryPath;
656
727
  this.store.entries = sortWorkspaceEntries(listing.entries);
728
+ this.store.directoryExpansionByPath = {};
729
+ this.store.expandedDirectoryPaths = {};
657
730
  this.store.selectedPath = normalizedPath;
658
731
  } catch (error) {
659
732
  if (requestID === this.requestSeq) {
@@ -682,6 +755,8 @@ var WorkspaceFileManagerNavigationController = class {
682
755
  this.store.root = normalizeWorkspaceFilePath(listing.root);
683
756
  this.store.currentDirectoryPath = listing.directoryPath;
684
757
  this.store.entries = sortWorkspaceEntries(listing.entries);
758
+ this.store.directoryExpansionByPath = {};
759
+ this.store.expandedDirectoryPaths = {};
685
760
  this.store.selectedPath = null;
686
761
  } catch (error) {
687
762
  if (requestID === this.requestSeq) {
@@ -787,9 +862,10 @@ var WorkspaceFileManagerPreviewController = class {
787
862
  const loadedState = createWorkspaceFilePreviewLoadedState({
788
863
  bytes,
789
864
  entry: selectedEntry,
865
+ renderHtml: true,
790
866
  target: activationTarget
791
867
  });
792
- if (loadedState.status === "image") {
868
+ if (loadedState.status === "image" || loadedState.status === "video") {
793
869
  const objectUrl = URL.createObjectURL(
794
870
  new Blob([loadedState.bytes], {
795
871
  type: loadedState.contentType
@@ -803,7 +879,7 @@ var WorkspaceFileManagerPreviewController = class {
803
879
  this.store.previewState = {
804
880
  entry: activationTarget,
805
881
  objectUrl,
806
- status: "image"
882
+ status: loadedState.status
807
883
  };
808
884
  return;
809
885
  }
@@ -811,6 +887,10 @@ var WorkspaceFileManagerPreviewController = class {
811
887
  this.store.previewState = loadedState;
812
888
  return;
813
889
  }
890
+ if (loadedState.status === "html") {
891
+ this.store.previewState = loadedState;
892
+ return;
893
+ }
814
894
  if (loadedState.status === "readonly") {
815
895
  this.store.previewState = {
816
896
  entry: selectedEntry,
@@ -977,6 +1057,101 @@ var WorkspaceFileManagerImportController = class {
977
1057
  }
978
1058
  };
979
1059
 
1060
+ // src/services/internal/workspaceFileManagerTreeController.ts
1061
+ var WorkspaceFileManagerTreeController = class {
1062
+ host;
1063
+ resolveErrorMessage;
1064
+ requestSeqByPath = /* @__PURE__ */ new Map();
1065
+ store;
1066
+ constructor(input) {
1067
+ this.host = input.host;
1068
+ this.resolveErrorMessage = input.resolveErrorMessage;
1069
+ this.store = input.store;
1070
+ }
1071
+ clear() {
1072
+ this.requestSeqByPath.clear();
1073
+ this.store.directoryExpansionByPath = {};
1074
+ this.store.expandedDirectoryPaths = {};
1075
+ }
1076
+ async toggleDirectoryExpanded(entry) {
1077
+ if (entry.kind !== "directory" || !entry.hasChildren) {
1078
+ return;
1079
+ }
1080
+ const directoryPath = normalizeWorkspaceFilePath(
1081
+ entry.path,
1082
+ this.store.root
1083
+ );
1084
+ if (this.store.expandedDirectoryPaths[directoryPath]) {
1085
+ this.store.expandedDirectoryPaths = {
1086
+ ...this.store.expandedDirectoryPaths,
1087
+ [directoryPath]: false
1088
+ };
1089
+ return;
1090
+ }
1091
+ this.store.expandedDirectoryPaths = {
1092
+ ...this.store.expandedDirectoryPaths,
1093
+ [directoryPath]: true
1094
+ };
1095
+ const currentState = this.store.directoryExpansionByPath[directoryPath];
1096
+ if (currentState?.loaded || currentState?.isLoading) {
1097
+ return;
1098
+ }
1099
+ await this.loadDirectoryChildren(directoryPath);
1100
+ }
1101
+ async loadDirectoryChildren(directoryPath) {
1102
+ const requestSeq = (this.requestSeqByPath.get(directoryPath) ?? 0) + 1;
1103
+ this.requestSeqByPath.set(directoryPath, requestSeq);
1104
+ const previousState = this.store.directoryExpansionByPath[directoryPath];
1105
+ this.store.directoryExpansionByPath = {
1106
+ ...this.store.directoryExpansionByPath,
1107
+ [directoryPath]: {
1108
+ entries: previousState?.entries ?? [],
1109
+ error: null,
1110
+ isLoading: true,
1111
+ loaded: previousState?.loaded ?? false
1112
+ }
1113
+ };
1114
+ try {
1115
+ const listing = await this.host.listDirectory({
1116
+ includeHidden: workspaceFilePathHasHiddenSegment(directoryPath),
1117
+ path: this.resolveRequestPath(directoryPath),
1118
+ workspaceID: this.store.workspaceID
1119
+ });
1120
+ if (this.requestSeqByPath.get(directoryPath) !== requestSeq) {
1121
+ return;
1122
+ }
1123
+ this.store.directoryExpansionByPath = {
1124
+ ...this.store.directoryExpansionByPath,
1125
+ [directoryPath]: {
1126
+ entries: sortWorkspaceEntries(listing.entries),
1127
+ error: null,
1128
+ isLoading: false,
1129
+ loaded: true
1130
+ }
1131
+ };
1132
+ } catch (error) {
1133
+ if (this.requestSeqByPath.get(directoryPath) !== requestSeq) {
1134
+ return;
1135
+ }
1136
+ this.store.directoryExpansionByPath = {
1137
+ ...this.store.directoryExpansionByPath,
1138
+ [directoryPath]: {
1139
+ entries: previousState?.entries ?? [],
1140
+ error: this.resolveErrorMessage(error),
1141
+ isLoading: false,
1142
+ loaded: false
1143
+ }
1144
+ };
1145
+ }
1146
+ }
1147
+ resolveRequestPath(path) {
1148
+ if (this.store.root === "/" && path === "/") {
1149
+ return "";
1150
+ }
1151
+ return path;
1152
+ }
1153
+ };
1154
+
980
1155
  // src/services/internal/model/openWithApplicationsCache.ts
981
1156
  import { resolveWorkspaceFileExtension as resolveWorkspaceFileExtension2 } from "@tutti-os/workspace-file-preview";
982
1157
  var openWithWarmupLimit = 8;
@@ -1054,6 +1229,7 @@ var DefaultWorkspaceFileManagerSession = class {
1054
1229
  mutationController;
1055
1230
  navigationController;
1056
1231
  previewController;
1232
+ treeController;
1057
1233
  persistence;
1058
1234
  unsubscribeStore = null;
1059
1235
  importController;
@@ -1070,11 +1246,17 @@ var DefaultWorkspaceFileManagerSession = class {
1070
1246
  resolveErrorMessage: (error) => this.resolveErrorMessage(error),
1071
1247
  store: this.store
1072
1248
  });
1249
+ this.treeController = new WorkspaceFileManagerTreeController({
1250
+ host: input.host,
1251
+ resolveErrorMessage: (error) => this.resolveErrorMessage(error),
1252
+ store: this.store
1253
+ });
1073
1254
  this.activationController = new WorkspaceFileManagerActivationController({
1074
1255
  copy: () => this.copy,
1075
1256
  host: input.host,
1076
1257
  loadDirectory: (path) => this.navigationController.loadDirectory(path),
1077
1258
  resolveErrorMessage: (error, overrides) => this.resolveErrorMessage(error, overrides),
1259
+ resolveFileDefaultOpener: input.resolveFileDefaultOpener,
1078
1260
  store: this.store
1079
1261
  });
1080
1262
  this.mutationController = new WorkspaceFileManagerMutationController({
@@ -1214,9 +1396,7 @@ var DefaultWorkspaceFileManagerSession = class {
1214
1396
  if (!inlineRenameEntryPath) {
1215
1397
  return true;
1216
1398
  }
1217
- const entry = this.store.entries.find(
1218
- (candidate) => candidate.path === inlineRenameEntryPath
1219
- );
1399
+ const entry = findWorkspaceFileEntry(this.store, inlineRenameEntryPath);
1220
1400
  if (!entry) {
1221
1401
  this.store.inlineRenameEntryPath = null;
1222
1402
  this.store.inlineRenameValidation = null;
@@ -1382,6 +1562,9 @@ var DefaultWorkspaceFileManagerSession = class {
1382
1562
  this.store.inlineRenameValidation = null;
1383
1563
  this.store.selectedPath = entry.path;
1384
1564
  }
1565
+ async toggleDirectoryExpanded(entry) {
1566
+ await this.treeController.toggleDirectoryExpanded(entry);
1567
+ }
1385
1568
  async copyToClipboard(entry) {
1386
1569
  if (!this.host.copyEntriesToClipboard) {
1387
1570
  return;
@@ -1448,6 +1631,20 @@ var DefaultWorkspaceFileManagerSession = class {
1448
1631
  workspaceID: this.store.workspaceID
1449
1632
  });
1450
1633
  }
1634
+ async openFileInFileViewer(entry) {
1635
+ await this.activationController.openFileInFileViewer(entry);
1636
+ }
1637
+ async openFileInSystemDefault(entry) {
1638
+ if (!this.host.openFileInSystemDefault) {
1639
+ return;
1640
+ }
1641
+ this.store.contextMenu = null;
1642
+ this.store.contextMenuEntryPath = null;
1643
+ await this.host.openFileInSystemDefault({
1644
+ path: entry.path,
1645
+ workspaceID: this.store.workspaceID
1646
+ });
1647
+ }
1451
1648
  async openFileWithOtherApplication(entry) {
1452
1649
  if (!this.host.openFileWithOtherApplication) {
1453
1650
  return;
@@ -1707,6 +1904,7 @@ var DefaultWorkspaceFileManagerService = class {
1707
1904
  onHostActionMessage: input.onHostActionMessage,
1708
1905
  onMutationErrorMessage: input.onMutationErrorMessage,
1709
1906
  persistence: input.persistence,
1907
+ resolveFileDefaultOpener: input.resolveFileDefaultOpener,
1710
1908
  store
1711
1909
  });
1712
1910
  }
@@ -1947,6 +2145,7 @@ export {
1947
2145
  normalizeWorkspaceFilePath,
1948
2146
  workspaceFileName,
1949
2147
  buildWorkspaceFileBreadcrumbs,
2148
+ findWorkspaceFileEntry,
1950
2149
  createWorkspaceFileManagerService,
1951
2150
  shouldResolveWorkspaceFileEntryIcon,
1952
2151
  shouldUseWorkspaceFileExtensionDocumentIcon,
@@ -1959,4 +2158,4 @@ export {
1959
2158
  sortWorkspaceFileEntriesForArrangeMode,
1960
2159
  resolveWorkspaceFileEntryArrangeDateMs
1961
2160
  };
1962
- //# sourceMappingURL=chunk-5C34NYLK.js.map
2161
+ //# sourceMappingURL=chunk-ZN7X24RU.js.map