@@ -41,8 +41,11 @@ struct DataBrowserView: View {
4141 @State private var foreignKeys : [ ForeignKeyInfo ] = [ ]
4242 @State private var fkPreviewItem : FKPreviewItem ?
4343 @State private var memoryWarningMessage : String ?
44+ @State private var showShareSheet = false
45+ @State private var shareText = " "
4446 @State private var hapticSuccess = false
4547 @State private var hapticError = false
48+ @State private var showStructure = false
4649
4750 private var isView : Bool {
4851 table. type == . view || table. type == . materializedView
@@ -102,6 +105,14 @@ struct DataBrowserView: View {
102105
103106 var body : some View {
104107 searchableContent
108+ . userActivity ( " com.TablePro.viewTable " ) { activity in
109+ activity. title = table. name
110+ activity. isEligibleForHandoff = true
111+ activity. userInfo = [
112+ " connectionId " : connection. id. uuidString,
113+ " tableName " : table. name
114+ ]
115+ }
105116 . toolbar { topToolbar }
106117 . toolbar ( rows. isEmpty && !hasActiveSearch && !hasActiveFilters ? . hidden : . visible, for: . bottomBar)
107118 . toolbar { paginationToolbar }
@@ -124,6 +135,9 @@ struct DataBrowserView: View {
124135 databaseType: connection. type
125136 )
126137 }
138+ . sheet ( isPresented: $showShareSheet) {
139+ ActivityViewController ( items: [ shareText] )
140+ }
127141 . confirmationDialog ( " Delete Row " , isPresented: $showDeleteConfirmation, titleVisibility: . visible) {
128142 Button ( " Delete " , role: . destructive) {
129143 if let pkValues = deleteTarget {
@@ -161,6 +175,9 @@ struct DataBrowserView: View {
161175 }
162176 . sensoryFeedback ( . success, trigger: hapticSuccess)
163177 . sensoryFeedback ( . error, trigger: hapticError)
178+ . navigationDestination ( isPresented: $showStructure) {
179+ StructureView ( table: table, session: session, databaseType: connection. type)
180+ }
164181 . alert ( " Go to Page " , isPresented: $showGoToPage) {
165182 TextField ( " Page number " , text: $goToPageInput)
166183 . keyboardType ( . numberPad)
@@ -250,7 +267,19 @@ struct DataBrowserView: View {
250267 row: row
251268 )
252269 }
270+ . hoverEffect ( )
253271 . contextMenu {
272+ Menu ( " Share Row " ) {
273+ ForEach ( ExportFormat . allCases) { format in
274+ Button ( format. rawValue) {
275+ shareText = ClipboardExporter . exportRow (
276+ columns: columns, row: row,
277+ format: format, tableName: table. name
278+ )
279+ showShareSheet = true
280+ }
281+ }
282+ }
254283 Menu ( " Copy Row " ) {
255284 ForEach ( ExportFormat . allCases) { format in
256285 Button ( format. rawValue) {
@@ -311,25 +340,6 @@ struct DataBrowserView: View {
311340
312341 @ToolbarContentBuilder
313342 private var topToolbar : some ToolbarContent {
314- ToolbarItem ( placement: . topBarTrailing) {
315- Menu {
316- ForEach ( ExportFormat . allCases) { format in
317- Button {
318- let text = ClipboardExporter . exportRows (
319- columns: columns, rows: rows,
320- format: format, tableName: table. name
321- )
322- ClipboardExporter . copyToClipboard ( text)
323- } label: {
324- Label ( format. rawValue, systemImage: " doc.on.clipboard " )
325- }
326- }
327- } label: {
328- Image ( systemName: " square.and.arrow.up " )
329- . accessibilityLabel ( Text ( " Export " ) )
330- }
331- . disabled ( rows. isEmpty)
332- }
333343 ToolbarItem ( placement: . topBarTrailing) {
334344 Menu {
335345 Picker ( " Sort By " , selection: sortColumnBinding) {
@@ -365,11 +375,26 @@ struct DataBrowserView: View {
365375 . badge ( activeFilterCount)
366376 }
367377 ToolbarItem ( placement: . topBarTrailing) {
368- NavigationLink {
369- StructureView ( table: table, session: session, databaseType: connection. type)
378+ Menu {
379+ Button { showStructure = true } label: {
380+ Label ( " Table Structure " , systemImage: " info.circle " )
381+ }
382+ Divider ( )
383+ Section ( " Export " ) {
384+ ForEach ( ExportFormat . allCases) { format in
385+ Button {
386+ let text = ClipboardExporter . exportRows (
387+ columns: columns, rows: rows,
388+ format: format, tableName: table. name
389+ )
390+ ClipboardExporter . copyToClipboard ( text)
391+ } label: {
392+ Label ( format. rawValue, systemImage: " doc.on.clipboard " )
393+ }
394+ }
395+ }
370396 } label: {
371- Image ( systemName: " info.circle " )
372- . accessibilityLabel ( Text ( " Table Structure " ) )
397+ Image ( systemName: " ellipsis.circle " )
373398 }
374399 }
375400 if !isView && !connection. safeModeLevel. blocksWrites {
0 commit comments