removed LLS feature flag

This commit is contained in:
Mauro Romito
2026-04-27 12:55:33 +02:00
committed by Mauro
parent 83e4b3a865
commit af08010370
16 changed files with 55 additions and 124 deletions

View File

@@ -81,7 +81,6 @@ final class AppSettings {
case linkPreviewsEnabled
case focusEventOnNotificationTap
case linkNewDeviceEnabled
case liveLocationSharingEnabled
case automaticBackPaginationEnabled
// Doug's tweaks 🔧
@@ -449,9 +448,6 @@ final class AppSettings {
@UserPreference(key: UserDefaultsKeys.linkNewDeviceEnabled, defaultValue: false, storageType: .userDefaults(store))
var linkNewDeviceEnabled
@UserPreference(key: UserDefaultsKeys.liveLocationSharingEnabled, defaultValue: false, storageType: .userDefaults(store))
var liveLocationSharingEnabled
@UserPreference(key: UserDefaultsKeys.automaticBackPaginationEnabled, defaultValue: false, storageType: .userDefaults(store))
var automaticBackPaginationEnabled

View File

@@ -108,7 +108,6 @@ class PinnedEventsTimelineFlowCoordinator: FlowCoordinatorProtocol {
let params = LocationSharingScreenCoordinatorParameters(interactionMode: interactionMode,
mapURLBuilder: flowParameters.appSettings.mapTilerConfiguration,
liveLocationSharingEnabled: flowParameters.appSettings.liveLocationSharingEnabled,
roomProxy: roomProxy,
timelineController: timelineController,
liveLocationManager: flowParameters.userSession.liveLocationManager,

View File

@@ -1168,7 +1168,6 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
let params = LocationSharingScreenCoordinatorParameters(interactionMode: interactionMode,
mapURLBuilder: flowParameters.appSettings.mapTilerConfiguration,
liveLocationSharingEnabled: flowParameters.appSettings.liveLocationSharingEnabled,
roomProxy: roomProxy,
timelineController: timelineController,
liveLocationManager: flowParameters.userSession.liveLocationManager,

View File

@@ -12,7 +12,6 @@ import SwiftUI
struct LocationSharingScreenCoordinatorParameters {
let interactionMode: LocationSharingInteractionMode
let mapURLBuilder: MapTilerURLBuilderProtocol
let liveLocationSharingEnabled: Bool
let roomProxy: JoinedRoomProxyProtocol
let timelineController: TimelineControllerProtocol
let liveLocationManager: LiveLocationManagerProtocol
@@ -42,7 +41,6 @@ final class LocationSharingScreenCoordinator: CoordinatorProtocol {
viewModel = LocationSharingScreenViewModel(interactionMode: parameters.interactionMode,
mapURLBuilder: parameters.mapURLBuilder,
liveLocationSharingEnabled: parameters.liveLocationSharingEnabled,
roomProxy: parameters.roomProxy,
timelineController: parameters.timelineController,
liveLocationManager: parameters.liveLocationManager,

View File

@@ -32,11 +32,9 @@ enum LocationSharingInteractionMode: Hashable {
struct LocationSharingScreenViewState: BindableState {
init(interactionMode: LocationSharingInteractionMode,
mapURLBuilder: MapTilerURLBuilderProtocol,
showLiveLocationSharingButton: Bool,
ownUserID: String) {
self.interactionMode = interactionMode
self.mapURLBuilder = mapURLBuilder
self.showLiveLocationSharingButton = showLiveLocationSharingButton
self.ownUserID = ownUserID
let initialProfile: UserProfileProxy = switch interactionMode {
@@ -65,7 +63,6 @@ struct LocationSharingScreenViewState: BindableState {
let interactionMode: LocationSharingInteractionMode
let mapURLBuilder: MapTilerURLBuilderProtocol
let showLiveLocationSharingButton: Bool
let ownUserID: String
var userProfiles: [String: UserProfileProxy]
var liveLocationShares: [LiveLocationShare] = []

View File

@@ -33,7 +33,6 @@ class LocationSharingScreenViewModel: LocationSharingScreenViewModelType, Locati
init(interactionMode: LocationSharingInteractionMode,
mapURLBuilder: MapTilerURLBuilderProtocol,
liveLocationSharingEnabled: Bool,
roomProxy: JoinedRoomProxyProtocol,
timelineController: TimelineControllerProtocol,
liveLocationManager: LiveLocationManagerProtocol,
@@ -50,7 +49,6 @@ class LocationSharingScreenViewModel: LocationSharingScreenViewModelType, Locati
super.init(initialViewState: .init(interactionMode: interactionMode,
mapURLBuilder: mapURLBuilder,
showLiveLocationSharingButton: liveLocationSharingEnabled,
ownUserID: roomProxy.ownUserID),
mediaProvider: mediaProvider)
@@ -328,8 +326,7 @@ extension LocationSharingScreenViewModel {
}
static func mock(type: MockType,
senderID: String = "@dan:matrix.org",
liveLocationSharingEnabled: Bool = true) -> LocationSharingScreenViewModel {
senderID: String = "@dan:matrix.org") -> LocationSharingScreenViewModel {
let interactionMode: LocationSharingInteractionMode = switch type {
case .picker:
.picker
@@ -378,7 +375,6 @@ extension LocationSharingScreenViewModel {
return LocationSharingScreenViewModel(interactionMode: interactionMode,
mapURLBuilder: ServiceLocator.shared.settings.mapTilerConfiguration,
liveLocationSharingEnabled: liveLocationSharingEnabled,
roomProxy: roomProxy,
timelineController: MockTimelineController(),
liveLocationManager: LiveLocationManagerMock(),

View File

@@ -12,13 +12,6 @@ struct LocationPickerSheet: View {
@Bindable var context: LocationSharingScreenViewModel.Context
@State private var height: CGFloat = .zero
/// Fixes an iOS 26 sheet issue
/// if the content doesn't meet a certain size
/// additional insets are added.
private var additionalHeight: CGFloat {
context.viewState.showLiveLocationSharingButton ? 0 : 28
}
var body: some View {
VStack(spacing: 0) {
Text(L10n.screenSharingLocationOptionSheetTitle)
@@ -26,6 +19,7 @@ struct LocationPickerSheet: View {
.font(.compound.bodyLGSemibold)
.padding(.top, 29)
.padding(.bottom, 25)
Button {
context.send(viewAction: .selectLocation)
} label: {
@@ -39,14 +33,13 @@ struct LocationPickerSheet: View {
iconColor: .compound.iconSecondary)
}
}
if context.viewState.showLiveLocationSharingButton {
Button {
context.send(viewAction: .startLiveLocation)
} label: {
LocationPickerLabel(text: L10n.actionShareLiveLocation,
icon: \.locationPinSolid,
iconColor: .compound.iconAccentPrimary)
}
Button {
context.send(viewAction: .startLiveLocation)
} label: {
LocationPickerLabel(text: L10n.actionShareLiveLocation,
icon: \.locationPinSolid,
iconColor: .compound.iconAccentPrimary)
}
}
.readHeight($height)
@@ -54,7 +47,7 @@ struct LocationPickerSheet: View {
.presentationBackground(.compound.bgCanvasDefault)
.presentationBackgroundInteraction(.enabled)
.presentationDragIndicator(.hidden)
.presentationDetents([.height(height + additionalHeight)])
.presentationDetents([.height(height)])
}
}

View File

@@ -126,9 +126,7 @@ struct LocationSharingScreen: View {
struct LocationSharingScreen_Previews: PreviewProvider, TestablePreview {
static let viewModel = LocationSharingScreenViewModel.mock(type: .staticSenderLocation)
static let withoutLiveSharingViewModel = LocationSharingScreenViewModel.mock(type: .picker, liveLocationSharingEnabled: false)
static let pinViewModel = LocationSharingScreenViewModel.mock(type: .staticPinLocation)
static let pickerViewModel = LocationSharingScreenViewModel.mock(type: .picker)
@@ -141,11 +139,6 @@ struct LocationSharingScreen_Previews: PreviewProvider, TestablePreview {
}
.previewDisplayName("Picker")
ElementNavigationStack {
LocationSharingScreen(context: withoutLiveSharingViewModel.context)
}
.previewDisplayName("Picker without live location sharing")
ElementNavigationStack {
LocationSharingScreen(context: viewModel.context)
}

View File

@@ -171,12 +171,11 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
.weakAssign(to: \.state.isKnockingEnabled, on: self)
.store(in: &cancellables)
appSettings.$liveLocationSharingEnabled
.combineLatest(appSettings.$liveLocationSharingTimeoutDatesByRoomID)
appSettings.$liveLocationSharingTimeoutDatesByRoomID
.receive(on: DispatchQueue.main)
.sink { [weak self] isEnabled, timeoutDatesByRoomID in
.sink { [weak self] timeoutDatesByRoomID in
guard let self else { return }
state.isSharingLiveLocation = isEnabled && timeoutDatesByRoomID.keys.contains(roomProxy.id)
state.isSharingLiveLocation = timeoutDatesByRoomID.keys.contains(roomProxy.id)
}
.store(in: &cancellables)

View File

@@ -61,7 +61,6 @@ protocol AdvancedSettingsProtocol: AnyObject {
var sharePresence: Bool { get set }
var optimizeMediaUploads: Bool { get set }
var liveLocationMinimumDistanceUpdate: Int { get set }
var liveLocationSharingEnabled: Bool { get set }
}
extension AppSettings: AdvancedSettingsProtocol { }

View File

@@ -44,9 +44,7 @@ struct AdvancedSettingsScreen: View {
moderationAndSafetySection
timelineMediaSection
if context.liveLocationSharingEnabled {
liveLocationSection
}
liveLocationSection
}
.compoundList()
.navigationTitle(L10n.commonAdvancedSettings)
@@ -164,9 +162,7 @@ private extension AppAppearance {
struct AdvancedSettingsScreen_Previews: PreviewProvider, TestablePreview {
static let viewModel = {
AppSettings.resetAllSettings()
let appSettings = AppSettings()
appSettings.liveLocationSharingEnabled = true
return AdvancedSettingsScreenViewModel(advancedSettings: appSettings,
return AdvancedSettingsScreenViewModel(advancedSettings: AppSettings(),
analytics: ServiceLocator.shared.analytics,
clientProxy: ClientProxyMock(.init()),
userIndicatorController: UserIndicatorControllerMock())

View File

@@ -70,9 +70,7 @@ protocol DeveloperOptionsProtocol: AnyObject {
var linkPreviewsEnabled: Bool { get set }
var linkNewDeviceEnabled: Bool { get set }
var liveLocationSharingEnabled: Bool { get set }
var roomThreadListEnabled: Bool { get set }
}

View File

@@ -91,11 +91,6 @@ struct DeveloperOptionsScreen: View {
.foregroundStyle(.compound.textCriticalPrimary)
}
Toggle(isOn: $context.liveLocationSharingEnabled) {
Text("Live location sharing")
Text("Requires app reboot")
}
Toggle(isOn: $context.knockingEnabled) {
Text("Knocking")
Text("Ask to join rooms")

View File

@@ -196,16 +196,6 @@ class LiveLocationManager: NSObject, LiveLocationManagerProtocol, CLLocationMana
}
.store(in: &cancellables)
appSettings.$liveLocationSharingEnabled
.filter { !$0 }
.sink { [weak self] _ in
guard let self else { return }
appSettings.liveLocationSharingTimeoutDatesByRoomID.removeAll()
activeRoomProxies.removeAll()
self.stopUpdatingLocation()
}
.store(in: &cancellables)
appSettings.$liveLocationMinimumDistanceUpdate
.removeDuplicates()
.debounce(for: .seconds(1), scheduler: DispatchQueue.main)

View File

@@ -91,7 +91,7 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
let openRoomSpan = analyticsService.signpost.addSpan(.timelineLoad, toTransaction: .openRoom)
timeline = try await TimelineProxy(timeline: room.timelineWithConfiguration(configuration: .init(focus: .live(hideThreadedEvents: appSettings.threadsEnabled),
filter: .eventFilter(filter: Self.excludedEventsFilter(appSettings: appSettings)),
filter: .eventFilter(filter: Self.excludedEventsFilter),
internalIdPrefix: nil,
dateDividerMode: .daily,
trackReadReceipts: .messageLikeEvents,
@@ -845,7 +845,7 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
}
}
private static func excludedEventsFilter(appSettings: AppSettings) -> TimelineEventFilter {
private static let excludedEventsFilter: TimelineEventFilter = {
var stateEventFilters: [StateEventType] = [.roomCanonicalAlias,
.roomGuestAccess,
.roomHistoryVisibility,
@@ -859,11 +859,6 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
.policyRuleRoom,
.policyRuleServer,
.policyRuleUser]
if !appSettings.liveLocationSharingEnabled {
stateEventFilters.append(.beaconInfo)
}
return .excludeEventTypes(eventTypes: stateEventFilters.map { FilterTimelineEventType.state(eventType: $0) })
}
}()
}