diff --git a/ElementX/Sources/Application/Navigation/NavigationTabCoordinator.swift b/ElementX/Sources/Application/Navigation/NavigationTabCoordinator.swift index b1ea7af4a..f635205da 100644 --- a/ElementX/Sources/Application/Navigation/NavigationTabCoordinator.swift +++ b/ElementX/Sources/Application/Navigation/NavigationTabCoordinator.swift @@ -38,7 +38,10 @@ import SwiftUI } func barVisibility(in horizontalSizeClass: UserInterfaceSizeClass?) -> Visibility { - if let barVisibilityOverride { + if #unavailable(iOS 18.0) { + // There are glitches with the tab bar on iPadOS 17, so disable the tab bar until we have fixed it. + .hidden + } else if let barVisibilityOverride { barVisibilityOverride } else if horizontalSizeClass == .compact, navigationSplitCoordinator?.detailCoordinator != nil { // Whilst we support pushing screens on the stack in the sidebarCoordinator, in practice diff --git a/ElementX/Sources/Application/Settings/AppSettings.swift b/ElementX/Sources/Application/Settings/AppSettings.swift index 41b359ec7..3ddf464f3 100644 --- a/ElementX/Sources/Application/Settings/AppSettings.swift +++ b/ElementX/Sources/Application/Settings/AppSettings.swift @@ -61,7 +61,6 @@ final class AppSettings { case enableKeyShareOnInvite case knockingEnabled case threadsEnabled - case spacesEnabled case developerOptionsEnabled case nextGenHTMLParserEnabled case linkPreviewsEnabled @@ -390,9 +389,6 @@ final class AppSettings { @UserPreference(key: UserDefaultsKeys.threadsEnabled, defaultValue: false, storageType: .userDefaults(store)) var threadsEnabled - @UserPreference(key: UserDefaultsKeys.spacesEnabled, defaultValue: true, storageType: .userDefaults(store)) - var spacesEnabled - @UserPreference(key: UserDefaultsKeys.nextGenHTMLParserEnabled, defaultValue: true, storageType: .userDefaults(store)) var nextGenHTMLParserEnabled diff --git a/ElementX/Sources/FlowCoordinators/UserSessionFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/UserSessionFlowCoordinator.swift index ee3c691a8..f3ddf7aea 100644 --- a/ElementX/Sources/FlowCoordinators/UserSessionFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/UserSessionFlowCoordinator.swift @@ -84,10 +84,6 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol { chatsTabDetails = .init(tag: HomeTab.chats, title: L10n.screenHomeTabChats, icon: \.chat, selectedIcon: \.chatSolid) chatsTabDetails.navigationSplitCoordinator = chatsSplitCoordinator - if !flowParameters.appSettings.spacesEnabled { - chatsTabDetails.barVisibilityOverride = .hidden - } - let spacesSplitCoordinator = NavigationSplitCoordinator(placeholderCoordinator: PlaceholderScreenCoordinator(hideBrandChrome: flowParameters.appSettings.hideBrandChrome)) spaceExplorerFlowCoordinator = SpaceExplorerFlowCoordinator(navigationSplitCoordinator: spacesSplitCoordinator, flowParameters: flowParameters) @@ -289,9 +285,8 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol { } .store(in: &cancellables) - flowParameters.appSettings.$spacesEnabled - .combineLatest(userSession.clientProxy.spaceService.joinedSpacesPublisher) - .map { $0 && !$1.isEmpty ? nil : .hidden } + userSession.clientProxy.spaceService.joinedSpacesPublisher + .map { $0.isEmpty ? .hidden : nil } .weakAssign(to: \.chatsTabDetails.barVisibilityOverride, on: self) .store(in: &cancellables) } diff --git a/ElementX/Sources/Screens/LocationSharing/View/StaticLocationScreen.swift b/ElementX/Sources/Screens/LocationSharing/View/StaticLocationScreen.swift index d5a450303..feb57329c 100644 --- a/ElementX/Sources/Screens/LocationSharing/View/StaticLocationScreen.swift +++ b/ElementX/Sources/Screens/LocationSharing/View/StaticLocationScreen.swift @@ -130,7 +130,7 @@ struct StaticLocationScreen: View { Image(systemName: "square.and.arrow.up") } } - + @ViewBuilder private var shareSheet: some View { let location = context.viewState.initialMapCenter @@ -139,8 +139,17 @@ struct StaticLocationScreen: View { applicationActivities: ShareToMapsAppActivity.MapsAppType.allCases.map { ShareToMapsAppActivity(type: $0, location: location, locationDescription: locationDescription) }) .edgesIgnoringSafeArea(.bottom) .presentationDetents([.medium, .large]) + .presentationCompactAdaptation(shareSheetCompactPresentation) .presentationDragIndicator(.hidden) } + + private var shareSheetCompactPresentation: PresentationAdaptation { + if #available(iOS 26.0, *) { + .none // ShareLinks use a popover presentation on iOS 26, let it match that. + } else { + .sheet + } + } } // MARK: - Previews diff --git a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift index 68562e858..435c1caa9 100644 --- a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift +++ b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift @@ -41,7 +41,6 @@ protocol DeveloperOptionsProtocol: AnyObject { var enableOnlySignedDeviceIsolationMode: Bool { get set } var enableKeyShareOnInvite: Bool { get set } - var spacesEnabled: Bool { get set } var hideQuietNotificationAlerts: Bool { get set } var hideUnreadMessagesBadge: Bool { get set } diff --git a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift index 9e419ff87..abdc776af 100644 --- a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift +++ b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift @@ -33,10 +33,6 @@ struct DeveloperOptionsScreen: View { } Section("General") { - Toggle(isOn: $context.spacesEnabled) { - Text("Spaces") - } - Toggle(isOn: $context.nextGenHTMLParserEnabled) { Text("Next gen HTML parsing") } diff --git a/ElementX/Sources/Screens/Spaces/SpaceScreen/View/SpaceScreen.swift b/ElementX/Sources/Screens/Spaces/SpaceScreen/View/SpaceScreen.swift index bd4006c48..1069690ac 100644 --- a/ElementX/Sources/Screens/Spaces/SpaceScreen/View/SpaceScreen.swift +++ b/ElementX/Sources/Screens/Spaces/SpaceScreen/View/SpaceScreen.swift @@ -55,20 +55,27 @@ struct SpaceScreen: View { mediaProvider: context.mediaProvider) } - ToolbarItemGroup(placement: .secondaryAction) { - // FIXME: The ShareLink crashes on iOS 26 due to the share sheet failing to morph out of the button 🤦‍♂️ - if let permalink = context.viewState.permalink, #unavailable(iOS 26.0) { - Section { - ShareLink(item: permalink) { - Label(L10n.actionShare, icon: \.shareIos) + // This should really use a ToolbarItemGroup(placement: .secondaryAction), however it + // was crashing on iOS 26.0 when tapping the ShareLink as the popover presentation + // controller attempts to anchor itself to the button that is no longer visible. + ToolbarItem(placement: .primaryAction) { + Menu { + if let permalink = context.viewState.permalink { + Section { + ShareLink(item: permalink) { + Label(L10n.actionShare, icon: \.shareIos) + } } } - } - - Section { - Button(role: .destructive) { context.send(viewAction: .leaveSpace) } label: { - Label(L10n.actionLeaveSpace, icon: \.leave) + + Section { + Button(role: .destructive) { context.send(viewAction: .leaveSpace) } label: { + Label(L10n.actionLeaveSpace, icon: \.leave) + } } + } label: { + // Use an SF Symbol to match what ToolbarItemGroup(placement: .secondaryAction) would give us. + Image(systemSymbol: .ellipsis) } } } diff --git a/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift b/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift index 832614a74..6df31d848 100644 --- a/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift +++ b/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift @@ -118,11 +118,12 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol { } func setFilter(_ filter: RoomSummaryProviderFilter) { - let baseFilter: [RoomListEntriesDynamicFilterKind] = if appSettings.spacesEnabled { + let baseFilter: [RoomListEntriesDynamicFilterKind] = if #available(iOS 18.0, *) { [.any(filters: [.all(filters: [.nonSpace, .nonLeft]), .all(filters: [.space, .invite])]), .deduplicateVersions] } else { + // Don't show space invites on iOS 17 given that the tab bar is disabled due to glitches on iPad. [.nonLeft, .nonSpace, .deduplicateVersions] } diff --git a/ElementX/Sources/UITests/UITestsAppCoordinator.swift b/ElementX/Sources/UITests/UITestsAppCoordinator.swift index 9a960fa24..afc8d5323 100644 --- a/ElementX/Sources/UITests/UITestsAppCoordinator.swift +++ b/ElementX/Sources/UITests/UITestsAppCoordinator.swift @@ -584,7 +584,6 @@ class MockScreen: Identifiable { appSettings.hasRunIdentityConfirmationOnboarding = true appSettings.hasRunNotificationPermissionsOnboarding = true appSettings.analyticsConsentState = .optedOut - appSettings.spacesEnabled = true appSettings.hasSeenSpacesAnnouncement = true let clientProxy = ClientProxyMock(.init(userID: "@mock:client.com",