i think ive fixed all the performance issues w searching

This commit is contained in:
Nihaal Sharma committed 2026-05-01 19:15:04 +01:00
1 parent cf218bb440
commit d19eb97bd0
5 files changed
+38 -19

No files matched your search

+2 -1
View File
@@ -14,6 +14,7 @@ struct GifView: View {
@State var url: URL
@State var gif: [(frame: CGImage, showFor: Double)] = []
@State var currentI: Int = 0
@State var isVisible: Bool = false
@State var timer: Timer?
@@ -62,7 +63,7 @@ struct GifView: View {
Group {
if gif.isEmpty {
ProgressView()
// .controlSize(.large)
.modifier(fadeIn())
} else if url.pathExtension == "gif" {
TimelineView(.animation) { tl in
if currentI < gif.count {
@@ -142,3 +142,19 @@ extension View {
modifier(TabViewBottomAcceessorySafe(isEnabled: isEnabled, contents: content))
}
}
struct fadeIn: ViewModifier {
@State private var isVisible: Bool = false
func body(content: Content) -> some View {
content
.opacity(isVisible ? 1 : 0)
.scaleEffect(isVisible ? 1 : 0)
.onAppear {
withAnimation { isVisible = true }
}
.onDisappear {
withAnimation { isVisible = false }
}
}
}
@@ -28,8 +28,10 @@ struct EmojiTableView: UIViewRepresentable {
context.coordinator.items = items
// guard itemsBefore != itemsAfter else { return }
Task.detached {
if itemsBefore.count-itemsAfter.count > 10_000 {
//removing more than 10k
if !(-10_000...10_000).contains(itemsBefore.count-itemsAfter.count) {
//diff of more than 10k
await context.coordinator.instantApplySnapshot()
} else if itemsAfter == itemsBefore {
await context.coordinator.instantApplySnapshot()
} else {
await context.coordinator.applySnapshot(animated: true)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.