Add a feature flag for automatic back pagination. (#5445)

This commit is contained in:
Doug
2026-04-20 17:47:26 +01:00
committed by GitHub
parent 58a6d0a33f
commit fc97cbc006
4 changed files with 16 additions and 0 deletions

View File

@@ -80,6 +80,7 @@ final class AppSettings {
case focusEventOnNotificationTap
case linkNewDeviceEnabled
case liveLocationSharingEnabled
case automaticBackPaginationEnabled
// Doug's tweaks 🔧
case hideUnreadMessagesBadge
@@ -447,6 +448,9 @@ final class AppSettings {
let verifyWithClassicEnabled = appBuildType != .release
@UserPreference(key: UserDefaultsKeys.automaticBackPaginationEnabled, defaultValue: false, storageType: .userDefaults(store))
var automaticBackPaginationEnabled
@UserPreference(key: UserDefaultsKeys.developerOptionsEnabled, defaultValue: appBuildType == .debug, storageType: .userDefaults(store))
var developerOptionsEnabled
}

View File

@@ -55,6 +55,7 @@ protocol DeveloperOptionsProtocol: AnyObject {
var enableKeyShareOnInvite: Bool { get set }
var hideQuietNotificationAlerts: Bool { get set }
var focusEventOnNotificationTap: Bool { get set }
var automaticBackPaginationEnabled: Bool { get set }
var hideUnreadMessagesBadge: Bool { get set }
var elementCallBaseURLOverride: URL? { get set }

View File

@@ -67,6 +67,11 @@ struct DeveloperOptionsScreen: View {
Toggle(isOn: $context.lowPriorityFilterEnabled) {
Text("Low priority filter")
}
Toggle(isOn: $context.automaticBackPaginationEnabled) {
Text("Automatic back pagination")
Text("Requires app reboot")
}
}
Section("Room") {
@@ -135,6 +140,7 @@ struct DeveloperOptionsScreen: View {
Text("Hide quiet alerts")
Text("The badge count will still be updated")
}
Toggle(isOn: $context.focusEventOnNotificationTap) {
Text("Focus event on notification tap")
}

View File

@@ -201,6 +201,11 @@ class ClientProxy: ClientProxyProtocol {
self.appSettings = appSettings
self.analyticsService = analyticsService
if appSettings.automaticBackPaginationEnabled {
// Must be called before creating the sync service, timelines etc.
client.enableAutomaticBackpagination()
}
clientQueue = .init(label: "ClientProxyQueue", attributes: .concurrent)
mediaLoader = MediaLoader(client: client)