Keep compatiable for SDK 27.0

This commit is contained in:
Kaede Akino committed 2026-09-19 14:00:58 +08:00
1 parent ec19c18951
commit 9f6899d18e
4 files changed
+44 -29

No files matched your search

+2 -1
View File
@@ -697,7 +697,8 @@ remain. Metrics uses vertical labeled-icon menu or horizontal principal segmente
coexist. iOS 27 uses `ToolbarOverflowMenu`, older OS labeled menus. Save stays labeled with form progress. Native
minimized SSH/SFTP search stays in every placement; sidebar/pose changes never activate search or claim focus.
On iOS 27.1 content reads active division/occlusion ReservedRegions after safe-area/keyboard layout. Frames include
When built with the iOS 27.1 SDK, iOS 27.1 content reads active division/occlusion ReservedRegions after
safe-area/keyboard layout. Frames include
margins and follow SwiftUI's leading-origin convention, including RTL. Terminal/shortcuts/notices occupy the largest
continuous unobstructed rectangle, ties top then leading. Ghostty resizes the existing PTY and rejects invalid
viewports; session ownership survives pose. Assistant keeps one transcript and one scrollable interaction surface
+10 -8
View File
@@ -122,15 +122,17 @@ struct MobileRegionReader<Content: View>: View {
private func regions(in geometry: GeometryProxy) -> [MobileReservedRegion] {
if let override { return override }
if #available(iOS 27.1, *) {
// The default mirrored query matches Layout placement in both LTR and RTL.
return geometry.reservedRegions(kind: .division).map {
MobileReservedRegion(kind: .division, frame: $0.frame, isActive: $0.isActive)
}
+ geometry.reservedRegions(kind: .occlusion).map {
MobileReservedRegion(kind: .occlusion, frame: $0.frame, isActive: $0.isActive)
#if TERMIND_HAS_IOS_27_1_SDK
if #available(iOS 27.1, *) {
// The default mirrored query matches Layout placement in both LTR and RTL.
return geometry.reservedRegions(kind: .division).map {
MobileReservedRegion(kind: .division, frame: $0.frame, isActive: $0.isActive)
}
}
+ geometry.reservedRegions(kind: .occlusion).map {
MobileReservedRegion(kind: .occlusion, frame: $0.frame, isActive: $0.isActive)
}
}
#endif
return []
}
}
+24 -16
View File
@@ -18,27 +18,35 @@ private struct MobileToolbarEnvironment: ViewModifier {
@Environment(\.tabBarPlacement) private var placement
func body(content: Content) -> some View {
if #available(iOS 27.1, *) {
content.modifier(MobileVerticalToolbarEnvironment(isTopBar: placement == .topBar))
} else {
#if TERMIND_HAS_IOS_27_1_SDK
if #available(iOS 27.1, *) {
content.modifier(MobileVerticalToolbarEnvironment(isTopBar: placement == .topBar))
} else {
content.environment(
\.mobileToolbarLayout,
MobileToolbarLayout(isTopBar: placement == .topBar))
}
#else
content.environment(
\.mobileToolbarLayout,
MobileToolbarLayout(isTopBar: placement == .topBar))
#endif
}
}
#if TERMIND_HAS_IOS_27_1_SDK
@available(iOS 27.1, *)
private struct MobileVerticalToolbarEnvironment: ViewModifier {
let isTopBar: Bool
@Environment(\.toolbarVerticalEdge) private var edge
func body(content: Content) -> some View {
content.environment(
\.mobileToolbarLayout,
MobileToolbarLayout(isTopBar: isTopBar, verticalEdge: edge))
}
}
}
@available(iOS 27.1, *)
private struct MobileVerticalToolbarEnvironment: ViewModifier {
let isTopBar: Bool
@Environment(\.toolbarVerticalEdge) private var edge
func body(content: Content) -> some View {
content.environment(
\.mobileToolbarLayout,
MobileToolbarLayout(isTopBar: isTopBar, verticalEdge: edge))
}
}
#endif
extension View {
func mobileToolbarEnvironment() -> some View {
+8 -4
View File
@@ -1786,7 +1786,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = TFI/TFI.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 24;
CURRENT_PROJECT_VERSION = 25;
GENERATE_INFOPLIST_FILE = YES;
ICLOUD_CONTAINER_ENVIRONMENT = Development;
INFOPLIST_FILE = TFI/Info.plist;
@@ -2059,7 +2059,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = TFI/TFI.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 24;
CURRENT_PROJECT_VERSION = 25;
GENERATE_INFOPLIST_FILE = YES;
ICLOUD_CONTAINER_ENVIRONMENT = Production;
INFOPLIST_FILE = TFI/Info.plist;
@@ -2220,6 +2220,8 @@
ONLY_ACTIVE_ARCH = YES;
STRING_CATALOG_GENERATE_SYMBOLS = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
"SWIFT_ACTIVE_COMPILATION_CONDITIONS[sdk=iphoneos27.1*]" = "$(inherited) TERMIND_HAS_IOS_27_1_SDK";
"SWIFT_ACTIVE_COMPILATION_CONDITIONS[sdk=iphonesimulator27.1*]" = "$(inherited) TERMIND_HAS_IOS_27_1_SDK";
SWIFT_APPROACHABLE_CONCURRENCY = YES;
SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -2277,6 +2279,8 @@
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
STRING_CATALOG_GENERATE_SYMBOLS = YES;
"SWIFT_ACTIVE_COMPILATION_CONDITIONS[sdk=iphoneos27.1*]" = "$(inherited) TERMIND_HAS_IOS_27_1_SDK";
"SWIFT_ACTIVE_COMPILATION_CONDITIONS[sdk=iphonesimulator27.1*]" = "$(inherited) TERMIND_HAS_IOS_27_1_SDK";
SWIFT_APPROACHABLE_CONCURRENCY = YES;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;
@@ -2298,7 +2302,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 31;
CURRENT_PROJECT_VERSION = 32;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "";
ENABLE_APP_SANDBOX = YES;
@@ -2335,7 +2339,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 31;
CURRENT_PROJECT_VERSION = 32;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "";
ENABLE_APP_SANDBOX = YES;