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

2567 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
ganfra
a21ee3b9c4 Merge pull request #7978 from element-hq/feature/fga/multi-select-forward-fixes
Fixes few issues on timeline multi select and forwarding
2026-10-22 16:44:13 +02:00
ganfra
1d5ca7a55c Show a confirmation indicator after forwarding to multiple rooms 2026-10-21 20:45:08 +02:00
ganfra
bd0aeaef15 Center the selection indicator on the bubble with ConstraintLayout 2026-10-21 20:09:57 +02:00
ganfra
f01d8c91bb Resolve the timeline selection slide in the layout phase 2026-10-21 20:08:36 +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
bmarty
bfde1cc8a6 Sync Strings from Localazy 2026-10-20 09:46:25 +00: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
ganfra
05a587f3a4 Merge pull request #7925 from element-hq/feature/fga/timeline-multi-forward-keep-selection
Keep timeline selection when forwarding is cancelled
2026-10-16 16:05:25 +02:00
ganfra
c08074f632 Add room suggestions when forwarding content 2026-10-16 16:01:32 +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
ganfra
c27bbaa1f6 Fix mention pill overflowing the end of the line when too wide 2026-10-15 12:54:25 +02:00
ganfra
7fe10b32b0 Merge pull request #7905 from element-hq/feature/fga/timeline-multi-forward-ay11
Improve accessibility of timeline selection mode
2026-10-14 18:56:38 +02:00
ganfra
47f95a422c Remove unused imports in MessagesFlowNode 2026-10-14 18:09:00 +02:00
ganfra
7fb62cd49f Keep timeline selection when forwarding is cancelled 2026-10-14 18:09:00 +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
4b97d6ab96 Disable location sharing when no MapTiler config is available
LocationService now exposes the MapTiler config to use: the one provided by the
homeserver takes precedence over the build time one, and null means that no map
provider is configured. It is now session scoped, and isServiceAvailable()
returns a StateFlow derived from this config.

When no config is available:
- the location sharing option is hidden from the composer, and location events
  cannot be opened in the location viewer;
- the "Location sharing" entry is hidden from the settings;
- location events in the timeline render a placeholder, without performing any
  request to MapTiler.

The show and share location screens now get the config from LocationService
rather than fetching the homeserver config by themselves.

Closes element-hq/element-android-enterprise#69

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-13 17:15:37 +02:00
ganfra
9e12ec7505 Improve accessibility of timeline selection mode 2026-10-13 14:45:00 +02:00
Benoit Marty
6049f25a3e Create the LocalMedia off the main thread when picking or sharing media
LocalMediaFactory.createFromUri queries the ContentResolver and can decode the media, it was called on the main thread from the picker callbacks and when sharing a file.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 14:33:18 +02:00
bmarty
8100fa6555 Sync Strings from Localazy 2026-10-12 00:37:35 +00:00
Jorge Martin Espinosa
d8a072755f Add edit and redaction send state support (#7840)
* Expose edit/redaction send states and retry/abort send from the Rust SDK

Pending edits and redactions have their own send queue entries, separate
from the original event. Surface them so the UI can reflect and act on them:

- Add `SendTarget` (Event, Edit, Redaction, Reaction) to the matrix API,
  with a mapper to the Rust SDK type.
- Add `editSendState` and `redactionSendState` to `EventTimelineItem` and
  map them from the SDK item.
- Add `Timeline.retrySend` / `Timeline.abortSend`, which take a `SendTarget`
  so the right queued request is retried or removed. Implement them in
  `RustTimeline` and in `FakeTimeline`.

* Track edit and redaction send states on timeline events

`TimelineItem.Event` now carries `editSendState` and `redactionSendState`
next to `localSendState`.

- `failedToSend` is true when any of the three states is failed, so a
  failed edit or redaction is shown like a failed message.
- `pendingSend()` returns the first pending state together with its
  `SendTarget`; the read receipt row, the send failure dialog and the
  timeline presenter use it instead of reading `localSendState` directly.
- `TimelineItemReadReceiptView` is restructured so the row is only
  rendered when there is something to show, and the send state takes
  precedence over read receipts.
- Update the previews provider and test fixtures for the new fields, and
  make `aMessageEvent`'s send state nullable.

* Retry and remove failed sends through the timeline

Retrying or removing a failed message used the event's `SendHandle`, which
only knows about the original send. Route both through the timeline with
the `SendTarget` of the pending request instead:

- `TimelineController` gains `retrySend` (which also re-enables the send
  queue) and `abortSend`, acting on the current timeline.
- `MessagesPresenter` retries via `retrySend`, and does nothing when the
  event has no pending send state.
- Redacting something that was never sent (no event ID) or a pending
  edit/redaction now aborts the queued request rather than sending a
  redaction, and no confirmation is asked for.
- Update the presenter tests accordingly.

* Log send queue errors

Log when the SDK reports a send queue error for a room, and when the
send queue is disabled, to help diagnose messages stuck in the queue.

* Make sure we display send queue errors before verification states

* Fix logic for displaying read receipts and add more screenshot tests

* Only use states with read receipts in `ReadReceiptBottomSheetStatePreviewParam`

* Handle `LocalEventSendState = null` state just like `LocalEventSendState.Sent`

* Add `TimelineItemAction.AbortSend` and use it for both:
  1. Aborting sending a message/edit/redaction from the 'sending failed' dialog.
  2. Abort sending a local message when selected from the timeline -> redact action.

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2026-10-09 10:30:52 +02:00
Jorge Martin Espinosa
1564de9b6e Iterate on unread counts again (#7869)
* Fix timestamp color to match the designs.

* Don't limit the call and unread row height to 16dp: the font size is not fixed and it might display components in a broken state

* Ensure the alignment works

* Remove `SemanticColors.unreadIndicator` and use `.iconAccentPrimary` and `.textActionAccent` instead

* Simplify and document `UnreadIndicatorAtom`

* Use `fontBodySmMedium` for the font size in the unread indicator

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2026-10-09 08:30:43 +02:00
ganfra
c4173ae185 Fix the row selection documentation about sliding content 2026-10-08 17:42:08 +02:00
ganfra
512bab05a6 Merge branch 'develop' into feature/fga/timeline-multi-forward 2026-10-08 17:38:14 +02:00
ganfra
2cda8a0315 Merge pull request #7851 from element-hq/sync-localazy
Sync Strings
2026-10-06 13:30:00 +02:00
Benoit Marty
ac2b76de61 Merge pull request #7859 from element-hq/feature/bma/fixPackageNames2
Fix remaining package names and namespaces not matching their module
2026-10-06 13:13:39 +02:00
Benoit Marty
08a0885cfc Merge pull request #7821 from element-hq/bma/removeUnusedDependencies
Remove unused Gradle dependencies
2026-10-06 12:23:32 +02:00
Benoit Marty
fe8b3764e5 Move matrixmedia sources to the libraries.matrixmedia.* packages
The matrixmedia modules were using the `libraries.matrix.ui.media` package
(shared with the matrixui module) and `libraries.matrix.ui.media.*`
namespaces. Use `libraries.matrixmedia.api`, `libraries.matrixmedia.impl`
and `libraries.matrixmedia.test` instead, matching the module paths.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-06 12:10:14 +02:00
Benoit Marty
902631362e Merge pull request #7858 from element-hq/feature/bma/fixPackageNames
Fix wrong package names and namespaces in several modules
2026-10-06 10:58:25 +02:00
ganfra
752b0c59b6 Move the composable lambda parameter last in TimelineItemRowContent 2026-10-05 20:48:35 +02:00
ganfra
cb501f3b5f Fix the Detekt issues on the timeline selection code 2026-10-05 20:48:24 +02:00
ganfra
9b2dcd4b26 Fix the Konsist preview naming for the selection previews 2026-10-05 20:48:14 +02:00
ganfra
d4310cb6e9 Use toImmutableSet instead of toPersistentSet 2026-10-05 20:48:05 +02:00
ganfra
7ef93b51e4 Use the Element Creations license header on the new selection files 2026-10-05 20:47:57 +02:00
ganfra
5ab9860e89 Merge branch 'develop' into feature/fga/timeline-multi-forward 2026-10-05 17:54:00 +02:00
Benoit Marty
ab20281b26 Fix wrong package names and namespaces in several modules
Some modules were using package names or namespaces inherited from copy-paste
or from older module names (e.g. `features.logout.impl` in the deactivation
module, `features.api` in the migration api module, `sessionstorage` in the
cachestore module), or containing typos (`roomaliasesolver`,
`roomdetetailsedit`).

Move the sources to the package matching their module, update the imports, and
rename the impacted screenshots accordingly.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 13:43:22 +02:00
Benoit Marty
b9ed090400 Use only ClipboardHelper to copy to the clipboard, and do not render feedback on Android 13+
Since Android 13, the system displays its own confirmation when content
is copied to the clipboard, so the application does not render its own
Toast or Snackbar anymore on those versions.

Context.copyToClipboard, CopyToClipboardUseCase and the direct
ClipboardManager usage in EventDebugInfoView are removed.
ClipboardHelper.copyPlainText(text, isSensitive, onSuccessOnOldDevice)
is now the only entry point, and AndroidClipboardHelper is the only
class using ClipboardManager.

Copy actions from the views are moved to their Presenter through new
events, or to the Node when there is no Presenter. A ToastHelper is
introduced so that Toasts are kept where they were used before.
Snackbars are kept where they were already used.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 11:40:08 +02:00
bmarty
50460ad031 Sync Strings from Localazy 2026-10-05 00:40:51 +00:00
ganfra
e99861a5c1 Keep selection mode active until explicitly exited 2026-10-02 20:41:04 +02:00
Benoit Marty
954eb731e7 Remove unused Gradle dependencies
Remove dependencies flagged as unused by the Dependency Analysis Gradle Plugin
(`./gradlew buildHealth`) and explicitly declared in module build files.

Removals were skipped when the dependency provides transitively something the
module (or a consumer of an `api` dependency) uses directly, as well as for
runtime-only dependencies (element-call-embedded, sentry-android,
rustls-platform-verifier). Dependencies added by the convention plugin helpers
(composeDependencies, testCommonDependencies) are left untouched.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 15:47:48 +02:00
Jorge Martin Espinosa
2dd0a47eb4 Allow displaying only unread notifications (#7803)
* Allow displaying only unread notifications

Add `FeatureFlags.ShowAllActivityInRoomList` (enabled by default, to match the current behavior) that, when disabled, will display the unread messages of a room instead of unread notifications if no unread notifications are found

* Restore UI changes to the badges, `RoomSummaryRow` and `HorizontalFloatingToolbar`

* Fix `NavigationBarIcon`: use `BadgeBox` component.

* Adjust padding in `RoomSummaryRow` to 6.dp

* Fix other indicators not displaying a dot anymore

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2026-10-01 19:46:01 +02:00
ganfra
2d30dc6cf0 Merge branch 'develop' into feature/fga/timeline-multi-forward 2026-10-01 15:23:42 +02:00
ganfra
ae409aa8d2 Add preview for messages view in selection mode 2026-09-30 11:49:26 +02:00
ganfra
bb64983832 Move TimelineItemSelectionData to model package 2026-09-30 11:48:31 +02:00
Benoit Marty
4c4389b29a Remove unnecessary Material3 experimental opt-ins
Many Material3 APIs are now stable, so the `ExperimentalMaterial3Api` and `ExperimentalMaterial3ExpressiveApi`
opt-ins are not required anymore at those places. Also remove the propagating `@ExperimentalMaterial3Api`
marker from `TopAppBarScrollBehaviorLayout`, which does not use experimental API anymore.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-29 18:45:30 +02:00
ganfra
193a5b1dbc Merge branch 'develop' into feature/fga/timeline-multi-forward 2026-09-29 17:15:40 +02:00
ganfra
69a1870f58 Use existing strings 2026-09-29 16:35:33 +02:00
ElementBot
c8c242476b Sync Strings (#7787)
* Sync Strings from Localazy

* Update screenshots

---------

Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2026-09-28 11:32:40 +02:00
ganfra
d8b6694575 Apply ktlint formatting 2026-09-25 18:50:51 +02:00
ganfra
971f196d54 Intercept clicks on every row in selection mode 2026-09-25 18:48:58 +02:00