Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/compound-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Compound

on:
push:
branches: [ main ]
branches: [ develop ]

pull_request:

Expand Down
4 changes: 0 additions & 4 deletions ElementX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,6 @@
8015842CB4DE1BE414D2CDED /* AppLockSetupBiometricsScreenCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C62E07C1164F5120727A2A8 /* AppLockSetupBiometricsScreenCoordinator.swift */; };
804C15D8ADE0EA7A5268F58A /* OverridableAvatarImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 648DD1C10E4957CB791FE0B8 /* OverridableAvatarImage.swift */; };
80DEA2A4B20F9E279EAE6B2B /* UserProfile+Mock.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAD01F7FC2BBAC7351948595 /* UserProfile+Mock.swift */; };
80F1B442DB5E2C362ACDD8E2 /* ZoomTransition.swift in Sources */ = {isa = PBXBuildFile; fileRef = 018194CAFBE80720FECCEDEE /* ZoomTransition.swift */; };
80F6C8EFCA4564B67F0D34B0 /* DeactivateAccountScreenViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D77F75B3E9F99864048A422A /* DeactivateAccountScreenViewModelTests.swift */; };
81A7C020CB5F6232242A8414 /* UserSessionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F36C0A6D59717193F49EA986 /* UserSessionTests.swift */; };
8285FF4B2C2331758C437FF7 /* ReportContentScreenViewModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 713B48DBF65DE4B0DD445D66 /* ReportContentScreenViewModelProtocol.swift */; };
Expand Down Expand Up @@ -1495,7 +1494,6 @@
00E5B2CBEF8F96424F095508 /* RoomDetailsEditScreenViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomDetailsEditScreenViewModelTests.swift; sourceTree = "<group>"; };
011AFA4990C585D157829679 /* DeclineAndBlockScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeclineAndBlockScreenViewModel.swift; sourceTree = "<group>"; };
012A284622B32052015F1F89 /* ReadMarkerRoomTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadMarkerRoomTimelineView.swift; sourceTree = "<group>"; };
018194CAFBE80720FECCEDEE /* ZoomTransition.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZoomTransition.swift; sourceTree = "<group>"; };
01B795AAAB7B8747FE2FF311 /* LogViewerScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogViewerScreenModels.swift; sourceTree = "<group>"; };
01C4C7DB37597D7D8379511A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
022E6BD64CB4610B9C95FC02 /* UserDetailsEditScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDetailsEditScreenViewModel.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -6139,7 +6137,6 @@
children = (
EF1593DD87F974F8509BB619 /* ElementAnimations.swift */,
97CE98208321C4D66E363612 /* ShimmerModifier.swift */,
018194CAFBE80720FECCEDEE /* ZoomTransition.swift */,
);
path = Animation;
sourceTree = "<group>";
Expand Down Expand Up @@ -8445,7 +8442,6 @@
B773ACD8881DB18E876D950C /* WaveformSource.swift in Sources */,
08CB4BD12CEEDE6AAE4A18DD /* WindowManager.swift in Sources */,
AE5AAD9E32511544FDFA5560 /* WindowManagerProtocol.swift in Sources */,
80F1B442DB5E2C362ACDD8E2 /* ZoomTransition.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ class ChatsFlowCoordinator: FlowCoordinatorProtocol {
switch context.toState {
case .roomList(detailState: .room(let detailStateRoomID)):
self?.selectedRoomSubject.send(detailStateRoomID)
case .roomList(detailState: nil):
self?.selectedRoomSubject.send(nil)
default:
break
}
Expand Down
30 changes: 0 additions & 30 deletions ElementX/Sources/Other/SwiftUI/Animation/ZoomTransition.swift

This file was deleted.

60 changes: 58 additions & 2 deletions ElementX/Sources/Other/SwiftUI/Backports.swift
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noice!

Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,68 @@
import SwiftUI

extension View {
@ViewBuilder
func backportTabBarMinimizeBehaviorOnScrollDown() -> some View {
// MARK: iOS 18

/// Uses the old page style modal so that on iPadOS 18 the presentation detents have no effect.
@ViewBuilder func backportPresentationSizingPage() -> some View {
if #available(iOS 18.0, *) {
presentationSizing(.page)
} else {
self
}
}

/// A convenience modifier to conditionally apply `.navigationTransition(.zoom(…))` when available.
@ViewBuilder func backportNavigationTransitionZoom(sourceID: some Hashable, in namespace: Namespace.ID) -> some View {
if #available(iOS 18.0, *) {
navigationTransition(.zoom(sourceID: sourceID, in: namespace))
} else {
self
}
}

/// A convenience modifier to conditionally apply `.matchedTransitionSource(…)` when available.
@ViewBuilder func backportMatchedTransitionSource(id: some Hashable, in namespace: Namespace.ID) -> some View {
if #available(iOS 18.0, *) {
matchedTransitionSource(id: id, in: namespace)
} else {
self
}
}

@ViewBuilder func backportAccessibilityHint(_ hint: String, isEnabled: Bool) -> some View {
if #available(iOS 18, *) {
accessibilityHint(hint, isEnabled: isEnabled)
} else {
self
}
}

// MARK: iOS 26

@ViewBuilder func backportTabBarMinimizeBehaviorOnScrollDown() -> some View {
if #available(iOS 26.0, *) {
tabBarMinimizeBehavior(.onScrollDown)
} else {
self
}
}

@ViewBuilder func backportScrollEdgeEffectHidden() -> some View {
if #available(iOS 26, *) {
scrollEdgeEffectHidden()
} else {
self
}
}
}

extension ToolbarContent {
@ToolbarContentBuilder func backportSharedBackgroundVisibility(_ visibility: Visibility) -> some ToolbarContent {
if #available(iOS 26.0, *) {
sharedBackgroundVisibility(visibility)
} else {
self
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extension TextFieldStyle where Self == ElementTextFieldStyle {
}

/// The text field style used in authentication screens.
struct ElementTextFieldStyle: TextFieldStyle {
struct ElementTextFieldStyle: @MainActor TextFieldStyle {
enum State {
case success
case error
Expand Down
5 changes: 3 additions & 2 deletions ElementX/Sources/Other/SwiftUI/Views/RoomHeaderView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ struct RoomHeaderView: View {
let mediaProvider: MediaProviderProtocol?

var body: some View {
if ProcessInfo.isRunningAccessibilityTests {
// Accessibility tests scale up the dynamic size in real time which may break the view
if ProcessInfo.isRunningAccessibilityTests || ProcessInfo.processInfo.isiOSAppOnMac {
// Accessibility tests scale up the dynamic size in real time which may break the view.
// macOS really doesn't like the greedy size and does weird things to it.
content
} else {
content
Expand Down
11 changes: 3 additions & 8 deletions ElementX/Sources/Screens/HomeScreen/View/HomeScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,7 @@ struct HomeScreen: View {
actions: leaveRoomAlertActions,
message: leaveRoomAlertMessage)
.navigationTitle(L10n.screenRoomlistMainSpaceTitle)
.toolbar {
if #available(iOS 26, *) {
toolbar
.sharedBackgroundVisibility(.hidden)
} else {
toolbar
}
}
.toolbar { toolbar }
.background(Color.compound.bgCanvasDefault.ignoresSafeArea())
.track(screen: .Home)
.bloom()
Expand All @@ -43,10 +36,12 @@ struct HomeScreen: View {
ToolbarItem(placement: .navigationBarLeading) {
settingsButton
}
.backportSharedBackgroundVisibility(.hidden)

ToolbarItem(placement: .primaryAction) {
newRoomButton
}
.backportSharedBackgroundVisibility(.hidden)
}

private var settingsButton: some View {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,11 @@ struct MediaEventsTimelineScreen: View {
if context.viewState.shouldShowEmptyState {
emptyState
} else {
if #available(iOS 26, *) {
scrollView
// Remove the glass effect of iOS 26+
// A flipped table view will always trigger it
// since the nav bar thinks is always at the bottom.
.scrollEdgeEffectHidden()
} else {
scrollView
}
scrollView
// Remove the glass effect of iOS 26+
// A flipped table view will always trigger it
// since the nav bar thinks is always at the bottom.
.backportScrollEdgeEffectHidden()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ private struct BackgroundView<Content: View>: View {
.clipShape(RoundedCornerShape(radius: shadowRadius, corners: [.topLeft, .topRight]))
.shadow(color: .black.opacity(0.20), radius: 20.0, x: 0.0, y: 3.0)
.mask(Rectangle().padding(.init(top: -(shadowRadius * 2), leading: 0.0, bottom: 0.0, trailing: 0.0)))
.edgesIgnoringSafeArea(.all)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,7 @@ struct SpaceListScreen: View {
}
.navigationTitle(L10n.screenSpaceListTitle)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
if #available(iOS 26, *) {
toolbar
.sharedBackgroundVisibility(.hidden)
} else {
toolbar
}
}
.toolbar { toolbar }
.background(Color.compound.bgCanvasDefault.ignoresSafeArea())
.bloom()
}
Expand Down Expand Up @@ -90,11 +83,13 @@ struct SpaceListScreen: View {
}
.accessibilityLabel(L10n.commonSettings)
}
.backportSharedBackgroundVisibility(.hidden)

ToolbarItem(placement: .principal) {
// Hides the navigationTitle (which is set for the navigation stack label).
Text("").accessibilityHidden(true)
}
.backportSharedBackgroundVisibility(.hidden)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct TimelineItemMenu: View {
}
}
.accessibilityIdentifier(A11yIdentifiers.roomScreen.timelineItemActionMenu)
.presentationPage()
.backportPresentationSizingPage()
.presentationDetents([.medium, .large])
.presentationBackground(Color.compound.bgCanvasDefault)
.presentationDragIndicator(.visible)
Expand Down Expand Up @@ -251,17 +251,6 @@ private extension EncryptionAuthenticity {
}
}

private extension View {
/// Uses the old page style modal so that on iPadOS 18 the presentation detents have no effect.
@ViewBuilder func presentationPage() -> some View {
if #available(iOS 18.0, *) {
presentationSizing(.page)
} else {
self
}
}
}

// MARK: - Previews

struct TimelineItemMenu_Previews: PreviewProvider, TestablePreview {
Expand Down
10 changes: 3 additions & 7 deletions ElementX/Sources/Screens/Timeline/View/Polls/PollView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,9 @@ struct PollView: View {

private var optionsView: some View {
ForEach(poll.options, id: \.id) { option in
if #available(iOS 18, *) {
pollOption(option: option)
.accessibilityHint(L10n.a11yPollsWillRemoveSelection,
isEnabled: isRemovePreviousSelectionHintEnabled(option: option))
} else {
pollOption(option: option)
}
pollOption(option: option)
.backportAccessibilityHint(L10n.a11yPollsWillRemoveSelection,
isEnabled: isRemovePreviousSelectionHintEnabled(option: option))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct RoomEventStringBuilder {
default: L10n.commonWaitingForDecryptionKey
}
return prefix(errorMessage, with: displayName, isOutgoing: isOutgoing)
case .other(eventType: let eventType):
case .other:
return nil // We shouldn't receive these without asking for custom event types.
}
case .failedToParseMessageLike, .failedToParseState:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
return buildRedactedTimelineItem(eventItemProxy, messageLikeContent, isOutgoing)
case .unableToDecrypt(let encryptedMessage):
return buildEncryptedTimelineItem(eventItemProxy, messageLikeContent, encryptedMessage, isOutgoing)
case .other(eventType: let eventType):
case .other:
return nil // We shouldn't receive these without asking for custom event types.
}
case .failedToParseMessageLike(let eventType, let error):
Expand Down
2 changes: 1 addition & 1 deletion ElementX/Sources/Services/Timeline/TimelineProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ final class TimelineProxy: TimelineProxyProtocol {
MXLog.info("Toggling reaction \(reaction) for event: \(eventOrTransactionID)")

do {
try await timeline.toggleReaction(itemId: eventOrTransactionID.rustValue, key: reaction)
_ = try await timeline.toggleReaction(itemId: eventOrTransactionID.rustValue, key: reaction)
MXLog.info("Finished toggling reaction for event: \(eventOrTransactionID)")
return .success(())
} catch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ extension RestorationToken: Codable {
}
}

extension MatrixRustSDK.Session: Codable {
extension MatrixRustSDK.Session: @retroactive Codable {
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)

Expand Down
2 changes: 1 addition & 1 deletion ElementX/Sources/UITests/UITestsSignalling.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Combine
import KZFileWatchers
import SwiftUI

extension Notification.Name: Codable { }
extension Notification.Name: @retroactive Codable { }

enum UITestsSignal: Codable, Equatable {
/// An internal signal used to indicate that one side of the connection is ready.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading