828 Commits

Author SHA1 Message Date
ganfra
45113818eb Merge pull request #4824 from element-hq/feature/fga/fix_identity_change
fix (identity change) :  RoomMemberIdentityStateChange in non encrypted room
2025-06-05 11:16:56 +02:00
renovate[bot]
96063373b7 fix(deps): update coil to v3.2.0 (#4712)
* fix(deps): update coil to v3.2.0

* Fix compilation issue. Need to provide an image for preview.

https://coil-kt.github.io/coil/compose/#previews

* Improve preview for images.

* Update screenshots

* More cleanup

* Update screenshots

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Benoit Marty <benoit@matrix.org>
Co-authored-by: ElementBot <android@element.io>
2025-06-05 09:49:27 +02:00
ganfra
df5e4062ec fix (identity change) : ensure we can configure to observe RoomMemberIdentityStateChange in non encrypted room if needed 2025-06-04 22:27:40 +02:00
Jorge Martin Espinosa
58a3ea8b1f Add catchingExceptions method to replace runCatching (#4797)
- Add `runCatchingExceptions` and `mapCatchingExceptions` to replace `runCatching` and `mapCatching`.
- Make `tryOrNull { ... }` catch only exceptions too.
- Apply the changes to the whole project.
- Add new Rust fakes for tests to handle the code that's now unblocked - previously it just threw an `UnsatisfiedLinkError` which we ignored.
- Add a new `detekt-rules` project with a `RunCatchingRule` to prevent `runCatching` and `mapCatching` usages.
2025-06-04 09:02:26 +02:00
renovate[bot]
9d5e8aa308 fix(deps): update dependency androidx.compose:compose-bom to v2025.04.01 (#4631)
* fix(deps): update dependency androidx.compose:compose-bom to v2025.04.01

* Fix autofill deprecations

* Adapt our custom BottomSheetState and scaffold to the new APIs

* Get rid of all the custom bottom sheet implementation

It doesn't seem to be needed anymore 🎉

* Replace `semantics { invisibleToUser() }`  with `hideFromAccessibility()`

* Update screenshots

* Add commit and cancel callbacks for autofill on the login view

* Fix broken tests caused mainly by https://issuetracker.google.com/issues/366255137

Add `LocalUiTestMode` composition local and helper functions.

* Remove dependency that caused a new license to need to be approved

* Let setSafeContent handle setting the value for LocalUiTestMode

* Fix broken test

* Apply fix to RoomMemberModerationViewTest and RoomListDeclineInviteMenuTest

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
Co-authored-by: ElementBot <android@element.io>
Co-authored-by: Benoit Marty <benoit@matrix.org>
2025-06-03 21:05:43 +00:00
ganfra
cfbbccb09d Merge branch 'develop' into feature/fga/user_moderation_bottomsheet 2025-06-03 10:46:12 +02:00
ElementBot
5a8919b6e3 Sync Strings from Localazy (#4804)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2025-06-02 12:05:08 +02:00
ElementBot
498cf15d38 Sync Strings (#4775) 2025-05-30 08:47:39 +00:00
Benoit Marty
cf17d93580 Stronger lambda error (#4771)
* Make sure lambdaError() make the test fail in all circumstances.

* Fix existing errors on tests.

* Uniformize the way we are creating class under test.

* Cleanup

* Fix typo

* Fix failing test after rebase.
2025-05-27 15:32:09 +00:00
ganfra
3d5274a6d4 change (member moderation) : clean up 2025-05-24 11:23:09 +02:00
ganfra
03e1926e14 Merge branch 'develop' into feature/fga/user_moderation_bottomsheet 2025-05-23 17:28:48 +02:00
ganfra
2ac333bb52 change (member moderation) : clean and add tests on Presenter 2025-05-21 18:31:08 +02:00
ganfra
2429879b5a change (member moderation) : fix all existing tests 2025-05-19 22:16:17 +02:00
ElementBot
90f89b9088 Sync Strings (#4739)
* Sync Strings from Localazy

* Sync strings again

---------

Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
Co-authored-by: Benoit Marty <benoit@matrix.org>
2025-05-19 08:17:02 +00:00
ganfra
c6eea91d69 change (member moderation) : allow disabled action and render unban too 2025-05-16 18:38:15 +02:00
ganfra
f22b921768 change (member moderation) : branch moderation on timeline 2025-05-14 11:19:07 +02:00
ganfra
5272587897 change (member moderation) : extract in a separate module 2025-05-14 11:19:07 +02:00
ganfra
405cd8e82d change (report room) : use client.isReportRoomApiSupported instead of hardcoded value 2025-05-14 11:07:17 +02:00
Benoit Marty
e8e75af506 Update "Learn more" link (#4686)
* Update target link for "Learn more".

* Rename VerifySelfSession* to OutgoingVerification*

* Optimize import

* Refactor to avoid long line

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2025-05-09 11:10:30 +02:00
ElementBot
aab5104010 Sync Strings from Localazy (#4677)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2025-05-05 12:11:22 +02:00
ganfra
c2568f84d2 Feature : Report room (#4654)
* feature (report room) : introduce all presentation classes.

* feature (report room) : branch entry point in the room list

* refactor (matrix ui) : move some code from appnav to matrix ui

* feature (report room) : add api on room

* feature (report room) : adjust ui

* feature (report room) : branch api

* feature (decline invite and block) : move things around and introduce presentation classes

* feature (decline invite and block) : continue to move things

* feature (report room) : remove reference to "conversation" for now

* feature (report room) : add report room action to room detail screen

* feature (report room) : enabled button state

* feature (report room) : improve code and reuse

* feature (report room) : add feature flag

* feature (report room) : change feature flag to static bool

* feature (report room) : add tests

* feature (report room) : fix ui with new api on ListItem

* feature (report room) : clean up and add more tests.

* Update screenshots

* feature (report room) : more test and fix issue

* feature (report room) : update strings

* feature (report room) : fix konsist preview

* feature (report room) : disable feature

* Update screenshots

* var -> val

* Improve preview of AcceptDeclineInviteView

* Improve preview consistency

* Add missing test on DismissErrorAndHideContent

* Update screenshots

* Add missing tests

---------

Co-authored-by: ElementBot <android@element.io>
Co-authored-by: Benoit Marty <benoit@matrix.org>
2025-05-02 12:25:19 +02:00
ElementBot
76c59e2eac Sync Strings from Localazy (#4648)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2025-04-28 10:59:35 +02:00
Benoit Marty
fc59df878f Accessibility: improve behavior of list items (#4626)
* a11y: add Modifier to improve accessibility of ListItems.

Remove duplication of onChange. As per the documentation, it has to be used only if the behavior is different than the onClick listener of the list item.
It also has the effect to read twice the action when the screen reader is one. See https://github.com/element-hq/element-x-android/pull/4047#discussion_r1888136571 for more details

a11y: remove contentDescription on List item icon, else the text is read twice.

* Ensure that if the ListItem is not enabled, the trailing/leading content is also not enabled.

* Update screenshots

* Fix lint crash.

---------

Co-authored-by: ElementBot <android@element.io>
2025-04-24 21:53:21 +02:00
Jorge Martin Espinosa
c537e94146 Split MatrixRoom into BaseRoom and JoinedRoom (#4561)
`JoinedRoom` will now contain both a mandatory live timeline reference and all the functionality associated to it.

`BaseRoom` on the other hand will contain only functionality that's shared for both joined and not joined rooms.

`NotJoinedRoom` is a wrapper around `RoomPreviewInfo` data and a possible local `BaseRoom`, if it exists.

The `RustRoomFactory` cache is now gone since the persistent event cache should have the same effect.
2025-04-23 15:53:40 +02:00
ElementBot
491eda9ba5 Sync Strings from Localazy (#4612)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2025-04-22 08:57:00 +02:00
Benoit Marty
e2e58749f5 [a11y] Make more items focusable (#4605)
* Fix settings entry point not available when there is no avatar on the account. Fixes #4599.

* Use Ktx extension `String.toUri()`

* Allow screen reader to focus on the user avatar to allow editing it.

* Fix import order
2025-04-22 08:50:50 +02:00
ElementBot
270b420575 Sync Strings (#4590)
* Sync Strings from Localazy

* Fix strings usage after some were moved

* Fix Norwegian string that was causing lint to fail

* Update screenshots

---------

Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2025-04-14 11:24:28 +02:00
Benoit Marty
2f0eb9f068 Click on userId / room alias to copy value to clipboard. (#4549) 2025-04-08 09:23:02 +02:00
ElementBot
3ded30e8fd Sync Strings from Localazy (#4543)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2025-04-07 09:20:32 +02:00
Benoit Marty
77a7c0b2e5 Remember flows (#4533)
* Add Konsist test to ensure that the result of a function returning a flow is remembered.

* Remember flows before they are collected by state.

* Fix compilation issue

* Make isOnline a val.

* Make selectedUsers() a val.

* Make flow() a val.

* Make getUserConsent(), didAskUserConsent() and getAnalyticsId() some val.

* Remove Timeline.paginationStatus() and replace by direct access to the underlined flow.

* Simplify test

* userConsentFlow must be initialized before because it's used in observeUserConsent

* Fix test compilation
2025-04-04 16:50:43 +02:00
Benoit Marty
a3ce1d484d Replace OutlinedTextField by our TextField (#4521)
* Let TextFieldListItem take the entire width.

* Add unit test to detect usage of OutlinedTextField.

* Use TextField instead of OutlinedTextField

* Remove unnecessary opt in to ExperimentalFoundationApi

* Use TextField instead of OutlinedTextField

* Fix compilation issue.

* Update screenshots

* ListDialog: add space between items.

* Update screenshots

* Set applyPaddingToContents to true by default.

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2025-04-02 14:04:07 +00:00
Benoit Marty
c65b54d3b7 Improve TextFieldDialog (#4512)
* Extract TextFieldDialog to its own file (no other change).

* Add TextFieldDialogPreview

Enhance TextFieldDialog

* Let RoomMembersModerationView use TextFieldDialog

* Update screenshots

* Konsist.

* Add modifier parameter.

---------

Co-authored-by: ElementBot <android@element.io>
2025-04-02 10:05:56 +02:00
Benoit Marty
0545c56486 Add kick (remove) confirmation and reason (#4507)
* Add confirmation dialog when kicking someone, ith ability to provide a reason.

Also add the reason for banning people.

* Fix padding issue in dialogs.

* Improve TextField in dialog.

* Update screenshots

* Fix tests

* Format and import

* Add missing UI tests.

* Use `needsConfirmation` as it's already used in the code base.

---------

Co-authored-by: ElementBot <android@element.io>
2025-04-01 11:38:46 +02:00
ElementBot
2c62c44c11 Sync Strings from Localazy (#4506)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2025-03-31 10:58:46 +02:00
Jorge Martin Espinosa
bb97015e59 Add 'unencrypted room' badges and labels (#4445)
* Add 'unencrypted room' icon and label to composer

* Modify colors for room details screen info labels

* Add exception to Konsist's preview check

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2025-03-25 11:26:25 +00:00
Jorge Martin Espinosa
1659572950 Update SDK version to 25.03.13 and fix breaking changes (#4406)
Breaking changes addressed:
* Make `MatrixClient.getNotificationSettings()` async, cache its result.
* Use `RoomInfo` for accessing the updated room's info.
* Refactor `MatrixRoom` so it always receives an initial `MatrixRoomInfo` value: this value will be used to make `MatrixRoom.roomInfoFlow` a `StateFlow` so we can assume the initial updated Room data will be present.
* Fetch encryption state when loading a room if it's unknown
2025-03-19 12:52:57 +01:00
Jorge Martín
ea13730601 Adjust the size of the verification icon in the room member list too
It was 24dp, it should be 20dp.
2025-03-17 10:14:40 +01:00
ElementBot
6dbb371ca2 Sync Strings from Localazy (#4421)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2025-03-17 09:54:03 +01:00
Jorge Martin Espinosa
96e34cb8ee Add user verification and verification state violation badges (#4392)
* Move `observeRoomMemberIdentityStateChange` and associated classes to `libs:matrixui` module so they can be reused

* Add `EncryptionService.getUserIdentity` method to retrieve not only if the user is verified or not, but in which state they are

* Fix `IdentityChangePresenter` after the previous changes

* Fix `withFakeLifecycleOwner` and add `testWithLifecycleOwner` helper

* Display verified badge in DM top app bar when possible

* Display a verification violation warning icon next to the 'People' item in room details screen

* Display either a verified badge or a verification violation warning icon next to the room members in the room member list screen

* Display either a verified badge or a verification violation warning and withdraw verification button in the room member profile.

Generic user profiles won't display verification state anymore since we can't easily track changes in it.

* Add preview for room member details screen with verification violation identity state

* Add verified and violation badge to the `Profile` list item in room details screen

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2025-03-12 12:22:53 +01:00
Jorge Martin Espinosa
b91933625c Implement user verification (#4294)
* Add support for starting verification of a user

* Add support for replying to incoming user verification requests

* Add reset recovery key button and previews to `ChooseSelfVerificationModeView`

* Add 'Profile' item in room details screen

* Update screenshots

* Remove `showDeviceVerifiedScreen` parameter from `NavTarget.UseAnotherDevice`

* Allow exiting the FTUE flow, which will close the app. The previous state will be restored when the app is reopened.

* When outgoing verification fails, move to the `Canceled` state. Then, when resetting the state machine state also reset the verification service.

---------

Co-authored-by: ElementBot <android@element.io>
2025-03-10 11:20:17 +01:00
bmarty
9456ee921d Sync Strings from Localazy 2025-03-10 00:28:38 +00:00
Benoit Marty
9ca6b188f1 Remove PreferenceText, replace by ListItem. 2025-03-05 17:25:35 +01:00
bmarty
7fca7d2b12 Sync Strings from Localazy 2025-03-03 00:29:16 +00:00
Benoit Marty
d44f5e563f Replace Material icons with Compound icons wherever it's possible 2025-02-26 22:19:19 +01:00
ElementBot
9733e79b60 Sync Strings from Localazy (#4298)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2025-02-24 09:14:29 +01:00
Benoit Marty
83ede0f774 Sync strings again.
Revert wrong change on Hungarian plurals.
2025-02-17 11:29:49 +01:00
bmarty
3dddd90d97 Sync Strings from Localazy 2025-02-17 00:30:17 +00:00
ganfra
ba07370dfa feature(room preview): Add option to forget room, improve the room preview screen for banned rooms.
Some internal refactoring was done too:
- Remove RoomInfo.isPublic to only use JoinRule.
- Also take into account restricted access rooms for previews.
2025-02-10 19:13:02 +01:00
Benoit Marty
0d6d74512f Use ElementTheme instead of MaterialTheme 2025-02-06 15:10:15 +01:00
Benoit Marty
1d5e78496c Do not rely on RoomAlias constructor to validate the Room alias, since there is no validation in release mode.
This is fixing the test in release mode.
2025-02-05 18:05:10 +01:00