Commit Graph

2552 Commits

Author SHA1 Message Date
ganfra c27bbaa1f6 Fix mention pill overflowing the end of the line when too wide 2026-10-15 12:54:25 +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
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
ganfra 0a11e88f06 Align the selection indicator with the message bubble 2026-09-25 18:48:58 +02:00
ganfra f4399a392b Use a Checkbox for the timeline selection indicator 2026-09-25 18:47:48 +02:00
ganfra cec42ae4e6 Enter selection mode from the Forward action 2026-09-25 18:47:28 +02:00
ganfra a0bfdd379c Pass a list of event ids to the forward screen 2026-09-25 18:47:17 +02:00
Jorge Martin Espinosa 306e1cb950 Upgrade SDK bindings to v26.09.26 (#7780)
* Bump SDK bindings to `v26.09.26`

This version contains a fix for issues in `v26.09.25` related to certificate verification.

* Fix breaking API changes in the latest bindings

* Unify `FeatureFlags.RoomThreadList` with `FeatureFlags.Threads`
2026-09-25 16:08:19 +02:00
Benoit Marty 3cafaaec94 Update remove message confirmation dialog.
Closes #7753
2026-09-23 14:25:37 +02:00
Benoit Marty 9b3d4c7c27 Merge pull request #7736 from element-hq/sync-localazy
Sync Strings
2026-09-22 14:45:58 +02:00
Jorge Martin Espinosa bec3780c9c Fix forwarding an event not working in threads (#7743)
* Fix forwarding an event not working in threads

Add the `TimelineProvider` for the event to the navigation flow so the events can be fetched from the right timeline.
2026-09-22 10:59:12 +02:00
Jorge Martin Espinosa 4e47c6170e Integrate the new timeline renderer behind a feature flag (#7722)
* Integrate the new renderer with the timeline UI

* Composable functions are now in `:libraries:htmlrenderer:api` so we don't need to add `impl` to other modules.

* Improve inline code span

* Return both the text and URL in `onLinkClick` and `onLinkLongClick` so we can check the URL is not misleading

* Remove `SelectionContainer` for now - it creates issues when long pressing

* Make `LocalComposeTimelineEventRenderer` contain a `ComposeLocalTimelineEventRendererData` instance. This checks if the new rendering is enabled and what is the current user id so it can be used for styling mention pills

* Add fading edges to code block to indicate scrolling is possible

* Long pressing in a code block copies its contents to the clipboard

* Fix alignment of ordered list item prefixes

* Don't use default values in State data classes

---------

Co-authored-by: ElementBot <android@element.io>
2026-09-22 10:26:35 +02:00
bmarty d1e0544102 Sync Strings from Localazy 2026-09-21 00:54:07 +00:00
ganfra b54937793f Merge branch 'develop' into sync-localazy 2026-09-18 10:39:43 +02:00
bxdxnn 5cac4767f1 Add smooth animation to voice messages play progress (#7698)
* Add linear animation to voice message playback progress

Instead of animating the small `progress` value changes, calculate an animation for the range `maxProgress - progress`, with a linear interpolator so it's completely smooth. Previously, the progress was updated in 'steps' that were quite noticeable.
2026-09-18 09:39:15 +02:00
Jorge Martin Espinosa c0bb68c872 New timeline event renderer: add new modules (#7721)
* Added HTML parser to abstract tree nodes

* Add HTML renderer using `HtmlMessageContent`

* Add custom rendering for inline code nodes besides the monospace font

* Support `<s>` and `<strike>` too

* Add `ContentAvoidingLayoutData` support

* Improve the last block node behaviour and its integration with `ContentAvoidingLayout`

* Move `ContentAvoidingLayout` to `:libraries:ui-common` so it can be shared

* Add missing `:libraries:htmlrenderer:impl` entry in `DependencyHandlerScope.allLibrariesImpl`

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2026-09-17 19:08:32 +02:00
ganfra 51c06b4bec Timeline : initial multi-select state 2026-09-17 14:49:03 +02:00
Benoit Marty 58a00fd4e5 Merge pull request #7679 from element-hq/feature/bma/messageDeletionConfirmation
Let the user give an optional reason when removing a message
2026-09-16 16:37:51 +02:00