some changes, builds but needs work oh yeah switches ribbons books properly
							parent
							
								
									f202589f89
								
							
						
					
					
						commit
						ed1377d9c5
					
				
							
								
								
									
										3398
									
								
								CrownOfThorns.swift
								
								
								
								
							
							
						
						
									
										3398
									
								
								CrownOfThorns.swift
								
								
								
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							|  | @ -25,18 +25,18 @@ struct NaviBar: View { | ||||||
|                     .if(!paneConnector.hasMoved) { $0.foregroundColor(Color(UIColor(red: 0.30, green: 0.30, blue: 0.30, alpha: 0.4))) } |                     .if(!paneConnector.hasMoved) { $0.foregroundColor(Color(UIColor(red: 0.30, green: 0.30, blue: 0.30, alpha: 0.4))) } | ||||||
|                     .onTapGesture { |                     .onTapGesture { | ||||||
|                         Task { |                         Task { | ||||||
|                             var br = backRibbon[0] |                             var br = backRibbon | ||||||
|                             var sr = selectedRibbon[0] |                             var sr = selectedRibbon | ||||||
| 
 | 
 | ||||||
|                             do { |                             do { | ||||||
|                                 if paneConnector.hasMoved { |                                 if paneConnector.hasMoved { | ||||||
|                                     print("has moved") |                                     print("has moved") | ||||||
| 
 | 
 | ||||||
|                                     let updatedRibbon = try await createUndoState(selectedRibbon: sr, |                                     let updatedRibbon = try await createUndoState(selectedRibbon: sr[0], | ||||||
|                                                                                   appDatabase: appDatabase, |                                                                                   appDatabase: appDatabase, | ||||||
|                                                                                   paneConnector: paneConnector) |                                                                                   paneConnector: paneConnector) | ||||||
|                                     goToRibbon(selectedRibbon: sr, |                                     goToRibbon(selectedRibbon: sr[0], | ||||||
|                                                destRibbon: sr, |                                                destRibbon: sr[0], | ||||||
|                                                appDatabase: appDatabase, |                                                appDatabase: appDatabase, | ||||||
|                                                paneConnector: paneConnector, |                                                paneConnector: paneConnector, | ||||||
|                                                loading: false) |                                                loading: false) | ||||||
|  | @ -45,10 +45,10 @@ struct NaviBar: View { | ||||||
|                                         return |                                         return | ||||||
|                                     } |                                     } | ||||||
| 
 | 
 | ||||||
|                                     try await appDatabase.undoRibbon(&sr) |                                     try await appDatabase.undoRibbon(&sr[0]) | ||||||
| 
 | 
 | ||||||
|                                     goToRibbon(selectedRibbon: sr, |                                     goToRibbon(selectedRibbon: sr[0], | ||||||
|                                                destRibbon: br, |                                                destRibbon: br[0], | ||||||
|                                                appDatabase: appDatabase, |                                                appDatabase: appDatabase, | ||||||
|                                                paneConnector: paneConnector, |                                                paneConnector: paneConnector, | ||||||
|                                                loading: false) |                                                loading: false) | ||||||
|  |  | ||||||
|  | @ -24,8 +24,24 @@ struct SegDenormRequest: Queryable { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     func fetchValue(_ db: Database) throws -> [SegDenorm] { |     func fetchValue(_ db: Database) throws -> [SegDenorm] { | ||||||
|         print("segs denorm fetching for \(book)") |         // print("woof segs denorm fetching for \(book)") | ||||||
|         print(book) |         // print(book) | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |         do | ||||||
|  |         { | ||||||
|  |             print("fetching segs") | ||||||
|  | 
 | ||||||
|  |         var ret = try Ribbon.fetchAll(db, sql: """ | ||||||
|  |         SELECT Ribbon.* FROM SelectedRibbon \ | ||||||
|  |         JOIN (select distinct r1.* from Ribbon r1 join Ribbon r2 ON \ | ||||||
|  |             r1.undoLevel = r2.currentLevel AND r1.id = r2.id ORDER BY pos ASC) as Ribbon \ | ||||||
|  |         ON SelectedRibbon.ribbonGroupId = Ribbon.groupId \ | ||||||
|  |         WHERE SelectedRibbon.rowId = 1 | ||||||
|  |         """) | ||||||
|  |         // print("Selected Ribbon query result: \(ret)") | ||||||
|  |         var book = ret[0].book | ||||||
|  | 
 | ||||||
|         var sql = """ |         var sql = """ | ||||||
|         select seg_id as id, seg.book as book, group_concat(line.body, ';;') as body from \ |         select seg_id as id, seg.book as book, group_concat(line.body, ';;') as body from \ | ||||||
|         (select * from seg  where seg.book = '\(book)') as seg \ |         (select * from seg  where seg.book = '\(book)') as seg \ | ||||||
|  | @ -33,9 +49,7 @@ struct SegDenormRequest: Queryable { | ||||||
|         on seg.line_id = line.line_id  group by seg.seg_id |         on seg.line_id = line.line_id  group by seg.seg_id | ||||||
|         """ |         """ | ||||||
| 
 | 
 | ||||||
|         do |             var ret2 =  try SegDenorm.fetchAll(db, sql: sql) | ||||||
|         { |  | ||||||
|             var ret =  try SegDenorm.fetchAll(db, sql: sql) |  | ||||||
| 
 | 
 | ||||||
|         // print("SEGS DENORM") |         // print("SEGS DENORM") | ||||||
|         // print(ret[0]) |         // print(ret[0]) | ||||||
|  | @ -51,9 +65,7 @@ struct SegDenormRequest: Queryable { | ||||||
|         // print("test sql result") |         // print("test sql result") | ||||||
|         // print(ret2[0]) |         // print(ret2[0]) | ||||||
| 
 | 
 | ||||||
| 
 |         return ret2 | ||||||
| 
 |  | ||||||
|         return ret |  | ||||||
| 
 | 
 | ||||||
|     } catch let error { |     } catch let error { | ||||||
|         print(error.localizedDescription) |         print(error.localizedDescription) | ||||||
|  |  | ||||||
|  | @ -27,7 +27,7 @@ | ||||||
| 		85431A902905F4F600EE0760 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 85431A8F2905F4F600EE0760 /* Preview Assets.xcassets */; }; | 		85431A902905F4F600EE0760 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 85431A8F2905F4F600EE0760 /* Preview Assets.xcassets */; }; | ||||||
| 		85431A922905F4F600EE0760 /* Persistence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85431A912905F4F600EE0760 /* Persistence.swift */; }; | 		85431A922905F4F600EE0760 /* Persistence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85431A912905F4F600EE0760 /* Persistence.swift */; }; | ||||||
| 		85431A9C2905F5D800EE0760 /* SwiftUIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85431A9B2905F5D800EE0760 /* SwiftUIView.swift */; }; | 		85431A9C2905F5D800EE0760 /* SwiftUIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85431A9B2905F5D800EE0760 /* SwiftUIView.swift */; }; | ||||||
| 		857C34492BFB7DC800661A63 /* Fenestra.swift in Sources */ = {isa = PBXBuildFile; fileRef = 857C34482BFB7DC800661A63 /* Fenestra.swift */; }; | 		857C34492BFB7DC800661A63 /* Pane.swift in Sources */ = {isa = PBXBuildFile; fileRef = 857C34482BFB7DC800661A63 /* Pane.swift */; }; | ||||||
| 		8590D96729A183EE001EF84F /* AppDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8590D96629A183EE001EF84F /* AppDatabase.swift */; }; | 		8590D96729A183EE001EF84F /* AppDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8590D96629A183EE001EF84F /* AppDatabase.swift */; }; | ||||||
| 		8590D96929A18A6D001EF84F /* LineRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8590D96829A18A6C001EF84F /* LineRequest.swift */; }; | 		8590D96929A18A6D001EF84F /* LineRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8590D96829A18A6C001EF84F /* LineRequest.swift */; }; | ||||||
| 		8590D96C29A92146001EF84F /* JsonImport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8590D96B29A92146001EF84F /* JsonImport.swift */; }; | 		8590D96C29A92146001EF84F /* JsonImport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8590D96B29A92146001EF84F /* JsonImport.swift */; }; | ||||||
|  | @ -68,7 +68,7 @@ | ||||||
| 		85431A8F2905F4F600EE0760 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; }; | 		85431A8F2905F4F600EE0760 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; }; | ||||||
| 		85431A912905F4F600EE0760 /* Persistence.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Persistence.swift; sourceTree = "<group>"; }; | 		85431A912905F4F600EE0760 /* Persistence.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Persistence.swift; sourceTree = "<group>"; }; | ||||||
| 		85431A9B2905F5D800EE0760 /* SwiftUIView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUIView.swift; sourceTree = "<group>"; }; | 		85431A9B2905F5D800EE0760 /* SwiftUIView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUIView.swift; sourceTree = "<group>"; }; | ||||||
| 		857C34482BFB7DC800661A63 /* Fenestra.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Fenestra.swift; sourceTree = "<group>"; }; | 		857C34482BFB7DC800661A63 /* Pane.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Pane.swift; sourceTree = "<group>"; }; | ||||||
| 		8590D96629A183EE001EF84F /* AppDatabase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDatabase.swift; sourceTree = "<group>"; }; | 		8590D96629A183EE001EF84F /* AppDatabase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDatabase.swift; sourceTree = "<group>"; }; | ||||||
| 		8590D96829A18A6C001EF84F /* LineRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LineRequest.swift; sourceTree = "<group>"; }; | 		8590D96829A18A6C001EF84F /* LineRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LineRequest.swift; sourceTree = "<group>"; }; | ||||||
| 		8590D96B29A92146001EF84F /* JsonImport.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JsonImport.swift; sourceTree = "<group>"; }; | 		8590D96B29A92146001EF84F /* JsonImport.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JsonImport.swift; sourceTree = "<group>"; }; | ||||||
|  | @ -121,7 +121,7 @@ | ||||||
| 				851259B92C0F355D00BE70F8 /* BookmarkIcon.swift */, | 				851259B92C0F355D00BE70F8 /* BookmarkIcon.swift */, | ||||||
| 				851259B12C05299200BE70F8 /* ForwardArrow.swift */, | 				851259B12C05299200BE70F8 /* ForwardArrow.swift */, | ||||||
| 				851259AF2C05281300BE70F8 /* BackButton.swift */, | 				851259AF2C05281300BE70F8 /* BackButton.swift */, | ||||||
| 				857C34482BFB7DC800661A63 /* Fenestra.swift */, | 				857C34482BFB7DC800661A63 /* Pane.swift */, | ||||||
| 				8594ED972BF6845F001213F2 /* HexColor.swift */, | 				8594ED972BF6845F001213F2 /* HexColor.swift */, | ||||||
| 				85E00E7B29F34D2D00FF9E78 /* ScrollState.swift */, | 				85E00E7B29F34D2D00FF9E78 /* ScrollState.swift */, | ||||||
| 				85E00E7D29F34D3700FF9E78 /* ScrollStateRequest.swift */, | 				85E00E7D29F34D3700FF9E78 /* ScrollStateRequest.swift */, | ||||||
|  | @ -297,7 +297,7 @@ | ||||||
| 			buildActionMask = 2147483647; | 			buildActionMask = 2147483647; | ||||||
| 			files = ( | 			files = ( | ||||||
| 				85431A922905F4F600EE0760 /* Persistence.swift in Sources */, | 				85431A922905F4F600EE0760 /* Persistence.swift in Sources */, | ||||||
| 				857C34492BFB7DC800661A63 /* Fenestra.swift in Sources */, | 				857C34492BFB7DC800661A63 /* Pane.swift in Sources */, | ||||||
| 				85942EEB29AD55A400307621 /* RibbonRequest.swift in Sources */, | 				85942EEB29AD55A400307621 /* RibbonRequest.swift in Sources */, | ||||||
| 				851259BA2C0F355D00BE70F8 /* BookmarkIcon.swift in Sources */, | 				851259BA2C0F355D00BE70F8 /* BookmarkIcon.swift in Sources */, | ||||||
| 				85431A8B2905F4F500EE0760 /* ContentView.swift in Sources */, | 				85431A8B2905F4F500EE0760 /* ContentView.swift in Sources */, | ||||||
|  |  | ||||||
|  | @ -410,6 +410,7 @@ extension AppDatabase { | ||||||
|                                    book: "bible.john", |                                    book: "bible.john", | ||||||
|                                    scrollId: "1", |                                    scrollId: "1", | ||||||
|                                    scrollOffset: 0).inserted(db) |                                    scrollOffset: 0).inserted(db) | ||||||
|  | 
 | ||||||
|                     _ = try Ribbon(id: 2, |                     _ = try Ribbon(id: 2, | ||||||
|                                    groupId: 2, |                                    groupId: 2, | ||||||
|                                    pos: 2, |                                    pos: 2, | ||||||
|  |  | ||||||
|  | @ -365,6 +365,8 @@ struct ContentView: View { | ||||||
| 
 | 
 | ||||||
|                             var swipeWidth = gesture.translation.width |                             var swipeWidth = gesture.translation.width | ||||||
|                             var swipeActual = gesture.translation.width + pulledOut.width |                             var swipeActual = gesture.translation.width + pulledOut.width | ||||||
|  | 
 | ||||||
|  |                             // swiping right | ||||||
|                             if swipeWidth > 0 { |                             if swipeWidth > 0 { | ||||||
|                                 if swipeActual > rightSwipeLimit { |                                 if swipeActual > rightSwipeLimit { | ||||||
|                                     swipeWidth = rightSwipeLimit + pow(swipeActual - rightSwipeLimit, 0.8) |                                     swipeWidth = rightSwipeLimit + pow(swipeActual - rightSwipeLimit, 0.8) | ||||||
|  | @ -372,6 +374,7 @@ struct ContentView: View { | ||||||
| 
 | 
 | ||||||
|                                 mainSwipe.width = swipeWidth - pulledOut.width |                                 mainSwipe.width = swipeWidth - pulledOut.width | ||||||
| 
 | 
 | ||||||
|  |                             // swiping right | ||||||
|                             } else { |                             } else { | ||||||
|                                 if swipeActual < leftSwipeLimit { |                                 if swipeActual < leftSwipeLimit { | ||||||
|                                     swipeWidth = leftSwipeLimit - pow(-swipeActual + leftSwipeLimit, 0.8) |                                     swipeWidth = leftSwipeLimit - pow(-swipeActual + leftSwipeLimit, 0.8) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue