Multi account feature flag (#6261)

* Add a multi-account feature flag

The flag lives in Developer options. Switching it on arms the upcoming one-time multi-account announcement, whose seen state defaults to true so fresh installs never see it.

* Add an Add account row to Settings behind the multi-account flag

The row sits in its own section under the user status, as in the designs. Tapping it is routed up to the settings flow, which ignores it until the add account flow exists.

* Remove the Developer options view model tests

The Developer options screen is excluded from coverage, so these tests don't add value.

* Apply review suggestions to the multi-account flag

- Order the multi-account requirements in DeveloperOptionsProtocol to match the screen's sections.
- Drop the redundant "Experimental" from the toggle's subtitle.
This commit is contained in:
Mauro
2026-10-05 13:04:16 +02:00
committed by GitHub
parent 9ce3bd97d8
commit 49457f7ae8
19 changed files with 113 additions and 21 deletions
@@ -27,6 +27,10 @@ struct SettingsScreen: View {
userStatusSection
}
if context.viewState.showAddAccountButton {
addAccountSection
}
if !shouldHideManageAccountSection {
manageAccountSection
}
@@ -98,6 +102,17 @@ struct SettingsScreen: View {
}
}
private var addAccountSection: some View {
Section {
ListRow(label: .default(title: L10n.screenSettingsAddAccount,
icon: \.plus),
kind: .navigationLink {
context.send(viewAction: .addAccount)
})
.accessibilityIdentifier(A11yIdentifiers.settingsScreen.addAccount)
}
}
private var manageMyAppSection: some View {
Section {
ListRow(label: .default(title: L10n.screenNotificationSettingsTitle,
@@ -288,7 +303,7 @@ struct SettingsScreen_Previews: PreviewProvider, TestablePreview {
SettingsScreen(context: viewModel.context)
}
.snapshotPreferences(expect: viewModel.context.observe(\.viewState.accountProfileURL).map { $0 != nil })
.frame(height: 1100)
.frame(height: 1200)
.previewLayout(.sizeThatFits)
.previewDisplayName("Default")
@@ -296,7 +311,7 @@ struct SettingsScreen_Previews: PreviewProvider, TestablePreview {
SettingsScreen(context: bugReportDisabledViewModel.context)
}
.snapshotPreferences(expect: bugReportDisabledViewModel.context.observe(\.viewState.accountProfileURL).map { $0 != nil })
.frame(height: 1050)
.frame(height: 1150)
.previewLayout(.sizeThatFits)
.previewDisplayName("Bug report disabled")
}
@@ -306,8 +321,10 @@ struct SettingsScreen_Previews: PreviewProvider, TestablePreview {
deviceID: "AAAAAAAAAAA",
displayName: "Alice Liddell",
status: .mockFocussing))))
let userSettings = UserSettings.volatile()
userSettings.multiAccountEnabled = true
return SettingsScreenViewModel(userSession: userSession,
userSettings: .volatile(),
userSettings: userSettings,
isBugReportServiceEnabled: isBugReportServiceEnabled,
isInSecondaryWindow: false,
userIndicatorController: UserIndicatorControllerMock())