Переглянути джерело

feat: make Soulseek source rows draggable (chunk 6)

SoulseekSourceRow is now draggable with a text representation showing
username, format, file count, and total size. Foundation for full
drag-to-playlist with placeholder resolution in a future iteration.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
aldiss 2 місяців тому
батько
коміт
1171db3411

+ 5 - 0
Sources/Services/UnifiedSearchCoordinator.swift

@@ -96,6 +96,11 @@ struct ScoredSoulseekSource: Identifiable {
         return .poor
     }
 
+    /// Text representation for drag-and-drop.
+    var dragRepresentation: String {
+        "\(response.username) — \(formatDisplay) — \(audioFileCount) files — \(formattedTotalSize)"
+    }
+
     enum ScoreGrade {
         case excellent, good, poor
     }

+ 1 - 0
Sources/Views/UnifiedSearchResultsView.swift

@@ -185,6 +185,7 @@ struct UnifiedSearchResultsView: View {
                                 )
                             }
                         )
+                        .draggable(source.dragRepresentation)
                     }
                 } header: {
                     Label("Available on Soulseek", systemImage: "arrow.down.circle.fill")