Skip to content

Commit 1321dc5

Browse files
committed
Merge branch 'release/1.9.1/master'
2 parents 9a2a854 + ed79820 commit 1321dc5

File tree

52 files changed

+340
-157
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+340
-157
lines changed

CHANGES.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
## Changes in 1.9.1 (2022-08-29)
2+
3+
🙌 Improvements
4+
5+
- Added Labs flag for the new App Layout. ([#6649](https://github.com/vector-im/element-ios/issues/6649))
6+
7+
🐛 Bugfixes
8+
9+
- Render the PIN entry screen correctly on landscape ([#6629](https://github.com/vector-im/element-ios/pull/6629))
10+
- Ensure rest client async responses are processed on the main queue ([#6642](https://github.com/vector-im/element-ios/pull/6642))
11+
- Stop waiting for biometric unlock if disabled system wide ([#5279](https://github.com/vector-im/element-ios/issues/5279))
12+
- App Layout: added support for transparent avatar icons in the all chats screen ([#6556](https://github.com/vector-im/element-ios/issues/6556))
13+
- App Layout: fixed reactions background in timeline ([#6557](https://github.com/vector-im/element-ios/issues/6557))
14+
- App Layout: Removed Low Priority Rooms from Filters ([#6577](https://github.com/vector-im/element-ios/issues/6577))
15+
- App Layout: Updated missing image for Onboarding screen page 2 ([#6624](https://github.com/vector-im/element-ios/issues/6624))
16+
- App Layout: fixed limited number of invites in the All Chats screen ([#6625](https://github.com/vector-im/element-ios/issues/6625))
17+
- Fix notification issues for threads. ([#6628](https://github.com/vector-im/element-ios/issues/6628))
18+
19+
120
## Changes in 1.9.0 (2022-08-24)
221

322
🙌 Improvements

Config/AppVersion.xcconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
//
1616

1717
// Version
18-
MARKETING_VERSION = 1.9.0
19-
CURRENT_PROJECT_VERSION = 1.9.0
18+
MARKETING_VERSION = 1.9.1
19+
CURRENT_PROJECT_VERSION = 1.9.1

Config/BuildSettings.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,11 @@ final class BuildSettings: NSObject {
419419
static let syncLocalContacts: Bool = false
420420

421421
// MARK: - New App Layout
422-
static let newAppLayoutEnabled = true
423-
422+
static let newAppLayoutEnabled = false
423+
424+
static var isSideMenuActivated: Bool = enableSideMenu
425+
static var isNewAppLayoutActivated: Bool = newAppLayoutEnabled
426+
424427
// MARK: - Device manager
425428

426429
static let deviceManagerEnabled = false

Riot/Assets/Images.xcassets/AllChatsOnboarding/all_chats_onboarding2.imageset/Contents.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
{
22
"images" : [
33
{
4-
"filename" : "all_chats_onboarding2.svg",
4+
"filename" : "all_chats_onboarding2.png",
55
"idiom" : "universal",
66
"scale" : "1x"
77
},
88
{
9+
"filename" : "all_chats_onboarding2@2x.png",
910
"idiom" : "universal",
1011
"scale" : "2x"
1112
},
1213
{
14+
"filename" : "all_chats_onboarding2@3x.png",
1315
"idiom" : "universal",
1416
"scale" : "3x"
1517
}

Riot/Assets/Images.xcassets/AllChatsOnboarding/all_chats_onboarding2.imageset/all_chats_onboarding2.svg

Lines changed: 0 additions & 40 deletions
This file was deleted.

Riot/Assets/Images.xcassets/Home/all_chats_edit_icon.imageset/Contents.json

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,7 @@
22
"images" : [
33
{
44
"filename" : "all_chats_edit_icon.svg",
5-
"idiom" : "universal",
6-
"scale" : "1x"
7-
},
8-
{
9-
"idiom" : "universal",
10-
"scale" : "2x"
11-
},
12-
{
13-
"idiom" : "universal",
14-
"scale" : "3x"
5+
"idiom" : "universal"
156
}
167
],
178
"info" : {

Riot/Assets/Images.xcassets/Home/all_chats_empty_list_placeholder_icon.imageset/Contents.json

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,7 @@
22
"images" : [
33
{
44
"filename" : "all_chats_empty_list_placeholder_icon.svg",
5-
"idiom" : "universal",
6-
"scale" : "1x"
7-
},
8-
{
9-
"idiom" : "universal",
10-
"scale" : "2x"
11-
},
12-
{
13-
"idiom" : "universal",
14-
"scale" : "3x"
5+
"idiom" : "universal"
156
}
167
],
178
"info" : {

Riot/Assets/Images.xcassets/Home/all_chats_spaces_icon.imageset/Contents.json

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,7 @@
22
"images" : [
33
{
44
"filename" : "all_chats_spaces_icon.svg",
5-
"idiom" : "universal",
6-
"scale" : "1x"
7-
},
8-
{
9-
"idiom" : "universal",
10-
"scale" : "2x"
11-
},
12-
{
13-
"idiom" : "universal",
14-
"scale" : "3x"
5+
"idiom" : "universal"
156
}
167
],
178
"info" : {

Riot/Assets/en.lproj/Vector.strings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,7 @@ Tap the + to start adding people.";
761761
"settings_labs_enable_auto_report_decryption_errors" = "Auto Report Decryption Errors";
762762
"settings_labs_use_only_latest_user_avatar_and_name" = "Show latest avatar and name for users in message history";
763763
"settings_labs_enable_live_location_sharing" = "Live location sharing - share current location (active development, and temporarily, locations persist in room history)";
764+
"settings_labs_enable_new_app_layout" = "New Application Layout";
764765

765766
"settings_version" = "Version %@";
766767
"settings_olm_version" = "Olm Version %@";

Riot/Categories/MXRestClient+Async.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ extension MXRestClient {
158158

159159
// MARK: - Private
160160

161+
@MainActor
161162
private func getResponse<T>(_ callback: (@escaping (MXResponse<T>) -> Void) -> MXHTTPOperation) async throws -> T {
162163
try await withCheckedThrowingContinuation { continuation in
163164
_ = callback { response in
@@ -171,6 +172,7 @@ extension MXRestClient {
171172
}
172173
}
173174

175+
@MainActor
174176
private func getResponse<T>(_ callback: (@escaping (T?) -> Void, @escaping (Error?) -> Void) -> MXHTTPOperation) async throws -> T {
175177
try await withCheckedThrowingContinuation { continuation in
176178
_ = callback { response in
@@ -186,6 +188,7 @@ extension MXRestClient {
186188
}
187189
}
188190

191+
@MainActor
189192
private func getResponse<T, U, V>(_ callback: (@escaping (T?, U?, V?) -> Void, @escaping (Error?) -> Void) -> MXHTTPOperation) async throws -> (T?, U?, V?) {
190193
try await withCheckedThrowingContinuation { continuation in
191194
_ = callback { arg1, arg2, arg3 in

Riot/Generated/Strings.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7351,6 +7351,10 @@ public class VectorL10n: NSObject {
73517351
public static var settingsLabsEnableLiveLocationSharing: String {
73527352
return VectorL10n.tr("Vector", "settings_labs_enable_live_location_sharing")
73537353
}
7354+
/// New Application Layout
7355+
public static var settingsLabsEnableNewAppLayout: String {
7356+
return VectorL10n.tr("Vector", "settings_labs_enable_new_app_layout")
7357+
}
73547358
/// Ring for group calls
73557359
public static var settingsLabsEnableRingingForGroupCalls: String {
73567360
return VectorL10n.tr("Vector", "settings_labs_enable_ringing_for_group_calls")

Riot/Managers/Settings/RiotSettings.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ final class RiotSettings: NSObject {
4646

4747
private override init() {
4848
super.init()
49+
BuildSettings.isSideMenuActivated = BuildSettings.enableSideMenu && !newAppLayoutBetaEnabled
50+
BuildSettings.isNewAppLayoutActivated = BuildSettings.newAppLayoutEnabled || newAppLayoutBetaEnabled
4951
}
5052

5153
/// Indicate if UserDefaults suite has been migrated once.
@@ -381,9 +383,21 @@ final class RiotSettings: NSObject {
381383

382384
@UserDefault(key: "allChatsOnboardingHasBeenDisplayed", defaultValue: false, storage: defaults)
383385
var allChatsOnboardingHasBeenDisplayed
386+
387+
// MARK: - New App Layout
388+
@UserDefault(key: "newAppLayoutBetaEnabled", defaultValue: false, storage: defaults)
389+
var newAppLayoutBetaEnabled {
390+
didSet {
391+
BuildSettings.isSideMenuActivated = BuildSettings.enableSideMenu && !newAppLayoutBetaEnabled
392+
BuildSettings.isNewAppLayoutActivated = BuildSettings.newAppLayoutEnabled || newAppLayoutBetaEnabled
393+
NotificationCenter.default.post(name: RiotSettings.newAppLayoutBetaToggleDidChange, object: self)
394+
}
395+
}
396+
384397
}
385398

386399
// MARK: - RiotSettings notification constants
387400
extension RiotSettings {
388401
public static let didUpdateLiveLocationSharingActivation = Notification.Name("RiotSettingsDidUpdateLiveLocationSharingActivation")
402+
public static let newAppLayoutBetaToggleDidChange = Notification.Name("RiotSettingsNewAppLayoutBetaToggleDidChange")
389403
}

Riot/Managers/Theme/Themes/BlackTheme.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,14 @@ class BlackTheme: DarkTheme {
2222
super.init()
2323
self.identifier = ThemeIdentifier.black.rawValue
2424
self.backgroundColor = UIColor(rgb: 0x000000)
25-
self.baseColor = UIColor(rgb: 0x000000)
26-
self.headerBackgroundColor = UIColor(rgb: 0x000000)
2725
self.headerBorderColor = UIColor(rgb: 0x15191E)
2826
}
27+
28+
override var baseColor: UIColor {
29+
UIColor(rgb: 0x000000)
30+
}
31+
32+
override var headerBackgroundColor: UIColor {
33+
UIColor(rgb: 0x000000)
34+
}
2935
}

Riot/Managers/Theme/Themes/DarkTheme.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ class DarkTheme: NSObject, Theme {
2626

2727
var backgroundColor: UIColor = UIColor(rgb: 0x15191E)
2828

29-
var baseColor: UIColor = BuildSettings.newAppLayoutEnabled ? UIColor(rgb: 0x15191E) : UIColor(rgb: 0x21262C)
29+
var baseColor: UIColor {
30+
BuildSettings.isNewAppLayoutActivated ? UIColor(rgb: 0x15191E) : UIColor(rgb: 0x21262C)
31+
}
3032
var baseIconPrimaryColor: UIColor = UIColor(rgb: 0xEDF3FF)
3133
var baseTextPrimaryColor: UIColor = UIColor(rgb: 0xFFFFFF)
3234
var baseTextSecondaryColor: UIColor = UIColor(rgb: 0xA9B2BC)
@@ -35,7 +37,9 @@ class DarkTheme: NSObject, Theme {
3537
var searchPlaceholderColor: UIColor = UIColor(rgb: 0xA9B2BC)
3638
var searchResultHighlightColor: UIColor = UIColor(rgb: 0xFCC639).withAlphaComponent(0.3)
3739

38-
var headerBackgroundColor: UIColor = BuildSettings.newAppLayoutEnabled ? UIColor(rgb: 0x15191E) : UIColor(rgb: 0x21262C)
40+
var headerBackgroundColor: UIColor {
41+
BuildSettings.isNewAppLayoutActivated ? UIColor(rgb: 0x15191E) : UIColor(rgb: 0x21262C)
42+
}
3943
var headerBorderColor: UIColor = UIColor(rgb: 0x15191E)
4044
var headerTextPrimaryColor: UIColor = UIColor(rgb: 0xFFFFFF)
4145
var headerTextSecondaryColor: UIColor = UIColor(rgb: 0xA9B2BC)

Riot/Managers/Theme/Themes/DefaultTheme.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ class DefaultTheme: NSObject, Theme {
2626

2727
var backgroundColor: UIColor = UIColor(rgb: 0xFFFFFF)
2828

29-
var baseColor: UIColor = BuildSettings.newAppLayoutEnabled ? UIColor(rgb: 0xFFFFFF) : UIColor(rgb: 0xF5F7FA)
29+
var baseColor: UIColor {
30+
BuildSettings.isNewAppLayoutActivated ? UIColor(rgb: 0xFFFFFF) : UIColor(rgb: 0xF5F7FA)
31+
}
3032
var baseIconPrimaryColor: UIColor = UIColor(rgb: 0xFFFFFF)
3133
var baseTextPrimaryColor: UIColor = UIColor(rgb: 0xFFFFFF)
3234
var baseTextSecondaryColor: UIColor = UIColor(rgb: 0x8F97A3)
@@ -35,7 +37,9 @@ class DefaultTheme: NSObject, Theme {
3537
var searchPlaceholderColor: UIColor = UIColor(rgb: 0x8F97A3)
3638
var searchResultHighlightColor: UIColor = UIColor(rgb: 0xFCC639).withAlphaComponent(0.2)
3739

38-
var headerBackgroundColor: UIColor = BuildSettings.newAppLayoutEnabled ? UIColor(rgb: 0xFFFFFF) : UIColor(rgb: 0xF5F7FA)
40+
var headerBackgroundColor: UIColor {
41+
BuildSettings.isNewAppLayoutActivated ? UIColor(rgb: 0xFFFFFF) : UIColor(rgb: 0xF5F7FA)
42+
}
3943
var headerBorderColor: UIColor = UIColor(rgb: 0xE9EDF1)
4044
var headerTextPrimaryColor: UIColor = UIColor(rgb: 0x17191C)
4145
var headerTextSecondaryColor: UIColor = UIColor(rgb: 0x737D8C)
@@ -169,7 +173,7 @@ class DefaultTheme: NSObject, Theme {
169173
searchBar.backgroundImage = UIImage() // Remove top and bottom shadow
170174
searchBar.tintColor = self.tintColor
171175

172-
guard !BuildSettings.newAppLayoutEnabled else {
176+
guard !BuildSettings.isNewAppLayoutActivated else {
173177
return
174178
}
175179

Riot/Modules/Analytics/SentryMonitoringClient.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ struct SentryMonitoringClient {
3434
options.dsn = Self.sentryDSN
3535

3636
// Collecting only 10% of all events
37+
options.sampleRate = 0.1
3738
options.tracesSampleRate = 0.1
3839

3940
options.beforeSend = { event in

Riot/Modules/Application/AppCoordinator.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ final class AppCoordinator: NSObject, AppCoordinatorType {
9191
// Setup user location services
9292
_ = UserLocationServiceProvider.shared
9393

94-
if BuildSettings.enableSideMenu {
94+
if BuildSettings.isSideMenuActivated {
9595
self.addSideMenu()
9696
}
9797

@@ -105,6 +105,8 @@ final class AppCoordinator: NSObject, AppCoordinatorType {
105105
}
106106
}
107107

108+
NotificationCenter.default.addObserver(self, selector: #selector(self.newAppLayoutToggleDidChange(notification:)), name: RiotSettings.newAppLayoutBetaToggleDidChange, object: nil)
109+
108110
// NOTE: When split view is shown there can be no Matrix sessions ready. Keep this behavior or use a loading screen before showing the split view.
109111
self.showSplitView()
110112
MXLog.debug("[AppCoordinator] Showed split view")
@@ -160,6 +162,12 @@ final class AppCoordinator: NSObject, AppCoordinatorType {
160162
ThemePublisher.shared.republish(themeIdPublisher: themeIdPublisher)
161163
}
162164

165+
@objc private func newAppLayoutToggleDidChange(notification: Notification) {
166+
if BuildSettings.isSideMenuActivated {
167+
self.addSideMenu()
168+
}
169+
}
170+
163171
private func excludeAllItemsFromBackup() {
164172
let manager = FileManager.default
165173

Riot/Modules/Application/LegacyAppDelegate.m

Lines changed: 55 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,21 +1114,66 @@ - (void)pushNotificationService:(PushNotificationService *)pushNotificationServi
11141114
threadId:(NSString *)threadId
11151115
sender:(NSString *)userId
11161116
{
1117-
if (roomId)
1118-
{
1119-
MXRoom *room = [self.mxSessions.firstObject roomWithRoomId:roomId];
1120-
if (room.summary.membership != MXMembershipJoin)
1117+
void(^sessionReadyBlock)(MXSession*) = ^(MXSession *session){
1118+
if (roomId)
1119+
{
1120+
MXRoom *room = [session roomWithRoomId:roomId];
1121+
if (room.summary.membership != MXMembershipJoin)
1122+
{
1123+
Analytics.shared.joinedRoomTrigger = AnalyticsJoinedRoomTriggerNotification;
1124+
}
1125+
else
1126+
{
1127+
Analytics.shared.viewRoomTrigger = AnalyticsViewRoomTriggerNotification;
1128+
}
1129+
}
1130+
1131+
self.lastNavigatedRoomIdFromPush = roomId;
1132+
1133+
if (threadId)
11211134
{
1122-
Analytics.shared.joinedRoomTrigger = AnalyticsJoinedRoomTriggerNotification;
1135+
if(![[MXKRoomDataSourceManager sharedManagerForMatrixSession:session] hasRoomDataSourceForRoom:roomId])
1136+
{
1137+
// the room having this thread probably was not opened before, paginate room messages to build threads
1138+
MXRoom *room = [session roomWithRoomId:roomId];
1139+
[room liveTimeline:^(id<MXEventTimeline> liveTimeline) {
1140+
[liveTimeline resetPagination];
1141+
[liveTimeline paginate:NSUIntegerMax direction:MXTimelineDirectionBackwards onlyFromStore:YES complete:^{
1142+
[liveTimeline resetPagination];
1143+
[self navigateToRoomById:roomId threadId:threadId sender:userId];
1144+
} failure:^(NSError * _Nonnull error) {
1145+
[self navigateToRoomById:roomId threadId:threadId sender:userId];
1146+
}];
1147+
}];
1148+
}
1149+
else
1150+
{
1151+
// the room has been opened before, we should be ok to continue
1152+
[self navigateToRoomById:roomId threadId:threadId sender:userId];
1153+
}
11231154
}
11241155
else
11251156
{
1126-
Analytics.shared.viewRoomTrigger = AnalyticsViewRoomTriggerNotification;
1157+
[self navigateToRoomById:roomId threadId:threadId sender:userId];
11271158
}
1128-
}
1159+
};
11291160

1130-
_lastNavigatedRoomIdFromPush = roomId;
1131-
[self navigateToRoomById:roomId threadId:threadId sender:userId];
1161+
MXSession *mxSession = self.mxSessions.firstObject;
1162+
if (mxSession.state >= MXSessionStateSyncInProgress)
1163+
{
1164+
sessionReadyBlock(mxSession);
1165+
}
1166+
else
1167+
{
1168+
// wait for session state to be sync in progress
1169+
__block id sessionStateObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXSessionStateDidChangeNotification object:mxSession queue:nil usingBlock:^(NSNotification * _Nonnull note) {
1170+
if (mxSession.state >= MXSessionStateSyncInProgress)
1171+
{
1172+
[[NSNotificationCenter defaultCenter] removeObserver:sessionStateObserver];
1173+
sessionReadyBlock(mxSession);
1174+
}
1175+
}];
1176+
}
11321177
}
11331178

11341179
#pragma mark - Badge Count
@@ -4212,7 +4257,7 @@ - (void)setupUserDefaults
42124257
}
42134258

42144259
// Need to set `showAllRoomsInHomeSpace` to `true` for the new App Layout
4215-
if (BuildSettings.newAppLayoutEnabled)
4260+
if (BuildSettings.isNewAppLayoutActivated)
42164261
{
42174262
RiotSettings.shared.showAllRoomsInHomeSpace = YES;
42184263
}

0 commit comments

Comments
 (0)