Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions GhosttyTabs.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
A5001407 /* WorkspaceContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5001417 /* WorkspaceContentView.swift */; };
A5001420 /* MarkdownPanel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5001418 /* MarkdownPanel.swift */; };
A5001421 /* MarkdownPanelView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5001419 /* MarkdownPanelView.swift */; };
A5001422 /* FilePreviewPanel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5001423 /* FilePreviewPanel.swift */; };
A5001500 /* CmuxWebView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5001510 /* CmuxWebView.swift */; };
A5001501 /* UITestRecorder.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5001511 /* UITestRecorder.swift */; };
A5001521 /* PostHogAnalytics.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5001520 /* PostHogAnalytics.swift */; };
Expand Down Expand Up @@ -312,6 +313,7 @@
A5001417 /* WorkspaceContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WorkspaceContentView.swift; sourceTree = "<group>"; };
A5001418 /* MarkdownPanel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Panels/MarkdownPanel.swift; sourceTree = "<group>"; };
A5001419 /* MarkdownPanelView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Panels/MarkdownPanelView.swift; sourceTree = "<group>"; };
A5001423 /* FilePreviewPanel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Panels/FilePreviewPanel.swift; sourceTree = "<group>"; };
A5001510 /* CmuxWebView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Panels/CmuxWebView.swift; sourceTree = "<group>"; };
A5001511 /* UITestRecorder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITestRecorder.swift; sourceTree = "<group>"; };
A5001520 /* PostHogAnalytics.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostHogAnalytics.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -566,6 +568,7 @@
A5007423 /* BrowserWebAuthnSupport.swift */,
A5001418 /* MarkdownPanel.swift */,
A5001419 /* MarkdownPanelView.swift */,
A5001423 /* FilePreviewPanel.swift */,
A5001510 /* CmuxWebView.swift */,
A5001415 /* PanelContentView.swift */,
A5001211 /* UpdateController.swift */,
Expand Down Expand Up @@ -943,6 +946,7 @@
A5007422 /* BrowserWebAuthnSupport.swift in Sources */,
A5001420 /* MarkdownPanel.swift in Sources */,
A5001421 /* MarkdownPanelView.swift in Sources */,
A5001422 /* FilePreviewPanel.swift in Sources */,
A5001500 /* CmuxWebView.swift in Sources */,
A5001405 /* PanelContentView.swift in Sources */,
A5001201 /* UpdateController.swift in Sources */,
Expand Down
153 changes: 149 additions & 4 deletions Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -25900,6 +25900,35 @@
}
}
},
"commandPalette.kind.filePreview": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "File Preview"
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "ファイルプレビュー"
}
},
"uk": {
"stringUnit": {
"state": "translated",
"value": "Перегляд файлу"
}
},
"ko": {
"stringUnit": {
"state": "translated",
"value": "파일 미리보기"
}
}
}
},
"commandPalette.kind.terminal": {
"extractionState": "manual",
"localizations": {
Expand Down Expand Up @@ -49556,25 +49585,25 @@
"en": {
"stringUnit": {
"state": "translated",
"value": "Cmd+P also matches terminal, browser, and markdown surfaces across workspaces."
"value": "Cmd+P also matches panel surfaces across workspaces."
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "Cmd+Pでワークスペースをまたいだターミナル、ブラウザ、Markdownのサーフェスも検索できます。"
"value": "Cmd+Pでワークスペースをまたいだパネルサーフェスも検索できます。"
}
},
"uk": {
"stringUnit": {
"state": "translated",
"value": "Cmd+P також шукає термінали, браузери та markdown-поверхні у всіх робочих областях."
"value": "Cmd+P також шукає панельні поверхні у всіх робочих областях."
}
},
"ko": {
"stringUnit": {
"state": "translated",
"value": "Cmd+P가 모든 워크스페이스의 터미널, 브라우저, 마크다운 서피스도 검색합니다."
"value": "Cmd+P가 모든 워크스페이스의 패널 서피스도 검색합니다."
}
}
}
Expand Down Expand Up @@ -86421,6 +86450,35 @@
}
}
},
"filePreview.fileUnavailable.message": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "The file may have been moved or deleted."
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "ファイルが移動または削除された可能性があります。"
}
},
"uk": {
"stringUnit": {
"state": "translated",
"value": "Можливо, файл було переміщено або видалено."
}
},
"ko": {
"stringUnit": {
"state": "translated",
"value": "파일이 이동되었거나 삭제되었을 수 있습니다."
}
}
}
},
"markdown.fileUnavailable.title": {
"extractionState": "manual",
"localizations": {
Expand Down Expand Up @@ -86450,6 +86508,93 @@
}
}
},
"filePreview.fileUnavailable.title": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "File unavailable"
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "ファイルを利用できません"
}
},
"uk": {
"stringUnit": {
"state": "translated",
"value": "Файл недоступний"
}
},
"ko": {
"stringUnit": {
"state": "translated",
"value": "파일을 사용할 수 없음"
}
}
}
},
"filePreview.revert": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Revert"
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "元に戻す"
}
},
"uk": {
"stringUnit": {
"state": "translated",
"value": "Відновити"
}
},
"ko": {
"stringUnit": {
"state": "translated",
"value": "되돌리기"
}
}
}
},
"filePreview.save": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Save"
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "保存"
}
},
"uk": {
"stringUnit": {
"state": "translated",
"value": "Зберегти"
}
},
"ko": {
"stringUnit": {
"state": "translated",
"value": "저장"
}
}
}
},
"settings.section.sidebarAppearance": {
"extractionState": "manual",
"localizations": {
Expand Down
4 changes: 4 additions & 0 deletions Sources/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6055,6 +6055,8 @@ struct ContentView: View {
return String(localized: "commandPalette.kind.browser", defaultValue: "Browser")
case .markdown:
return String(localized: "commandPalette.kind.markdown", defaultValue: "Markdown")
case .filePreview:
return String(localized: "commandPalette.kind.filePreview", defaultValue: "File Preview")
}
}

Expand All @@ -6066,6 +6068,8 @@ struct ContentView: View {
return ["browser", "web", "page"]
case .markdown:
return ["markdown", "note", "preview"]
case .filePreview:
return ["file", "preview", "text", "pdf", "image"]
}
}

Expand Down
6 changes: 2 additions & 4 deletions Sources/FileExplorerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,12 @@ struct FileExplorerPanelView: NSViewRepresentable {
FileExplorerStyle.current.rowHeight
}

// MARK: - Drag-to-Terminal
// MARK: - Drag-to-Preview

func outlineView(_ outlineView: NSOutlineView, pasteboardWriterForItem item: Any) -> (any NSPasteboardWriting)? {
guard let node = item as? FileExplorerNode, !node.isDirectory else { return nil }
guard store.provider is LocalFileExplorerProvider else { return nil }
return NSURL(fileURLWithPath: node.path)
return FilePreviewDragPasteboardWriter(filePath: node.path, displayTitle: node.name)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Route file-preview drags through browser-pane drop handling

This change makes sidebar file drags publish com.splittabbar.tabtransfer with synthetic tab IDs, but only Workspace.handleExternalTabDrop consumes FilePreviewDragRegistry. Browser-pane targets use BrowserPaneDropTargetView.performDragOperation (in Sources/BrowserWindowPortal.swift) and call AppDelegate.moveBonsplitTab, which requires a real tab ID, so dropping a sidebar file onto a browser pane insert/split zone fails with tabNotFound instead of opening a preview panel.

Useful? React with 👍 / 👎.

}

// MARK: - Context Menu (NSMenuDelegate)
Expand Down Expand Up @@ -666,5 +666,3 @@ final class FileExplorerRowView: NSTableRowView {
}
}



Loading
Loading