1
0
mirror of https://github.com/element-hq/element-x-android.git synced 2026-10-23 18:49:00 +03:00

6071 Commits

Author SHA1 Message Date
Jorge Martin Espinosa
111731b09f Pass media captions as HTML to the media viewer (#7970)
* Pass media captions as HTML to the media viewer

`MediaInfo` and `GalleryInfo` carried the formatted caption as a `CharSequence`, which isn't a good fit for `Parcelable` classes. Some producers also passed the raw HTML body in that field, so the caption was rendered with its tags, and gallery messages didn't pass a formatted caption at all.

Replace `formattedCaption` with `htmlCaption: String?` and convert it to styled text in `MediaViewerPresenter`, using the same `HtmlConverterProvider` as the timeline. The converted captions are cached by HTML so page data equality stays stable across list updates.

* Pillify media captions in the media viewer

Move the `TextPillificationHelper` interface to `:features:messages:api` so the media viewer can use it, keeping `DefaultTextPillificationHelper` in the impl module. The fake moves to `:features:messages:test`.

`MediaViewerPresenter` now pillifies converted HTML captions before linkifying them, matching how captions are rendered in the timeline.

* Rename `TextPillificationHelper` to `TextPillificator`, also fix copyright notice.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 10:14:03 +02:00
Jorge Martin Espinosa
2a8ce3eff2 Allow getting notifications from other sessions in the same device (#7977)
This adds a feature flag, disabled by default, which disables the 'don't receive push notifications from other accounts used in this device' rule, which is useful in general, but problematic for testing.
2026-10-21 17:12:47 +02:00
Jorge Martin Espinosa
041d2474e6 Add pillification to the new timeline renderer (#7761)
* Add pillification to AnnotatedStrings too. Improve the regex matching too in `MatrixPatterns`

* Add a click action to mention pills
2026-10-21 17:12:14 +02:00
Benoit Marty
f9402bd3d7 Do not set up encryption on the client used to log in
The client used to log in was built with `autoEnableBackups(true)` and `autoEnableCrossSigning(true)`.
Its SDK initialization task (cross-signing bootstrap, key backup creation) could still be running
after it was closed, while the final client, which uses the same store, was doing the same work.
This led to duplicate key backups and lost cross-signing private keys on new accounts.

Only the final client now sets up the backup and the cross-signing.

Closes #7955

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-21 11:28:24 +02:00
Benoit Marty
228abb78dc Fix parameter name in FakeFfiClientBuilder.withSearchIndexStore
The parameter is named `key` in the SDK `ClientBuilder`. The mismatch was reported as a warning,
which failed the compilation of the unit tests since warnings are errors.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-21 11:28:24 +02:00
Benoit Marty
ffbb166c4a Merge pull request #7953 from element-hq/feature/bma/fixBlockedUsers
Fix blocked users not displayed after restart and list not refreshed after unblocking
2026-10-20 15:33:20 +02:00
Benoit Marty
463adaac20 Merge pull request #7964 from element-hq/sync-localazy
Sync Strings
2026-10-20 15:32:02 +02:00
ganfra
d39249e241 Merge pull request #7961 from element-hq/feature/fga/multi-account-user-status
Render user status of other accounts in settings
2026-10-20 13:53:57 +02:00
bmarty
bfde1cc8a6 Sync Strings from Localazy 2026-10-20 09:46:25 +00:00
Benoit Marty
b3c05db9a1 Merge pull request #7941 from element-hq/feature/bma/iterateNotificationSettings
Iterate on the Notification settings screen to match the design
2026-10-20 11:11:14 +02:00
Benoit Marty
ecfeba8fb9 Merge pull request #7952 from element-hq/feature/bma/duplicateSignIn
Iterate wording on duplicate sign in
2026-10-20 11:07:31 +02:00
ganfra
288c9df8a7 Render user status of other accounts in settings 2026-10-20 11:05:25 +02:00
ganfra
9326b0f0e6 Merge pull request #7951 from element-hq/feature/fga/select-room-suggestions
Add room suggestions when forwarding content
2026-10-16 17:40:18 +02:00
Benoit Marty
cf146fc290 Add link to the SDK issue about the ignored users list at startup
The fetch of the ignored users list from the server at startup is a workaround for an SDK issue, link it so that it
can be removed once the issue is fixed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-16 17:22:10 +02:00
Benoit Marty
2302ea76c3 Fix blocked users not displayed after restart
The SDK emits its in-memory ignored users list as soon as we subscribe to it. This list is empty until the account data
is received by the sync, which usually does not happen after a restart since the account data has not changed. This
empty list was overriding the list fetched from the server, so the blocked users entry was hidden in the settings, and
the blocked users list was not updated when unblocking a user.

Subscribe first and then fetch the list from the server, and keep the subscription alive even if the fetch fails.

Fixes #7725, #7726

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-16 16:56:55 +02:00
Benoit Marty
96ce057f48 Update wording of already signed in error. 2026-10-16 16:16:04 +02:00
ganfra
c08074f632 Add room suggestions when forwarding content 2026-10-16 16:01:32 +02:00
Benoit Marty
8972098b4f Merge pull request #7935 from element-hq/feature/bma/fixBadRoomId
Fix invalid room id built from thread notification tags
2026-10-15 23:05:18 +02:00
Benoit Marty
4aa9f82761 Improve preview of NotificationSettingsView 2026-10-15 16:59:09 +02:00
ElementBot
4ebcf960ce Update Matrix Rust SDK to 26.10.14-nightly (#7930)
* Update Matrix Rust SDK to 26.10.14-nightly

* `withSearchIndexStore` now uses `key` instead of passphrase

* Fix `RustMatrixClient` now returning `searchIndex` size too

---------

Co-authored-by: Jorge Martín <jorgem@element.io>
2026-10-15 16:47:56 +02:00
Jorge Martin Espinosa
287001f9aa Prevent foreground backfill from running when the app is active (#7932)
* Prevent foreground backfill from running when the app is active

This should be a background task, since it can severely degrade performance if the app is in use while it runs.

The worker won't run any more if the app is in foreground and will stop running if it was in background and now it's in foreground.

* Fix return inside `withTimeout`

Co-authored-by: Benoit Marty <benoitm@element.io>

* Remove initial delay: it shouldn't be necessary if the foreground state of the app is checked when the worker starts

Instead, if the app was in foreground, cancel the work and retry in 5 minutes.

---------

Co-authored-by: Benoit Marty <benoitm@element.io>
2026-10-15 16:09:09 +02:00
ganfra
8689961f0d Merge pull request #7936 from element-hq/feature/fga/fix-pill-rendering
Fix mention pill overflowing the end of the line when too wide
2026-10-15 15:16:57 +02:00
Benoit Marty
9ac71fd35d Fix room id parsing from notification tags
Thread notification tags have the form "roomId|threadId". clearReadRoomsNotifications
was building a RoomId from the whole tag, which is only validated in debug builds, so
in release an invalid room id reached RoomListService.room(). Add
NotificationCreator.getMessageNotificationRoomId(), the inverse of messageTag(), which
only keeps the part before '|' and checks it is a valid room id.

Also make RoomListServiceInterface.roomOrNull take a RoomId instead of a String.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-15 12:56:46 +02:00
ganfra
c27bbaa1f6 Fix mention pill overflowing the end of the line when too wide 2026-10-15 12:54:25 +02:00
Benoit Marty
a3fa7aeedd Merge branch 'develop' into feature/bma/otherAccountUnreadCount
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 20:15:02 +02:00
Benoit Marty
c19dfd1db6 Merge pull request #7901 from element-hq/feature/bma/mainThreadBlocking
Avoid blocking the main thread in several places
2026-10-14 16:39:14 +02:00
Benoit Marty
095fda3d9e Add MatrixClient.totalUnreadCountFlow() extension
Extract the logic to observe the total unread count of a MatrixClient, refreshed on each sync
heartbeat, to a shared extension and use it in HomePresenter and PreferencesRootPresenter.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 14:31:31 +02:00
Jorge Martin Espinosa
3ef59a8910 Don't log OkHttp binary bodies in debug builds (#7919)
This is mostly done when uploading bug reports and on one hand, it doesn't really make sense since the binary contents will be unreadable anyway, and on the other it also messes up with our debug tools, making debugging some issues harder.
2026-10-14 12:04:07 +00:00
Jorge Martin Espinosa
566eb1f4f3 Use local SDK library for EC native too (#7916)
When a local SDK AAR file is present, ignore the version needed by the Element Call Matrix library.

This allows us to test local SDK builds.
2026-10-14 11:14:38 +02:00
Jorge Martin Espinosa
241f8e67bd Fix side-effects when tapping on a link in the new renderer (#7906)
The case where we move the pointer once we've started the click on a link wasn't taken into account, so the click or long click gestures weren't canceled if the gesture ended up being a 'move' one.

Simplify the handler and make it more idiomatic too.
2026-10-14 11:13:59 +02:00
Jorge Martin Espinosa
8a5c50d2b8 Fix File.getSizeOfFiles() double counting some files (#7907)
The `File.length()` docs state:

> Returns the length of the file denoted by this abstract pathname. The return value is unspecified if this pathname denotes a directory.

On Android, it *seems* to currently have the right behaviour, summing up the size of its children, which made `File.getSizeOfFiles()` double-count the size of some directories.

To avoid this, and be able to control the actual behaviour no matter what future Android versions do, let's count those ourselves.
2026-10-14 11:13:14 +02:00
Jorge Martin Espinosa
213ed22cad Bump SDK bindings to 26.10.12-nightly (#7909)
* Bump SDK bindings to `26.10.12-nightly`

* Fix API breaks in SDK bindings

* Fix doc comment
2026-10-13 22:28:22 +02:00
Jorge Martin Espinosa
9cc5cf9a01 Add total unread notification count to home screen (#7891)
* Add total unread notification count to home screen

This will be calculated on each sync heartbeat (for now, using the state updates for the room list service).

* Simplify `counter` parameter logic

* Read the total unread count when the home screen is first displayed

---------

Co-authored-by: Benoit Marty <benoitm@element.io>
2026-10-13 10:58:07 +00:00
Benoit Marty
ffe8f4a14e Merge pull request #7900 from element-hq/feature/bma/settingsMainThreadJank
Fix animation glitches when opening the settings
2026-10-13 11:30:36 +02:00
ElementBot
092cded211 Update Matrix Rust SDK to 26.10.07-nightly (#7880)
* Update Matrix Rust SDK to 26.10.07-nightly

* Adapt to the new QR code login task API

`generate()` and `scan()` of `GrantLoginWithQrCodeHandler` and `LoginWithQrCodeHandler`
now return a task instead of suspending until the flow is over. Wait for the task to
complete, and cancel it if the coroutine is cancelled, so that the flow is also stopped
on the Rust side.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Add tests for the cancellation of the QR code login tasks

Check that cancelling the coroutine of the link new device handlers and of the QR code
login cancels the task returned by the SDK, so that the flow is stopped on the Rust side.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Fix import ordering in the link new device handler tests

ktlint expects the imports to be sorted in lexicographic order.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Benoit Marty <benoit@matrix.org>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-13 11:21:21 +02:00
Benoit Marty
3170ff4422 Remove useless Unit type. 2026-10-13 10:42:05 +02:00
Benoit Marty
d5780507c9 Make storeUserProfile main-safe instead of wrapping getUserProfile 2026-10-13 09:28:49 +02:00
Benoit Marty
6efb10df11 Write the push history off the main thread
The push history was written to the database synchronously, from the app coroutine scope which runs on the main thread, for every received push. Make PushHistoryService.onPushResult suspend and run all the database queries on the IO dispatcher.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 14:33:17 +02:00
Benoit Marty
9be2a31c5f Schedule the background search backfill off the main thread
Checking if the work is already scheduled does a blocking WorkManager query, which was done on the main thread at session start.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 14:33:16 +02:00
Benoit Marty
149dedcc03 Store the user profile off the main thread when it is updated by the SDK
Same issue as when refreshing the profile manually: the profile listener stored the profile (Base64 encoding and session database access) from the session coroutine scope, which runs on the main thread.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 14:33:16 +02:00
Benoit Marty
404c26c62e Fetch and map the thread list items off the main thread
The thread list subscription was launched in the room coroutine scope, which runs on the main thread, so the initial sync FFI call and the mapping of all the items and diffs were done on the main thread every time a room was opened.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 14:33:15 +02:00
Benoit Marty
23a79ad987 Merge pull request #7896 from element-hq/sync-localazy
Sync Strings
2026-10-12 13:56:43 +02:00
Benoit Marty
80578d799f Merge pull request #7882 from element-hq/feature/bma/multiAccountShareAtRoot
Keep the incoming share displayed when the current account is signed out
2026-10-12 11:19:49 +02:00
Benoit Marty
8912341439 Avoid database access on the main thread when opening the settings
`getUserProfile()` was storing the user profile (DB read, avatar Base64 encoding, DB write) on the caller
dispatcher, i.e. the main thread when called from a presenter, causing glitches in the screen transition.
- Run the whole `getUserProfile()` on the session dispatcher.
- Make `DatabaseSessionStore` main-safe by running the queries on the IO dispatcher.
- Do not refresh the profile twice from the settings screen.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 10:42:19 +02:00
bmarty
8100fa6555 Sync Strings from Localazy 2026-10-12 00:37:35 +00:00
Jorge Martin Espinosa
f12b9c77d5 Enable global search feature flag (#7890)
Enable the global search feature by default for all variants of the app
2026-10-09 15:24:29 +00:00
Benoit Marty
d29e4e5f0c Merge remote-tracking branch 'origin/develop' into feature/bma/multiAccountShareAtRoot
# Conflicts:
#	libraries/roomselect/impl/src/test/kotlin/io/element/android/libraries/roomselect/impl/RoomSelectPresenterTest.kt
2026-10-09 17:11:58 +02:00
Benoit Marty
00dab131dd Ask for session verification before sharing with an unverified account
The incoming share is now displayed on top of the root, so the FTUE, and the session verification in particular, could be bypassed.

- When the current account is not verified, wait for the FTUE to be complete before displaying the incoming share, as before.
- When the user selects another account which is not verified in the room select screen, display the session verification flow of
  the FTUE for this account on top of the share. As in the FTUE, the user has to verify the session or to sign out.
- Expose the FTUE session verification flow with a new SessionVerificationEntryPoint, displayed by OtherSessionVerificationNode
  which sets up the session graph of the account to verify.
- Introduce RoomSelectNavigator so that RoomSelectPresenter can request the verification of the selected session.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-09 17:00:48 +02:00
Benoit Marty
5d498ee37b Merge pull request #7883 from element-hq/feature/bma/roomSelectSearchField
Use a search field to filter the rooms in the room select screen
2026-10-09 15:09:50 +02:00
Benoit Marty
85224988af Room select: address review remarks
- Scroll the list to the top using a LaunchedEffect instead of recreating the LazyListState on each search query change.
- Use isBlank to check the search query, to match the logic of RoomSelectSearchDataSource.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-09 14:34:45 +02:00