From 2ae8b9bf75a6a917f8d5490889da3e3e50f05ba9 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Wed, 2 Sep 2026 11:28:36 +0300 Subject: [PATCH] Promote knocking to labs --- .../Localizations/en-US.lproj/Localizable.strings | 2 ++ .../Localizations/en.lproj/Localizable.strings | 2 ++ ElementX/Sources/Generated/Strings.swift | 4 ++++ .../Screens/LabsScreen/LabsScreenModels.swift | 1 + .../Sources/Screens/LabsScreen/View/LabsScreen.swift | 12 ++++++++++++ .../DeveloperOptionsScreenModels.swift | 1 - .../View/DeveloperOptionsScreen.swift | 5 ----- 7 files changed, 21 insertions(+), 6 deletions(-) diff --git a/ElementX/Resources/Localizations/en-US.lproj/Localizable.strings b/ElementX/Resources/Localizations/en-US.lproj/Localizable.strings index 69f9e51e4..697bda20f 100644 --- a/ElementX/Resources/Localizations/en-US.lproj/Localizable.strings +++ b/ElementX/Resources/Localizations/en-US.lproj/Localizable.strings @@ -952,6 +952,8 @@ "screen_knock_requests_list_title" = "Requests to join"; "screen_labs_enable_gallery" = "Gallery messages"; "screen_labs_enable_gallery_description" = "Send multiple images or videos in one go. Stable on mobile, but not yet supported by web."; +"screen_labs_enable_knocking" = "Ask to join"; +"screen_labs_enable_knocking_description" = "Users can request access to a room that is not open for anyone to join. Stable on mobile, web implementation exists but is experimental."; "screen_labs_enable_threads" = "Enable thread replies"; "screen_labs_enable_threads_description" = "The app will restart to apply this change."; "screen_labs_header_description" = "Try out our latest ideas in development. These features are not finalized; they may be unstable, may change."; diff --git a/ElementX/Resources/Localizations/en.lproj/Localizable.strings b/ElementX/Resources/Localizations/en.lproj/Localizable.strings index 60373b822..ac9fb2829 100644 --- a/ElementX/Resources/Localizations/en.lproj/Localizable.strings +++ b/ElementX/Resources/Localizations/en.lproj/Localizable.strings @@ -952,6 +952,8 @@ "screen_knock_requests_list_title" = "Requests to join"; "screen_labs_enable_gallery" = "Gallery messages"; "screen_labs_enable_gallery_description" = "Send multiple images or videos in one go. Stable on mobile, but not yet supported by web."; +"screen_labs_enable_knocking" = "Ask to join"; +"screen_labs_enable_knocking_description" = "Users can request access to a room that is not open for anyone to join. Stable on mobile, web implementation exists but is experimental."; "screen_labs_enable_threads" = "Enable thread replies"; "screen_labs_enable_threads_description" = "The app will restart to apply this change."; "screen_labs_header_description" = "Try out our latest ideas in development. These features are not finalised; they may be unstable, may change."; diff --git a/ElementX/Sources/Generated/Strings.swift b/ElementX/Sources/Generated/Strings.swift index 7a151c840..9e1fe9cc4 100644 --- a/ElementX/Sources/Generated/Strings.swift +++ b/ElementX/Sources/Generated/Strings.swift @@ -2228,6 +2228,10 @@ internal nonisolated enum L10n { internal static var screenLabsEnableGallery: String { return L10n.tr("Localizable", "screen_labs_enable_gallery") } /// Send multiple images or videos in one go. Stable on mobile, but not yet supported by web. internal static var screenLabsEnableGalleryDescription: String { return L10n.tr("Localizable", "screen_labs_enable_gallery_description") } + /// Ask to join + internal static var screenLabsEnableKnocking: String { return L10n.tr("Localizable", "screen_labs_enable_knocking") } + /// Users can request access to a room that is not open for anyone to join. Stable on mobile, web implementation exists but is experimental. + internal static var screenLabsEnableKnockingDescription: String { return L10n.tr("Localizable", "screen_labs_enable_knocking_description") } /// Enable thread replies internal static var screenLabsEnableThreads: String { return L10n.tr("Localizable", "screen_labs_enable_threads") } /// The app will restart to apply this change. diff --git a/ElementX/Sources/Screens/LabsScreen/LabsScreenModels.swift b/ElementX/Sources/Screens/LabsScreen/LabsScreenModels.swift index 2ed04ae0f..9ced884fc 100644 --- a/ElementX/Sources/Screens/LabsScreen/LabsScreenModels.swift +++ b/ElementX/Sources/Screens/LabsScreen/LabsScreenModels.swift @@ -37,6 +37,7 @@ struct LabsScreenViewStateBindings { protocol LabsOptionsProtocol: AnyObject { var threadsEnabled: Bool { get set } var galleryEnabled: Bool { get set } + var knockingEnabled: Bool { get set } } extension AppSettings: LabsOptionsProtocol { } diff --git a/ElementX/Sources/Screens/LabsScreen/View/LabsScreen.swift b/ElementX/Sources/Screens/LabsScreen/View/LabsScreen.swift index 3929cc798..f6df34798 100644 --- a/ElementX/Sources/Screens/LabsScreen/View/LabsScreen.swift +++ b/ElementX/Sources/Screens/LabsScreen/View/LabsScreen.swift @@ -17,6 +17,7 @@ struct LabsScreen: View { header threadsSection gallerySection + knockingSection } .compoundList() .navigationTitle(L10n.screenLabsTitle) @@ -71,6 +72,17 @@ struct LabsScreen: View { .compoundListSectionFooter() } } + + private var knockingSection: some View { + Section { + ListRow(label: .default(title: L10n.screenLabsEnableKnocking, + icon: \.askToJoin), + kind: .toggle($context.knockingEnabled)) + } footer: { + Text(L10n.screenLabsEnableKnockingDescription) + .compoundListSectionFooter() + } + } } // MARK: - Previews diff --git a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift index 3fac901b4..fd0cf5c0b 100644 --- a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift +++ b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift @@ -64,7 +64,6 @@ protocol DeveloperOptionsProtocol: AnyObject { var fuzzyRoomListSearchEnabled: Bool { get set } var lowPriorityFilterEnabled: Bool { get set } var mentionsFilterEnabled: Bool { get set } - var knockingEnabled: Bool { get set } var linkPreviewsEnabled: Bool { get set } diff --git a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift index f660c637b..6379779fb 100644 --- a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift +++ b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift @@ -101,11 +101,6 @@ struct DeveloperOptionsScreen: View { Text("Jump to unread") Text("Adds a button to jump to the read marker, plus a presence dot on the scroll-to-bottom button when new messages arrive while scrolled away.") } - - Toggle(isOn: $context.knockingEnabled) { - Text("Knocking") - Text("Ask to join rooms") - } } Section {