removed LLS feature flag

This commit is contained in:
Mauro Romito
2026-04-27 12:55:33 +02:00
committed by Mauro
parent c33cb5671c
commit 876109ef75
16 changed files with 55 additions and 124 deletions
@@ -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,
@@ -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] = []
@@ -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(),
@@ -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)])
}
}
@@ -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)
}