Skip to content

feat: Hide/show the meetings UI depends on the feature flag - WPB-25683 - #5128

Merged
KaterinaWire merged 6 commits into
developfrom
feat/use-meetings-feature-flag
Aug 17, 2026
Merged

feat: Hide/show the meetings UI depends on the feature flag - WPB-25683#5128
KaterinaWire merged 6 commits into
developfrom
feat/use-meetings-feature-flag

Conversation

@KaterinaWire

@KaterinaWire KaterinaWire commented Aug 14, 2026

Copy link
Copy Markdown
Contributor
TaskWPB-25683 [iOS] Hide/show the UI depends on the feature flag

Issue

We should show/hide the Meeting tab depends on the “meetings“ feature flag.

Testing

Checklist

  • Title contains a reference JIRA issue number like [WPB-XXX].
  • Description is filled and free of optional paragraphs.
  • Adds/updates automated tests.

UI accessibility checklist

If your PR includes UI changes, please utilize this checklist:

  • Make sure you use the API for UI elements that support large fonts.
  • All colors are taken from WireDesign.ColorTheme or constructed using WireDesign.BaseColorPalette.
  • New UI elements have Accessibility strings for VoiceOver.

Copilot AI lite review requested due to automatic review settings August 14, 2026 12:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR wires the Meetings UI visibility to a new UserSession.isMeetingsEnabled flag (derived from feature config), and propagates that through the main tab bar and sidebar so Meetings can be added after initial sync.

Changes:

  • Added UserSession.isMeetingsEnabled and implemented it in ZMUserSession (plus mocks).
  • Updated ZClientViewController to build/enable Meetings UI based on isMeetingsEnabled, including reacting to feature config updates.
  • Refactored Meetings tab bar item setup in MainTabBarController and enabled lazy insertion of the Meetings tab when the UI becomes available.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
WireUI/Sources/WireMainNavigationUI/Containers/MainTabBarController.swift Refactors Meetings tab bar item setup and supports lazy insertion of the Meetings tab when meetingsUI is set.
wire-ios/Wire-iOS/Sources/UserInterface/MainController/ZClientViewController.swift Switches Meetings visibility logic to userSession.isMeetingsEnabled and reacts to feature config changes to setup Meetings.
wire-ios/Wire-iOS/Sources/UserInterface/MainController/SidebarViewControllerBuilder.swift Plumbs isMeetingsEnabled into sidebar construction to control Meetings visibility.
wire-ios/Tests/Mocks/UserSessionMock.swift Adds isMeetingsEnabled to the test UserSession mock.
wire-ios-sync-engine/Support/Sourcery/generated/AutoMockable.manual.swift Adds isMeetingsEnabled to the generated MockUserSession.
wire-ios-sync-engine/Source/UserSession/ZMUserSession/ZMUserSession.swift Implements isMeetingsEnabled via feature config (currently also gated by developer flag).
wire-ios-sync-engine/Source/UserSession/UserSession.swift Extends the UserSession protocol with isMeetingsEnabled.
Suppressed comments (1)

WireUI/Sources/WireMainNavigationUI/Containers/MainTabBarController.swift:273

  • setMeetingsUI now supports dynamically inserting the Meetings tab after initialization (when showMeetings was false). There are existing unit tests for tab installation/release, but there isn't coverage for the new runtime-enable/runtime-disable flow (e.g. starting without Meetings, setting meetingsUI to non-nil to insert the tab, then setting it back to nil to remove it). Adding a test in WireUI/Tests/WireMainNavigationUITests/Containers/MainTabBarControllerTests.swift would help prevent regressions in the feature-flag-driven hide/show behavior.
        if meetingsNavigationController == nil, meetingsUI != nil {
            let meetingsNavigationController = UINavigationController()
            meetingsNavigationController.navigationBar.isTranslucent = false
            self.meetingsNavigationController = meetingsNavigationController
            viewControllers?.insert(meetingsNavigationController, at: 2)
            setupMeetingsTabBarItem()
        }

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@KaterinaWire
KaterinaWire requested review from acv-w and jullianm August 14, 2026 13:18
@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Test Results

3 246 tests   3 218 ✅  5m 6s ⏱️
  479 suites     28 💤
    3 files        0 ❌

Results for commit 304b4cc.

♻️ This comment has been updated with latest results.

Summary: workflow run #32029398781
Allure report (download zip): html-report-32862-feat_use-meetings-feature-flag

KaterinaWire and others added 2 commits August 14, 2026 15:21
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@samwyndham samwyndham left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice work!

@KaterinaWire
KaterinaWire removed the request for review from jullianm August 17, 2026 06:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated no new comments.

Suppressed comments (3)

WireUI/Sources/WireMainNavigationUI/Containers/MainTabBarController.swift:279

  • When meetingsUI is set to nil, the code only clears the navigation controller’s stack but keeps the Meetings tab in viewControllers. This leaves a visible Meetings tab that opens to an empty screen, which breaks the intended hide/show behavior when the feature flag is disabled. Remove the Meetings navigation controller from the tab bar when disabling (and reset selection if the user is currently on that tab).
        _meetingsUI = meetingsUI

        let viewControllers = [meetingsUI].compactMap(\.self)
        meetingsNavigationController?.setViewControllers(viewControllers, animated: animated)
        meetingsNavigationController?.view.layoutIfNeeded()

wire-ios/Wire-iOS/Sources/UserInterface/MainController/ZClientViewController.swift:312

  • clientSessionComponent is documented as guaranteed to exist for this view controller’s lifetime, but observeFeatureConfigChanges() uses optional chaining (clientSessionComponent?). If that assumption is ever violated, this will silently drop the subscription and prevent the Files/Meetings tabs from updating, making the UI inconsistent and harder to debug. Prefer accessing it non-optionally so failures are explicit.
    private func observeFeatureConfigChanges() {
        subscription = clientSessionComponent?.featureConfigRepository
            .observeFeatureStates()
            .receive(on: DispatchQueue.main)
            .sink { [weak self] featureState in

WireUI/Sources/WireMainNavigationUI/Containers/MainTabBarController.swift:272

  • The Meetings tab is inserted at a hard-coded index (at: 2), but selectedContent maps between tab indices and MainTabBarControllerContent.rawValue. With the current enum ordering, placing Meetings at index 2 will make programmatic tab selection (e.g. selectedContent = .archive/.settings/.meetings) select the wrong tab once Meetings is present. The insertion order and the MainTabBarControllerContent raw values need to be aligned (or selectedContent needs an index mapping that accounts for optional tabs).
            let meetingsNavigationController = UINavigationController()
            meetingsNavigationController.navigationBar.isTranslucent = false
            self.meetingsNavigationController = meetingsNavigationController
            viewControllers?.insert(meetingsNavigationController, at: 2)
            setupMeetingsTabBarItem()

@KaterinaWire
KaterinaWire added this pull request to the merge queue Aug 17, 2026
Merged via the queue into develop with commit 7a3fb74 Aug 17, 2026
12 checks passed
@KaterinaWire
KaterinaWire deleted the feat/use-meetings-feature-flag branch August 17, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants