Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,22 @@ public final class MainTabBarController<

private weak var conversationListNavigationController: UINavigationController!
private weak var archiveNavigationController: UINavigationController!
private weak var meetingsNavigationController: UINavigationController!
private weak var settingsNavigationController: UINavigationController!

private weak var _conversationListUI: ConversationListUI?
private weak var _archiveUI: ArchiveUI?
private weak var _settingsUI: SettingsUI?
private weak var _conversationUI: ConversationUI?
private weak var _settingsContentUI: UIViewController?
/// We should use DeveloperFlag 'wireMeetings' after moving it to WireFoundation:
/// https://wearezeta.atlassian.net/browse/WPB-19065
private var showMeetings: Bool

// MARK: - Life Cycle

public required init() {
public init(showMeetings: Bool) {
self.showMeetings = showMeetings
super.init(nibName: nil, bundle: nil)
setupTabs()
setupAppearance()
Expand All @@ -98,16 +103,25 @@ public final class MainTabBarController<
archiveNavigationController.navigationBar.isTranslucent = false
self.archiveNavigationController = archiveNavigationController

let meetingsNavigationController = UINavigationController()
meetingsNavigationController.navigationBar.isTranslucent = false
self.meetingsNavigationController = meetingsNavigationController

let settingsNavigationController = UINavigationController()
settingsNavigationController.navigationBar.isTranslucent = false
self.settingsNavigationController = settingsNavigationController

viewControllers = [
var tabs: [UIViewController] = [
conversationListNavigationController,
archiveNavigationController,
settingsNavigationController
]

if showMeetings {
tabs.insert(meetingsNavigationController, at: 2)
}
setViewControllers(tabs, animated: false)

for content in MainTabBarControllerContent.allCases {
switch content {
case .conversations:
Expand Down Expand Up @@ -148,6 +162,25 @@ public final class MainTabBarController<
)
archiveNavigationController.tabBarItem = tabBarItem

case .meetings:
let tabBarItem = UITabBarItem(
title: String(localized: "tabBar.meetings.title", bundle: .module),
image: .init(resource: .videoCall),
selectedImage: .init(resource: .videoCallFilled)
)
tabBarItem.accessibilityIdentifier = "bottomBarMeetingsButton"
tabBarItem.accessibilityLabel = String(
localized: "tabBar.meetings.description",
table: "Accessibility",
bundle: .module
)
tabBarItem.accessibilityHint = String(
localized: "tabBar.meetings.hint",
table: "Accessibility",
bundle: .module
)
meetingsNavigationController.tabBarItem = tabBarItem

case .settings:
let tabBarItem = UITabBarItem(
title: String(localized: "tabBar.settings.title", bundle: .module),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,9 @@ public final class MainCoordinator<Dependencies>: NSObject, MainCoordinatorProto
case .archive:
sidebar.selectedMenuItem = .init(.archive)

case .meetings:
sidebar.selectedMenuItem = .init(.meetings)

case .settings:
sidebar.selectedMenuItem = .init(.settings)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public enum MainSidebarMenuItem: Sendable, Equatable {
case drafts
case archive
case folders
case meetings
// bottom
case settings
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ public enum MainTabBarControllerContent: Int, CaseIterable {
case conversations
case archive
case settings
case meetings
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func MainSplitViewControllerPreview() -> UISplitViewController {
let splitViewController = MainSplitViewController<PreviewSidebarViewController, PreviewTabBarController>(
sidebar: PreviewSidebarViewController("sidebar"),
noConversationPlaceholder: UIHostingController(rootView: Text(verbatim: "no conversation placeholder")),
tabController: .init()
tabController: .init(showMeetings: false)
)
splitViewController.conversationListUI = PreviewConversationListViewController("conversation list")
return splitViewController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import SwiftUI

@MainActor
func MainTabBarControllerPreview() -> some MainTabBarControllerProtocol {
let tabBarController = PreviewTabBarController()
let tabBarController = PreviewTabBarController(showMeetings: false)
tabBarController.conversationListUI = .init("conversationList")
tabBarController.archiveUI = PlaceholderViewController()
tabBarController.settingsUI = .init()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "VideoCall.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "VideoCallFilled.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,28 @@
}
}
},
"tabBar.meetings.description" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Meetings"
}
}
}
},
"tabBar.meetings.hint" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "List of meetings"
}
}
}
},
"tabBar.settings.description" : {
"localizations" : {
"ar" : {
Expand Down Expand Up @@ -747,4 +769,4 @@
}
},
"version" : "1.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,17 @@
}
}
},
"tabBar.meetings.title" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Meetings"
}
}
}
},
"tabBar.settings.title" : {
"localizations" : {
"ar" : {
Expand Down Expand Up @@ -375,4 +386,4 @@
}
},
"version" : "1.0"
}
}
1 change: 1 addition & 0 deletions WireUI/Sources/WireSidebarUI/Models/SidebarModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ final class SidebarModel: ObservableObject {
}

@Published var showUnreadFilters: Bool = false
@Published var showMeetings: Bool = false

let accountImageAction: () -> Void
let menuItemAction: (_ selectedMenuItem: SidebarSelectableMenuItem) -> Void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public enum SidebarSelectableMenuItem: Comparable, Sendable, Hashable {
case replies
case drafts
case folders
case meetings
// archived conversations
case archive
// bottom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
"sidebar.conversation_filter.folders.title" = "Folders";
"sidebar.conversation_filter.archived.title" = "Archive";

"sidebar.meetings.title" = "Meetings";
"sidebar.meetings.all_meetings.title" = "All Meetings";

"sidebar.contacts.title" = "Contacts";
"sidebar.contacts.connect.title" = "Connect";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ struct SidebarPreview: View {
accountInfo: accountInfo,
selectedMenuItem: $selectedMenuItem,
showUnreadFilters: false,
showMeetings: false,
accountImageAction: {},
foldersAction: { _ in },
supportAction: {},
Expand Down
14 changes: 14 additions & 0 deletions WireUI/Sources/WireSidebarUI/Views/SidebarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public struct SidebarView<AccountImageView: View, LegalHoldIndicatorView: View>:
public var accountInfo: SidebarAccountInfo?
@Binding public var selectedMenuItem: SidebarSelectableMenuItem
public var showUnreadFilters: Bool
public var showMeetings: Bool

private(set) var accountImageAction: () -> Void
private(set) var foldersAction: (CGRect) -> Void
Expand All @@ -44,6 +45,7 @@ public struct SidebarView<AccountImageView: View, LegalHoldIndicatorView: View>:
accountInfo: SidebarAccountInfo,
selectedMenuItem: Binding<SidebarSelectableMenuItem>,
showUnreadFilters: Bool,
showMeetings: Bool,
accountImageAction: @escaping () -> Void,
foldersAction: @escaping (_ buttonFrame: CGRect) -> Void,
supportAction: @escaping () -> Void,
Expand All @@ -53,6 +55,7 @@ public struct SidebarView<AccountImageView: View, LegalHoldIndicatorView: View>:
self.accountInfo = accountInfo
_selectedMenuItem = selectedMenuItem
self.showUnreadFilters = showUnreadFilters
self.showMeetings = showMeetings
self.accountImageAction = accountImageAction
self.foldersAction = foldersAction
self.supportAction = supportAction
Expand Down Expand Up @@ -137,6 +140,12 @@ public struct SidebarView<AccountImageView: View, LegalHoldIndicatorView: View>:
// Additional filters
selectableMenuItem(.folders)
selectableMenuItem(.archive)

// Meetings
if showMeetings {
menuItemHeader(Strings.Meetings.title, addTopPadding: false)
selectableMenuItem(.meetings)
}
}
.padding(.horizontal, 16)
}
Expand Down Expand Up @@ -262,6 +271,11 @@ public struct SidebarView<AccountImageView: View, LegalHoldIndicatorView: View>:
icon = "archivebox"
accessibilityLabel = Text(Strings.ConversationFilter.Archived.title)

case .meetings:
text = Text(Strings.Meetings.AllMeetings.title)
icon = "video"
accessibilityLabel = Text(Strings.Meetings.AllMeetings.title)

case .settings:
text = Text(Strings.Settings.title)
icon = "gearshape"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ public final class SidebarViewController: UIViewController {
set { model.showUnreadFilters = newValue }
}

public var showMeetings: Bool {
get { model.showMeetings }
set { model.showMeetings = newValue }
}

// MARK: - Private Properties

private var model: SidebarModel!
Expand Down Expand Up @@ -176,6 +181,7 @@ private struct SidebarAdapter<AccountImageView: View, LegalHoldIndicatorView: Vi
accountInfo: model.accountInfo,
selectedMenuItem: $model.selectedMenuItem,
showUnreadFilters: model.showUnreadFilters,
showMeetings: model.showMeetings,
accountImageAction: model.accountImageAction,
foldersAction: model.foldersAction,
supportAction: model.supportAction,
Expand Down
4 changes: 4 additions & 0 deletions wire-ios-utilities/Source/DeveloperFlag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public enum DeveloperFlag: String, CaseIterable {
case chatBubbles
case chatBubblesSimple
case consumableNotifications
case wireMeetings

public var description: String {
switch self {
Expand Down Expand Up @@ -100,6 +101,9 @@ public enum DeveloperFlag: String, CaseIterable {

case .consumableNotifications:
"Turn on to enable consumable notifications"

case .wireMeetings:
"Turn on to enable Wire meetings"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

import WireMainNavigationUI
import WireSidebarUI

Check warning on line 21 in wire-ios/Wire-iOS/Sources/UserInterface/MainController/SidebarViewController+MainSidebarProtocol.swift

View workflow job for this annotation

GitHub Actions / Test Results

Extension declares a conformance of imported type 'SidebarViewController' to imported protocol 'MainSidebarProtocol'; this will not behave correctly if the owners of 'WireSidebarUI' introduce this conformance in the future

Extension declares a conformance of imported type 'SidebarViewController' to imported protocol 'MainSidebarProtocol'; this will not behave correctly if the owners of 'WireSidebarUI' introduce this conformance in the future
extension SidebarViewController: MainSidebarProtocol {}

Check warning on line 23 in wire-ios/Wire-iOS/Sources/UserInterface/MainController/SidebarViewController+MainSidebarProtocol.swift

View workflow job for this annotation

GitHub Actions / Test Results

Extension declares a conformance of imported type 'SidebarSelectableMenuItem' to imported protocol 'MainSidebarSelectableMenuItemRepresentable'; this will not behave correctly if the owners of 'WireSidebarUI' introduce this conformance in the future

Extension declares a conformance of imported type 'SidebarSelectableMenuItem' to imported protocol 'MainSidebarSelectableMenuItemRepresentable'; this will not behave correctly if the owners of 'WireSidebarUI' introduce this conformance in the future
extension SidebarSelectableMenuItem: MainSidebarSelectableMenuItemRepresentable {

public init(_ mainSidebarMenuItem: MainSidebarMenuItem) {
Expand All @@ -32,6 +32,7 @@
case .oneOnOne: self = .oneOnOne
case .unread: self = .unread
case .mentions: self = .mentions
case .meetings: self = .meetings
case .replies: self = .replies
case .drafts: self = .drafts
case .folders: self = .folders
Expand All @@ -49,6 +50,7 @@
case .oneOnOne: .oneOnOne
case .unread: .unread
case .mentions: .mentions
case .meetings: .meetings
case .replies: .replies
case .drafts: .drafts
case .folders: .folders
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ struct SidebarViewControllerBuilder {

// Configure unread filters visibility based on feature flag
sidebarViewController.showUnreadFilters = DeveloperFlag.showUnreadConversationsFilter.isOn
sidebarViewController.showMeetings = DeveloperFlag.wireMeetings.isOn

return sidebarViewController
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ final class SidebarViewControllerDelegate: WireSidebarUI.SidebarViewControllerDe
await mainCoordinator.showArchive()
case .settings:
await mainCoordinator.showSettings()
case .meetings:
await mainCoordinator.showSettings()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: didn't you mean ?

Suggested change
await mainCoordinator.showSettings()
await mainCoordinator.showMeetings()

}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ final class ZClientViewController: UIViewController {
private(set) var mediaPlaybackManager: MediaPlaybackManager?

let mainTabBarController = {
let tabBarController = MainCoordinator.TabBarController()
let tabBarController = MainCoordinator.TabBarController(showMeetings: DeveloperFlag.wireMeetings.isOn)
tabBarController.applyMainTabBarControllerAppearance()
return tabBarController
}()
Expand Down Expand Up @@ -239,6 +239,7 @@ final class ZClientViewController: UIViewController {
.observe(\.showUnreadConversationsFilter, options: [.new]) { [weak self] _, _ in
// Update sidebar's showUnreadFilters when developer flag changes
self?.sidebarViewController.showUnreadFilters = DeveloperFlag.showUnreadConversationsFilter.isOn
self?.sidebarViewController.showMeetings = DeveloperFlag.wireMeetings.isOn
}

createLegalHoldDisclosureController()
Expand Down
Loading