diff --git a/apps/ios/SimpleX Snapshots/References/AddChannelView-dark-large.png b/apps/ios/SimpleX Snapshots/References/AddChannelView-dark-large.png index 32e8bca138..aa72020f87 100644 Binary files a/apps/ios/SimpleX Snapshots/References/AddChannelView-dark-large.png and b/apps/ios/SimpleX Snapshots/References/AddChannelView-dark-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/AddChannelView-light-large.png b/apps/ios/SimpleX Snapshots/References/AddChannelView-light-large.png index a5fcf3b255..b2b2153749 100644 Binary files a/apps/ios/SimpleX Snapshots/References/AddChannelView-light-large.png and b/apps/ios/SimpleX Snapshots/References/AddChannelView-light-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/AddGroupView-dark-large.png b/apps/ios/SimpleX Snapshots/References/AddGroupView-dark-large.png index 8521d3f799..fc2268cd55 100644 Binary files a/apps/ios/SimpleX Snapshots/References/AddGroupView-dark-large.png and b/apps/ios/SimpleX Snapshots/References/AddGroupView-dark-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/AddGroupView-light-large.png b/apps/ios/SimpleX Snapshots/References/AddGroupView-light-large.png index 90411da71d..4951665946 100644 Binary files a/apps/ios/SimpleX Snapshots/References/AddGroupView-light-large.png and b/apps/ios/SimpleX Snapshots/References/AddGroupView-light-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/AdvancedNetworkSettings-dark-large.png b/apps/ios/SimpleX Snapshots/References/AdvancedNetworkSettings-dark-large.png index 34f0cbfc5d..fca169143f 100644 Binary files a/apps/ios/SimpleX Snapshots/References/AdvancedNetworkSettings-dark-large.png and b/apps/ios/SimpleX Snapshots/References/AdvancedNetworkSettings-dark-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/AdvancedNetworkSettings-light-large.png b/apps/ios/SimpleX Snapshots/References/AdvancedNetworkSettings-light-large.png index 2e69202157..3920d5ad27 100644 Binary files a/apps/ios/SimpleX Snapshots/References/AdvancedNetworkSettings-light-large.png and b/apps/ios/SimpleX Snapshots/References/AdvancedNetworkSettings-light-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/BadgesRedeemCodeView-dark-large.png b/apps/ios/SimpleX Snapshots/References/BadgesRedeemCodeView-dark-large.png index bfa02ffc5c..cffb577447 100644 Binary files a/apps/ios/SimpleX Snapshots/References/BadgesRedeemCodeView-dark-large.png and b/apps/ios/SimpleX Snapshots/References/BadgesRedeemCodeView-dark-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/BadgesRedeemCodeView-light-large.png b/apps/ios/SimpleX Snapshots/References/BadgesRedeemCodeView-light-large.png index 2b57644e18..97c341f475 100644 Binary files a/apps/ios/SimpleX Snapshots/References/BadgesRedeemCodeView-light-large.png and b/apps/ios/SimpleX Snapshots/References/BadgesRedeemCodeView-light-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/BadgesSupportSimplexView-dark-large.png b/apps/ios/SimpleX Snapshots/References/BadgesSupportSimplexView-dark-large.png index cd2267b95e..4ebbc46de3 100644 Binary files a/apps/ios/SimpleX Snapshots/References/BadgesSupportSimplexView-dark-large.png and b/apps/ios/SimpleX Snapshots/References/BadgesSupportSimplexView-dark-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/BadgesSupportSimplexView-light-large.png b/apps/ios/SimpleX Snapshots/References/BadgesSupportSimplexView-light-large.png index aadaf48c1d..fd09a16321 100644 Binary files a/apps/ios/SimpleX Snapshots/References/BadgesSupportSimplexView-light-large.png and b/apps/ios/SimpleX Snapshots/References/BadgesSupportSimplexView-light-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/CallSettings-dark-large.png b/apps/ios/SimpleX Snapshots/References/CallSettings-dark-large.png index 328356fe9b..34c0fb69d4 100644 Binary files a/apps/ios/SimpleX Snapshots/References/CallSettings-dark-large.png and b/apps/ios/SimpleX Snapshots/References/CallSettings-dark-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/CallSettings-light-large.png b/apps/ios/SimpleX Snapshots/References/CallSettings-light-large.png index 96d17b1708..0c7d2bd88b 100644 Binary files a/apps/ios/SimpleX Snapshots/References/CallSettings-light-large.png and b/apps/ios/SimpleX Snapshots/References/CallSettings-light-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/ChatInfoView-dark-large.png b/apps/ios/SimpleX Snapshots/References/ChatInfoView-dark-large.png index 3832d1ea90..d7e81c7690 100644 Binary files a/apps/ios/SimpleX Snapshots/References/ChatInfoView-dark-large.png and b/apps/ios/SimpleX Snapshots/References/ChatInfoView-dark-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/ChatInfoView-light-large.png b/apps/ios/SimpleX Snapshots/References/ChatInfoView-light-large.png index ff5ea4a4af..116de6b2d9 100644 Binary files a/apps/ios/SimpleX Snapshots/References/ChatInfoView-light-large.png and b/apps/ios/SimpleX Snapshots/References/ChatInfoView-light-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/ChatView-dark-large.png b/apps/ios/SimpleX Snapshots/References/ChatView-dark-large.png index 14b5d3195b..116422a002 100644 Binary files a/apps/ios/SimpleX Snapshots/References/ChatView-dark-large.png and b/apps/ios/SimpleX Snapshots/References/ChatView-dark-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/ChatView-light-large.png b/apps/ios/SimpleX Snapshots/References/ChatView-light-large.png index 810d41c7e9..e5ab5e417c 100644 Binary files a/apps/ios/SimpleX Snapshots/References/ChatView-light-large.png and b/apps/ios/SimpleX Snapshots/References/ChatView-light-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/ConnectDesktopView-dark-large.png b/apps/ios/SimpleX Snapshots/References/ConnectDesktopView-dark-large.png index 9a5bc82a85..40b3c6a7d9 100644 Binary files a/apps/ios/SimpleX Snapshots/References/ConnectDesktopView-dark-large.png and b/apps/ios/SimpleX Snapshots/References/ConnectDesktopView-dark-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/ConnectDesktopView-light-large.png b/apps/ios/SimpleX Snapshots/References/ConnectDesktopView-light-large.png index 137e9e0382..31ed7b2266 100644 Binary files a/apps/ios/SimpleX Snapshots/References/ConnectDesktopView-light-large.png and b/apps/ios/SimpleX Snapshots/References/ConnectDesktopView-light-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/ContactPreferencesView-dark-large.png b/apps/ios/SimpleX Snapshots/References/ContactPreferencesView-dark-large.png index b06c2d60a4..347a520bb7 100644 Binary files a/apps/ios/SimpleX Snapshots/References/ContactPreferencesView-dark-large.png and b/apps/ios/SimpleX Snapshots/References/ContactPreferencesView-dark-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/ContactPreferencesView-light-large.png b/apps/ios/SimpleX Snapshots/References/ContactPreferencesView-light-large.png index c3527f213b..b195ce631e 100644 Binary files a/apps/ios/SimpleX Snapshots/References/ContactPreferencesView-light-large.png and b/apps/ios/SimpleX Snapshots/References/ContactPreferencesView-light-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/CreateProfile-dark-large.png b/apps/ios/SimpleX Snapshots/References/CreateProfile-dark-large.png index f89c607f22..6888e7c689 100644 Binary files a/apps/ios/SimpleX Snapshots/References/CreateProfile-dark-large.png and b/apps/ios/SimpleX Snapshots/References/CreateProfile-dark-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/CreateProfile-light-large.png b/apps/ios/SimpleX Snapshots/References/CreateProfile-light-large.png index bc1d4e96d8..f84ca3d305 100644 Binary files a/apps/ios/SimpleX Snapshots/References/CreateProfile-light-large.png and b/apps/ios/SimpleX Snapshots/References/CreateProfile-light-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/DatabaseEncryptionView-dark-large.png b/apps/ios/SimpleX Snapshots/References/DatabaseEncryptionView-dark-large.png index c397d6f491..2d18f9ee3b 100644 Binary files a/apps/ios/SimpleX Snapshots/References/DatabaseEncryptionView-dark-large.png and b/apps/ios/SimpleX Snapshots/References/DatabaseEncryptionView-dark-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/DatabaseEncryptionView-light-large.png b/apps/ios/SimpleX Snapshots/References/DatabaseEncryptionView-light-large.png index e80b7d9c5c..6fc5c4e175 100644 Binary files a/apps/ios/SimpleX Snapshots/References/DatabaseEncryptionView-light-large.png and b/apps/ios/SimpleX Snapshots/References/DatabaseEncryptionView-light-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/DatabaseView-dark-large.png b/apps/ios/SimpleX Snapshots/References/DatabaseView-dark-large.png index 28b0233fef..426ab9f7f1 100644 Binary files a/apps/ios/SimpleX Snapshots/References/DatabaseView-dark-large.png and b/apps/ios/SimpleX Snapshots/References/DatabaseView-dark-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/DatabaseView-light-large.png b/apps/ios/SimpleX Snapshots/References/DatabaseView-light-large.png index 2aaf63aac3..84f0000fe2 100644 Binary files a/apps/ios/SimpleX Snapshots/References/DatabaseView-light-large.png and b/apps/ios/SimpleX Snapshots/References/DatabaseView-light-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/GroupChatInfoView-dark-large.png b/apps/ios/SimpleX Snapshots/References/GroupChatInfoView-dark-large.png index 6566d03e3a..d566e496c3 100644 Binary files a/apps/ios/SimpleX Snapshots/References/GroupChatInfoView-dark-large.png and b/apps/ios/SimpleX Snapshots/References/GroupChatInfoView-dark-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/GroupChatInfoView-light-large.png b/apps/ios/SimpleX Snapshots/References/GroupChatInfoView-light-large.png index 923048c5a1..f372290af7 100644 Binary files a/apps/ios/SimpleX Snapshots/References/GroupChatInfoView-light-large.png and b/apps/ios/SimpleX Snapshots/References/GroupChatInfoView-light-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/GroupMemberInfoView-dark-large.png b/apps/ios/SimpleX Snapshots/References/GroupMemberInfoView-dark-large.png index e1df3b74ac..b9d652a68f 100644 Binary files a/apps/ios/SimpleX Snapshots/References/GroupMemberInfoView-dark-large.png and b/apps/ios/SimpleX Snapshots/References/GroupMemberInfoView-dark-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/GroupMemberInfoView-light-large.png b/apps/ios/SimpleX Snapshots/References/GroupMemberInfoView-light-large.png index afb409352e..9ed40003d7 100644 Binary files a/apps/ios/SimpleX Snapshots/References/GroupMemberInfoView-light-large.png and b/apps/ios/SimpleX Snapshots/References/GroupMemberInfoView-light-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/GroupPreferencesView-dark-large.png b/apps/ios/SimpleX Snapshots/References/GroupPreferencesView-dark-large.png index cd639e3967..8a8afb180e 100644 Binary files a/apps/ios/SimpleX Snapshots/References/GroupPreferencesView-dark-large.png and b/apps/ios/SimpleX Snapshots/References/GroupPreferencesView-dark-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/GroupPreferencesView-light-large.png b/apps/ios/SimpleX Snapshots/References/GroupPreferencesView-light-large.png index ba55b116af..5a3a491ff6 100644 Binary files a/apps/ios/SimpleX Snapshots/References/GroupPreferencesView-light-large.png and b/apps/ios/SimpleX Snapshots/References/GroupPreferencesView-light-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/GroupProfileView-dark-large.png b/apps/ios/SimpleX Snapshots/References/GroupProfileView-dark-large.png index f8174698a5..bd0c7b16c2 100644 Binary files a/apps/ios/SimpleX Snapshots/References/GroupProfileView-dark-large.png and b/apps/ios/SimpleX Snapshots/References/GroupProfileView-dark-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/GroupProfileView-light-large.png b/apps/ios/SimpleX Snapshots/References/GroupProfileView-light-large.png index 34d7120b64..478a4fb3e7 100644 Binary files a/apps/ios/SimpleX Snapshots/References/GroupProfileView-light-large.png and b/apps/ios/SimpleX Snapshots/References/GroupProfileView-light-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/MigrateToDevice-dark-large.png b/apps/ios/SimpleX Snapshots/References/MigrateToDevice-dark-large.png index 9b61801a8d..fb5aa27273 100644 Binary files a/apps/ios/SimpleX Snapshots/References/MigrateToDevice-dark-large.png and b/apps/ios/SimpleX Snapshots/References/MigrateToDevice-dark-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/MigrateToDevice-light-large.png b/apps/ios/SimpleX Snapshots/References/MigrateToDevice-light-large.png index 8381c58498..78e1521b71 100644 Binary files a/apps/ios/SimpleX Snapshots/References/MigrateToDevice-light-large.png and b/apps/ios/SimpleX Snapshots/References/MigrateToDevice-light-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/NotificationsModeView-dark-large.png b/apps/ios/SimpleX Snapshots/References/NotificationsModeView-dark-large.png index 91029f97a6..dafcd6c3b7 100644 Binary files a/apps/ios/SimpleX Snapshots/References/NotificationsModeView-dark-large.png and b/apps/ios/SimpleX Snapshots/References/NotificationsModeView-dark-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/NotificationsModeView-light-large.png b/apps/ios/SimpleX Snapshots/References/NotificationsModeView-light-large.png index 755beb4b4b..37bbfcecc8 100644 Binary files a/apps/ios/SimpleX Snapshots/References/NotificationsModeView-light-large.png and b/apps/ios/SimpleX Snapshots/References/NotificationsModeView-light-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/ProfilePrivacyView-dark-large.png b/apps/ios/SimpleX Snapshots/References/ProfilePrivacyView-dark-large.png index d67b64ec5d..e0cc138926 100644 Binary files a/apps/ios/SimpleX Snapshots/References/ProfilePrivacyView-dark-large.png and b/apps/ios/SimpleX Snapshots/References/ProfilePrivacyView-dark-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/ProfilePrivacyView-light-large.png b/apps/ios/SimpleX Snapshots/References/ProfilePrivacyView-light-large.png index 4d0bec487a..d1c758f84a 100644 Binary files a/apps/ios/SimpleX Snapshots/References/ProfilePrivacyView-light-large.png and b/apps/ios/SimpleX Snapshots/References/ProfilePrivacyView-light-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/SettingsView-dark-large.png b/apps/ios/SimpleX Snapshots/References/SettingsView-dark-large.png index a83114248c..b4fda30947 100644 Binary files a/apps/ios/SimpleX Snapshots/References/SettingsView-dark-large.png and b/apps/ios/SimpleX Snapshots/References/SettingsView-dark-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/SettingsView-light-large.png b/apps/ios/SimpleX Snapshots/References/SettingsView-light-large.png index 434eaf08f6..012d7a4b10 100644 Binary files a/apps/ios/SimpleX Snapshots/References/SettingsView-light-large.png and b/apps/ios/SimpleX Snapshots/References/SettingsView-light-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/SimpleXInfo-dark-large.png b/apps/ios/SimpleX Snapshots/References/SimpleXInfo-dark-large.png index 442089f0f0..117cfa8fd9 100644 Binary files a/apps/ios/SimpleX Snapshots/References/SimpleXInfo-dark-large.png and b/apps/ios/SimpleX Snapshots/References/SimpleXInfo-dark-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/SimpleXInfo-light-large.png b/apps/ios/SimpleX Snapshots/References/SimpleXInfo-light-large.png index 390c76f60f..20a2091d38 100644 Binary files a/apps/ios/SimpleX Snapshots/References/SimpleXInfo-light-large.png and b/apps/ios/SimpleX Snapshots/References/SimpleXInfo-light-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/VerifyCodeView-dark-large.png b/apps/ios/SimpleX Snapshots/References/VerifyCodeView-dark-large.png index ffb70553da..68febeb2e6 100644 Binary files a/apps/ios/SimpleX Snapshots/References/VerifyCodeView-dark-large.png and b/apps/ios/SimpleX Snapshots/References/VerifyCodeView-dark-large.png differ diff --git a/apps/ios/SimpleX Snapshots/References/VerifyCodeView-light-large.png b/apps/ios/SimpleX Snapshots/References/VerifyCodeView-light-large.png index a6ba059c7e..56159b844c 100644 Binary files a/apps/ios/SimpleX Snapshots/References/VerifyCodeView-light-large.png and b/apps/ios/SimpleX Snapshots/References/VerifyCodeView-light-large.png differ diff --git a/apps/ios/SimpleX Snapshots/SnapshotTests.swift b/apps/ios/SimpleX Snapshots/SnapshotTests.swift index eec7b91d90..db91c961ce 100644 --- a/apps/ios/SimpleX Snapshots/SnapshotTests.swift +++ b/apps/ios/SimpleX Snapshots/SnapshotTests.swift @@ -1,6 +1,7 @@ import XCTest import SwiftUI import UIKit +import AVFoundation @testable import SimpleX @testable import SimpleXChat @@ -158,11 +159,13 @@ private struct SnapshotScene { var name: String var height: CGFloat? = nil var allSizes: Bool + var device: Bool var view: AnyView - init(_ preview: P.Type, allSizes: Bool = false) { + init(_ preview: P.Type, allSizes: Bool = false, device: Bool = false) { name = String(describing: preview).replacingOccurrences(of: "_Previews", with: "") self.allSizes = allSizes + self.device = device view = AnyView(preview.previews) } } @@ -170,23 +173,23 @@ private struct SnapshotScene { private func previewScenes() -> [SnapshotScene] { [ SnapshotScene(ActiveCallOverlay_Previews.self), - SnapshotScene(AddChannelView_Previews.self), + SnapshotScene(AddChannelView_Previews.self, device: true), SnapshotScene(AddContactLearnMore_Previews.self), SnapshotScene(AddGroupMembersView_Previews.self), - SnapshotScene(AddGroupView_Previews.self), - SnapshotScene(AdvancedNetworkSettings_Previews.self), + SnapshotScene(AddGroupView_Previews.self, device: true), + SnapshotScene(AdvancedNetworkSettings_Previews.self, device: true), SnapshotScene(BadgesCheckOrderView_Previews.self), SnapshotScene(BadgesHowItWorksView_Previews.self), SnapshotScene(BadgesHowLongView_Previews.self), - SnapshotScene(BadgesRedeemCodeView_Previews.self), - SnapshotScene(BadgesSupportSimplexView_Previews.self), - SnapshotScene(CallSettings_Previews.self), + SnapshotScene(BadgesRedeemCodeView_Previews.self, device: true), + SnapshotScene(BadgesSupportSimplexView_Previews.self, device: true), + SnapshotScene(CallSettings_Previews.self, device: true), SnapshotScene(ChannelMembersView_Previews.self), SnapshotScene(ChannelRelaysView_Previews.self), SnapshotScene(ChatHelp_Previews.self), SnapshotScene(ChatInfoImage_Previews.self), SnapshotScene(ChatInfoToolbar_Previews.self), - SnapshotScene(ChatInfoView_Previews.self), + SnapshotScene(ChatInfoView_Previews.self, device: true), SnapshotScene(ChatItemForwardingView_Previews.self), SnapshotScene(ChatItemInfoView_Previews.self), SnapshotScene(ChatItemView_NonMsgContentDeleted_Previews.self, allSizes: true), @@ -194,7 +197,7 @@ private func previewScenes() -> [SnapshotScene] { SnapshotScene(ChatListNavLink_Previews.self), SnapshotScene(ChatListView_Previews.self), SnapshotScene(ChatPreviewView_Previews.self), - SnapshotScene(ChatView_Previews.self), + SnapshotScene(ChatView_Previews.self, device: true), SnapshotScene(CIChatFeatureView_Previews.self, allSizes: true), SnapshotScene(CIEventView_Previews.self, allSizes: true), SnapshotScene(CIFeaturePreferenceView_Previews.self, allSizes: true), @@ -209,22 +212,22 @@ private func previewScenes() -> [SnapshotScene] { SnapshotScene(ClassicOverviewDirect_Previews.self), SnapshotScene(ClassicOverviewGroup_Previews.self), SnapshotScene(ComposeVoiceView_Previews.self), - SnapshotScene(ConnectDesktopView_Previews.self), + SnapshotScene(ConnectDesktopView_Previews.self, device: true), SnapshotScene(ContactConnectionInfo_Previews.self), SnapshotScene(ContactConnectionView_Previews.self), - SnapshotScene(ContactPreferencesView_Previews.self), + SnapshotScene(ContactPreferencesView_Previews.self, device: true), SnapshotScene(ContactRequestView_Previews.self), SnapshotScene(ContextContactRequestActionsView_Previews.self), SnapshotScene(ContextItemView_Previews.self), SnapshotScene(ContextMemberContactActionsView_Previews.self), SnapshotScene(ContextPendingMemberActionsView_Previews.self), SnapshotScene(ContextProfilePickerView_Previews.self), - SnapshotScene(CreateProfile_Previews.self), + SnapshotScene(CreateProfile_Previews.self, device: true), SnapshotScene(CreateSimpleXAddress_Previews.self), SnapshotScene(CustomTimePicker_Previews.self), - SnapshotScene(DatabaseEncryptionView_Previews.self), + SnapshotScene(DatabaseEncryptionView_Previews.self, device: true), SnapshotScene(DatabaseErrorView_Previews.self), - SnapshotScene(DatabaseView_Previews.self), + SnapshotScene(DatabaseView_Previews.self, device: true), SnapshotScene(DeletedItemView_Previews.self, allSizes: true), SnapshotScene(DetermineWidth_Previews.self), SnapshotScene(DeveloperView_Previews.self), @@ -234,11 +237,11 @@ private func previewScenes() -> [SnapshotScene] { SnapshotScene(FramedItemView_Edited_Previews.self, allSizes: true), SnapshotScene(FramedItemView_Previews.self, allSizes: true), SnapshotScene(GetStakeBanner_Previews.self), - SnapshotScene(GroupChatInfoView_Previews.self), + SnapshotScene(GroupChatInfoView_Previews.self, device: true), SnapshotScene(GroupLinkView_Previews.self), - SnapshotScene(GroupMemberInfoView_Previews.self), - SnapshotScene(GroupPreferencesView_Previews.self), - SnapshotScene(GroupProfileView_Previews.self), + SnapshotScene(GroupMemberInfoView_Previews.self, device: true), + SnapshotScene(GroupPreferencesView_Previews.self, device: true), + SnapshotScene(GroupProfileView_Previews.self, device: true), SnapshotScene(GroupWelcomeView_Previews.self), SnapshotScene(IncognitoHelp_Previews.self), SnapshotScene(IncomingCallView_Previews.self), @@ -250,7 +253,7 @@ private func previewScenes() -> [SnapshotScene] { SnapshotScene(MemberAdmissionView_Previews.self), SnapshotScene(MemberSupportChatToolbar_Previews.self), SnapshotScene(MemberSupportView_Previews.self), - SnapshotScene(MigrateToDevice_Previews.self), + SnapshotScene(MigrateToDevice_Previews.self, device: true), SnapshotScene(MigrateToGroupView_Previews.self), SnapshotScene(MsgContentView_Previews.self, allSizes: true), SnapshotScene(NativeTextEditor_Previews.self), @@ -258,7 +261,7 @@ private func previewScenes() -> [SnapshotScene] { SnapshotScene(NewChatMenuButton_Previews.self), SnapshotScene(NewFeaturesView_Previews.self), SnapshotScene(NewServerView_Previews.self), - SnapshotScene(NotificationsModeView_Previews.self), + SnapshotScene(NotificationsModeView_Previews.self, device: true), SnapshotScene(NotificationsView_Previews.self), SnapshotScene(OnboardingConditionsView_Previews.self), SnapshotScene(OnboardingStepsView_Previews.self), @@ -269,7 +272,7 @@ private func previewScenes() -> [SnapshotScene] { SnapshotScene(PreferencesView_Previews.self), SnapshotScene(PrivacySettings_Previews.self), SnapshotScene(ProfileImage_Previews.self), - SnapshotScene(ProfilePrivacyView_Previews.self), + SnapshotScene(ProfilePrivacyView_Previews.self, device: true), SnapshotScene(ProtocolServerView_Previews.self), SnapshotScene(QRCode_Previews.self), SnapshotScene(RTCServers_Previews.self), @@ -279,8 +282,8 @@ private func previewScenes() -> [SnapshotScene] { SnapshotScene(SendMessageView_Previews.self), SnapshotScene(SetAppPasscodeView_Previews.self), SnapshotScene(SetDeliveryReceiptsView_Previews.self), - SnapshotScene(SettingsView_Previews.self), - SnapshotScene(SimpleXInfo_Previews.self), + SnapshotScene(SettingsView_Previews.self, device: true), + SnapshotScene(SimpleXInfo_Previews.self, device: true), SnapshotScene(SmallLinkPreview_Previews.self), SnapshotScene(SupportSimpleXBanner_Previews.self), SnapshotScene(TerminalAvatars_Previews.self, allSizes: true), @@ -294,7 +297,7 @@ private func previewScenes() -> [SnapshotScene] { SnapshotScene(UserAddressLearnMore_Previews.self), SnapshotScene(UserAddressView_Previews.self), SnapshotScene(UserPicker_Previews.self), - SnapshotScene(VerifyCodeView_Previews.self), + SnapshotScene(VerifyCodeView_Previews.self, device: true), SnapshotScene(VersionView_Previews.self), SnapshotScene(WhySimpleX_Previews.self), SnapshotScene(YourServersView_Previews.self) @@ -325,7 +328,7 @@ private func renderScene(_ scene: SnapshotScene, _ theme: AppTheme, dark: Bool, .frame(width: width, height: scene.height) let host = UIHostingController(rootView: AnyView(root)) if #available(iOS 16.4, *) { - host.safeAreaRegions = [] + host.safeAreaRegions = scene.device ? .container : [] } let window = UIWindow(windowScene: windowScene) window.overrideUserInterfaceStyle = dark ? .dark : .light @@ -333,7 +336,7 @@ private func renderScene(_ scene: SnapshotScene, _ theme: AppTheme, dark: Bool, window.frame = CGRect(x: 0, y: 0, width: width, height: scene.height ?? screen.bounds.height) window.isHidden = false settle() - if scene.height == nil { + if scene.height == nil && !scene.device { for _ in 0..<2 { let fit = host.sizeThatFits(in: CGSize(width: width, height: .greatestFiniteMagnitude)) let fill = host.sizeThatFits(in: screen.bounds.size) @@ -349,12 +352,31 @@ private func renderScene(_ scene: SnapshotScene, _ theme: AppTheme, dark: Bool, format.opaque = true let image = UIGraphicsImageRenderer(bounds: window.bounds, format: format).image { _ in _ = window.drawHierarchy(in: window.bounds, afterScreenUpdates: true) + if scene.device { + drawStatusBar(dark: dark) + } } window.isHidden = true window.rootViewController = nil return image } +private func drawStatusBar(dark: Bool) { + let color: UIColor = dark ? .white : .black + let time = NSAttributedString(string: "9:41", attributes: [.font: UIFont.systemFont(ofSize: 17, weight: .semibold), .foregroundColor: color]) + let timeSize = time.size() + time.draw(at: CGPoint(x: 74 - timeSize.width / 2, y: 32.5 - timeSize.height / 2)) + let icons = [ + ("cellularbars", CGRect(x: 288.5, y: 26.5, width: 19, height: 12)), + ("wifi", CGRect(x: 315, y: 26.5, width: 17, height: 12)), + ("battery.100", CGRect(x: 339.5, y: 26, width: 27, height: 13)) + ] + for (symbol, box) in icons { + let icon = UIImage(systemName: symbol)!.withTintColor(color, renderingMode: .alwaysOriginal) + icon.draw(in: AVMakeRect(aspectRatio: icon.size, insideRect: box)) + } +} + private func removeAnimations(_ layer: CALayer) { layer.removeAllAnimations() layer.sublayers?.forEach(removeAnimations) diff --git a/apps/ios/SimpleXChat/ChatTypes.swift b/apps/ios/SimpleXChat/ChatTypes.swift index 9b7dfc12c5..cf4abebcb0 100644 --- a/apps/ios/SimpleXChat/ChatTypes.swift +++ b/apps/ios/SimpleXChat/ChatTypes.swift @@ -1130,9 +1130,9 @@ public struct ContactUserPreferences: Decodable, Hashable { public static let sampleData = ContactUserPreferences( timedMessages: ContactUserPreference( - enabled: FeatureEnabled(forUser: false, forContact: false), + enabled: FeatureEnabled(forUser: true, forContact: true), userPreference: ContactUserPref.user(preference: TimedMessagesPreference(allow: .yes)), - contactPreference: TimedMessagesPreference(allow: .no) + contactPreference: TimedMessagesPreference(allow: .yes) ), fullDelete: ContactUserPreference( enabled: FeatureEnabled(forUser: false, forContact: false), @@ -1702,7 +1702,7 @@ public struct ContactFeaturesAllowed: Equatable, Hashable { } public static let sampleData = ContactFeaturesAllowed( - timedMessagesAllowed: false, + timedMessagesAllowed: true, timedMessagesTTL: nil, fullDelete: ContactFeatureAllowed.userDefault(.no), reactions: ContactFeatureAllowed.userDefault(.yes), diff --git a/scripts/ci/ios-sim/README.md b/scripts/ci/ios-sim/README.md index 82e8d99bcf..d9405b30c4 100644 --- a/scripts/ci/ios-sim/README.md +++ b/scripts/ci/ios-sim/README.md @@ -40,7 +40,7 @@ Haiku 5.5 drives the app well: the smoke plan takes a few dozen turns and cents; At the end of the app job's smoke test, `smoke-test.sh` runs `snapshots.sh /snapshots` when the app it tested lies in the derived data of a build (`…/Build/Products/Debug-iphonesimulator`); the Claude job, which installs the app from a tarball, skips it. -`snapshots.sh` builds the unit-test target `SimpleX Snapshots` (`apps/ios/SimpleX Snapshots/SnapshotTests.swift`, hosted by the app) with `xcodebuild build-for-testing`, then runs it in the smoke test's simulator three times, after `xcrun simctl ui content_size` `large`, `extra-extra-extra-large` and `accessibility-medium`, and sets `large` back. The test hosts each preview listed in `previewScenes()` (the `previews` of a `PreviewProvider`, in a `VStack`) in a `UIHostingController` in a window of the screen's width and of the larger of two heights, the preview's ideal height and its height in a frame of the screen's size, in the light and dark themes without a wallpaper, ends text editing and removes the running animations, so a text cursor or a spinner is drawn the same in every run, and draws it with `drawHierarchy` at scale 1, one pixel per point. The chat item previews (`allSizes`) are rendered at the three sizes, the other previews at `large` only. +`snapshots.sh` builds the unit-test target `SimpleX Snapshots` (`apps/ios/SimpleX Snapshots/SnapshotTests.swift`, hosted by the app) with `xcodebuild build-for-testing`, then runs it in the smoke test's simulator three times, after `xcrun simctl ui content_size` `large`, `extra-extra-extra-large` and `accessibility-medium`, and sets `large` back. The test hosts each preview listed in `previewScenes()` (the `previews` of a `PreviewProvider`, in a `VStack`) in a `UIHostingController` in a window of the screen's width and of the larger of two heights, the preview's ideal height and its height in a frame of the screen's size, in the light and dark themes without a wallpaper, ends text editing and removes the running animations, so a text cursor or a spinner is drawn the same in every run, and draws it with `drawHierarchy` at scale 1, one pixel per point. The previews marked `device`, the screens shown in the user guide, are rendered as on the device instead: in a window of the screen's size with the device's safe areas, and with a status bar drawn over them (9:41, full cellular, Wi-Fi and battery icons), so that `scripts/docs/frame-ios-renders.py` places them in the iPhone bezel unchanged. The chat item previews (`allSizes`) are rendered at the three sizes, the other previews at `large` only. `previewScenes()` lists every `PreviewProvider` in `apps/ios` except those in `EXCLUDED` of `apps/ios/SimpleX Snapshots/check-previews.py`, whose renders differ between runs and can be made identical only by a change of the app's code. The iOS job of `build.yml` runs `check-previews.py`, which fails when a `PreviewProvider` is neither listed nor excluded, or when a file has a `#Preview`, since the test renders previews by their type.