From dca1f06e91fa50d970221f020cbc45d4eeef10c0 Mon Sep 17 00:00:00 2001 From: Isaac <> Date: Sat, 6 Dec 2025 01:42:16 +0800 Subject: [PATCH] Update --- .../MakeProject/ProjectGenerator.swift | 12 ++++++--- .../Sources/MakeProject/TargetBuilder.swift | 25 +++++++++++++++---- .../ChatSearchNavigationContentNode.swift | 2 +- .../HeaderPanelContainerComponent.swift | 15 +++++++++-- .../Sources/ThemeGridController.swift | 3 --- 5 files changed, 43 insertions(+), 14 deletions(-) diff --git a/build-system/MakeProject/Sources/MakeProject/ProjectGenerator.swift b/build-system/MakeProject/Sources/MakeProject/ProjectGenerator.swift index 7b968b1835..92f965af55 100644 --- a/build-system/MakeProject/Sources/MakeProject/ProjectGenerator.swift +++ b/build-system/MakeProject/Sources/MakeProject/ProjectGenerator.swift @@ -18,10 +18,16 @@ class ProjectGenerator { let modules = try loadModules(from: modulesPath.string) print("Loaded \(modules.count) modules") - // Filter out empty modules + // Filter out empty modules, but keep: + // - Modules with source files (excluding .a) + // - Static library modules (only .a files) + // - XCFramework imports let validModules = modules.filter { name, module in - let sources = module.sources.filter { !$0.hasSuffix(".a") } - return !sources.isEmpty || module.type == "apple_static_xcframework_import" + let nonStaticSources = module.sources.filter { !$0.hasSuffix(".a") } + let staticLibs = module.sources.filter { $0.hasSuffix(".a") } + return !nonStaticSources.isEmpty || + !staticLibs.isEmpty || + module.type == "apple_static_xcframework_import" } print("Processing \(validModules.count) non-empty modules") diff --git a/build-system/MakeProject/Sources/MakeProject/TargetBuilder.swift b/build-system/MakeProject/Sources/MakeProject/TargetBuilder.swift index 30d0bb3c3e..2885fb86e4 100644 --- a/build-system/MakeProject/Sources/MakeProject/TargetBuilder.swift +++ b/build-system/MakeProject/Sources/MakeProject/TargetBuilder.swift @@ -343,6 +343,8 @@ class TargetBuilder { // Track all frameworks we've added to avoid duplicates var linkedFrameworks: Set = [] + // Track library search paths for static libraries + var staticLibSearchPaths: Set = [] // Add target dependency (only for direct deps) for depName in deps { @@ -375,18 +377,26 @@ class TargetBuilder { // Link static libraries directly for libPath in getStaticLibraries(for: depName) { let libName = Path(libPath).lastComponent - // Use absolute path to the static library in bazel-out - let absolutePath = "$(SRCROOT)/../\(libPath)" + // Create an absolute path to the project root then to the static library + // SRCROOT is xcode-files, so we need to go up one level to get to telegram-ios + let projectRoot = outputDir.parent() + let absoluteLibPath = (projectRoot + libPath).string let libRef = PBXFileReference( - sourceTree: .group, + sourceTree: .absolute, name: libName, lastKnownFileType: "archive.ar", - path: absolutePath + path: absoluteLibPath ) pbxproj.add(object: libRef) let buildFile = PBXBuildFile(file: libRef) pbxproj.add(object: buildFile) frameworksPhase.files?.append(buildFile) + + // Add the library's directory to LIBRARY_SEARCH_PATHS + let libDir = Path(absoluteLibPath).parent().string + if !staticLibSearchPaths.contains(libDir) { + staticLibSearchPaths.insert(libDir) + } } linkedFrameworks.insert(depName) continue @@ -412,7 +422,7 @@ class TargetBuilder { } // Update build configurations with dependency paths - if !depHeaderPaths.isEmpty || !deps.isEmpty { + if !depHeaderPaths.isEmpty || !deps.isEmpty || !staticLibSearchPaths.isEmpty { for config in target.buildConfigurationList?.buildConfigurations ?? [] { // Add header search paths if !depHeaderPaths.isEmpty { @@ -422,6 +432,11 @@ class TargetBuilder { // Ensure framework and module search paths include built products config.buildSettings["FRAMEWORK_SEARCH_PATHS"] = "$(inherited) $(BUILT_PRODUCTS_DIR)" config.buildSettings["SWIFT_INCLUDE_PATHS"] = "$(inherited) $(BUILT_PRODUCTS_DIR)" + // Add library search paths for static libraries + if !staticLibSearchPaths.isEmpty { + let existing = config.buildSettings["LIBRARY_SEARCH_PATHS"] as? String ?? "$(inherited)" + config.buildSettings["LIBRARY_SEARCH_PATHS"] = existing + " " + staticLibSearchPaths.sorted().joined(separator: " ") + } } } diff --git a/submodules/TelegramUI/Components/Chat/ChatSearchNavigationContentNode/Sources/ChatSearchNavigationContentNode.swift b/submodules/TelegramUI/Components/Chat/ChatSearchNavigationContentNode/Sources/ChatSearchNavigationContentNode.swift index 4637f89e3a..e67b4965e3 100644 --- a/submodules/TelegramUI/Components/Chat/ChatSearchNavigationContentNode/Sources/ChatSearchNavigationContentNode.swift +++ b/submodules/TelegramUI/Components/Chat/ChatSearchNavigationContentNode/Sources/ChatSearchNavigationContentNode.swift @@ -137,7 +137,7 @@ public final class ChatSearchNavigationContentNode: NavigationBarContentNode { } override public var nominalHeight: CGFloat { - return 54.0 + return 60.0 } @objc private func onCloseTapGesture(_ recognizer: UITapGestureRecognizer) { diff --git a/submodules/TelegramUI/Components/HeaderPanelContainerComponent/Sources/HeaderPanelContainerComponent.swift b/submodules/TelegramUI/Components/HeaderPanelContainerComponent/Sources/HeaderPanelContainerComponent.swift index 8e7c78a458..c5d3ac344c 100644 --- a/submodules/TelegramUI/Components/HeaderPanelContainerComponent/Sources/HeaderPanelContainerComponent.swift +++ b/submodules/TelegramUI/Components/HeaderPanelContainerComponent/Sources/HeaderPanelContainerComponent.swift @@ -111,6 +111,11 @@ public final class HeaderPanelContainerComponent: Component { } func update(component: HeaderPanelContainerComponent, availableSize: CGSize, state: EmptyComponentState, environment: Environment, transition: ComponentTransition) -> CGSize { + var isAnimatingReplacement = false + if let previousComponent = self.component { + isAnimatingReplacement = !component.panels.contains(where: { panel in previousComponent.panels.contains(where: { $0.key == panel.key }) }) + } + self.component = component self.state = state @@ -183,7 +188,11 @@ public final class HeaderPanelContainerComponent: Component { panelView.addSubview(panelComponentView) transition.animateAlpha(view: panelView, from: 0.0, to: 1.0) panelView.separator.opacity = 0.0 - panelView.frame = CGRect(origin: panelFrame.origin, size: CGSize(width: panelFrame.width, height: 0.0)) + if isAnimatingReplacement { + panelView.frame = panelFrame + } else { + panelView.frame = CGRect(origin: panelFrame.origin, size: CGSize(width: panelFrame.width, height: 0.0)) + } } panelView.separator.backgroundColor = component.theme.list.itemPlainSeparatorColor.cgColor @@ -209,7 +218,9 @@ public final class HeaderPanelContainerComponent: Component { transition.setAlpha(layer: separator, alpha: 0.0, completion: { [weak separator] _ in separator?.removeFromSuperlayer() }) - transition.setFrame(view: panelView, frame: CGRect(origin: panelView.frame.origin, size: CGSize(width: panelView.bounds.width, height: 0.0))) + if !isAnimatingReplacement { + transition.setFrame(view: panelView, frame: CGRect(origin: panelView.frame.origin, size: CGSize(width: panelView.bounds.width, height: 0.0))) + } } } for key in removedPanelKeys { diff --git a/submodules/TelegramUI/Components/Settings/WallpaperGridScreen/Sources/ThemeGridController.swift b/submodules/TelegramUI/Components/Settings/WallpaperGridScreen/Sources/ThemeGridController.swift index 83c0c30381..dbe399e213 100644 --- a/submodules/TelegramUI/Components/Settings/WallpaperGridScreen/Sources/ThemeGridController.swift +++ b/submodules/TelegramUI/Components/Settings/WallpaperGridScreen/Sources/ThemeGridController.swift @@ -124,7 +124,6 @@ public final class ThemeGridController: ViewController { self.statusBar.statusBarStyle = self.presentationData.theme.rootController.statusBarStyle.style self.navigationBar?.updatePresentationData(NavigationBarPresentationData(presentationData: self.presentationData), transition: .immediate) - self.searchContentNode?.updateThemeAndPlaceholder(theme: self.presentationData.theme, placeholder: self.presentationData.strings.Wallpaper_Search) if self.isNodeLoaded { self.controllerNode.updatePresentationData(self.presentationData) @@ -476,7 +475,6 @@ public final class ThemeGridController: ViewController { @objc func editPressed() { self.editingMode = true self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Done, style: .done, target: self, action: #selector(self.donePressed)) - self.searchContentNode?.setIsEnabled(false, animated: true) self.controllerNode.updateState { state in var state = state state.editing = true @@ -487,7 +485,6 @@ public final class ThemeGridController: ViewController { @objc func donePressed() { self.editingMode = false self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Edit, style: .plain, target: self, action: #selector(self.editPressed)) - self.searchContentNode?.setIsEnabled(true, animated: true) self.controllerNode.updateState { state in var state = state state.editing = false