Display a banner on the room list when 2 or more accounts are logged in, to let the user know
that they can swipe their avatar to switch account. The banner is stored as a new
Announcement.SwipeAvatarToSwitchAccount, and is dismissed when the user taps on it, or when
the user switches account by swiping their avatar.
The banner is displayed at the same place as the new notification sound banner, but never
at the same time.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
AppMigration11 was run once, in the first release containing it, whatever
the state of the MultiAccount feature flag. Users installing the app
while the feature flag was disabled were considered as new users and
would never see the announcement once the feature flag got enabled.
The multi-account announcement is now pending by default (NeverShown),
and is marked as shown when the user enters the login flow while the
feature is enabled, either for the first time or to add another account.
Users who were already logged in before the feature became available
will see the announcement.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Show a one-time bottom sheet on the home screen to announce that several
accounts can now be added (element-hq/element-meta#3349).
- Add `Announcement.MultiAccount`, which is never shown by default.
- AppMigration11 queues the announcement on application upgrade only,
and marks it as shown if the user already has several accounts.
- HomePresenter shows the bottom sheet only when the announcement is
pending, the MultiAccount feature flag is enabled and the user has a
single account.
- The "Add account" button hides the sheet, marks the announcement as
dismissed and starts the add account flow through the new
`HomeEntryPoint.Callback.navigateToAddAccount()`.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The `Provider` suffix reads as a dependency provider rather than as preview
data, and it collides with the real providers in the codebase — `StringProvider`,
`PickerProvider`, the login feature's `AccountProvider` — so the name says
nothing about which of the two a class is. `PreviewParam` says it.
195 classes are renamed, along with the 185 files named after them, the konsist
rule that enforces the convention, the presentation-class file templates and the
onboarding documentation.
This cannot be split. `Konsist.scopeFromProduction()` scans the whole project, so
flipping the assertion before every class has moved leaves the rule red, and a
rule that accepted either suffix during a transition would be exactly the kind of
compatibility layer this convention change is meant to remove.
Two judgement calls in the rule itself. The `name.endsWith("PreviewProvider")`
exclusion is dropped: its only job was to reject a redundant `Preview` before
`Provider`, and the new suffix already contains it; no class currently ends with
`PreviewProvider`, so removing it changes nothing today. And
`EditableAvatarViewUriProvider` is renamed rather than deleted from the exclusion
list even though no such class exists in this repository, since it presumably
comes from the modules overlaid for the enterprise build.
Nothing keyed off the old suffix: no snapshot filename contains a provider class
name, so no Paparazzi image changes, and the Kover variants match on `*Presenter`,
`*State` and `*ViewKt`, so coverage bounds are unaffected.
* Notification settings: pick custom sounds for messages and call ringtones (#6702)
* Feature: add notification sound settings for messages and calls
* Add sound not available banner, accessibility checks
* Fix build and Konsist convention violations
- libraries:preferences:api now uses io.element.android-compose-library
so NotificationSound's @Immutable annotation can resolve, matching the
pattern in libraries:matrix:api.
- Rename SoundUnavailableBannerStateProvider to
NotificationSoundUnavailableStateProvider so the class name contains
the parameter type as required by KonsistClassNameTest.
* Suppress LargeClass on RoomListPresenterTest
The three new sound-unavailable tests pushed the class past Detekt's
default LargeClass threshold. Matches the suppression pattern already
used on five presenter test classes under features/messages/impl/test.
* NotificationSettingsView: guard ringtone-picker launchers in inspection mode
rememberLauncherForActivityResult requires a LocalActivityResultRegistryOwner,
which Paparazzi-driven preview snapshot tests don't provide, causing
NotificationSettingsViewPreview to throw IllegalStateException for every
preview parameter. Extract the click handlers into a helper that returns a
no-op when LocalInspectionMode.current is true; the runtime path is unchanged.
* Handle unresolved notification sounds mid session
* Quality checks, refactor mid session error ui
* Suppress detekt LargeClass on NotificationSettingsPresenterTest
* Remove notification sound resilience layer, replace with file copy
* Reselect element sound option, code cleanup
* Add element fade notification sound option
* Fix new file headers
* Revert to flowOf(Unit) for announcement service
* Add ringtone picker dialog to match message selector
* Update strings in conjunction with ios
* Update test to reflect new string
* Sync strings.
* Update screenshots
* Fix test
* Remove not properly located translations.
This will be fixed in the next String sync.
* Fix test on CI
---------
Co-authored-by: Jenna Vassar <jenna.vassar@toptal.com>
Co-authored-by: ElementBot <android@element.io>
* Sync Strings from Localazy
* Use the previous plurals as plain strings
* Add extra case for 1 vs multiple users
* Update screenshots
---------
Co-authored-by: Jorge Martín <jorgem@element.io>