Commit Graph

560 Commits

Author SHA1 Message Date
Benoit Marty
a77662421c Add support for slash commands (under Feature Flag) (#6482)
* Add support for slash commands

* Update screenshots

* Rename module `slash` to `slashcommands`

* Rename `SlashCommand` to `SlashCommandService`

* Introduce MsgType in order to send text message with a different msgtype value.

* Format file and add parameter names, add default values and cleanup

* Add isSupported parameter to filter out unsupported yet commands.

* Slash commands: disable suggestions if the feature is disabled.

* Fix sending shrug command.

* Add missing test on SuggestionsProcessor

* Add tests on MessageComposerPresenter about slash command.

* Fix import ordering

* Add missing tests on CommandExecutor

* Add missing tests in MarkdownTextEditorStateTest

* Slash commands: Improve code when sending message with prefix.

* Slash commands: Add support for /unflip

---------

Co-authored-by: ElementBot <android@element.io>
2026-04-02 16:15:32 +02:00
Benoit Marty
1682ae88e7 Rename our classes too. 2026-03-04 17:41:44 +01:00
Jorge Martin Espinosa
9c8757e38b Use ShareIntentHandler early to avoid distributing the whole intent (#6274)
* Use `ShareIntentHandler` early to avoid distributing the whole intent

This would make the intent be serialized as part of `NavTarget` and could potentially lead to `TransactionTooLargeException`s.

We now pass a new `ShareIntentData` class around, containing the minimum amount of data needed. We also have a new `OnSharedData` post-processor to revoke uri access after they've been shared.

* Move `UriToShare` next to `ShareIntentData` and add docs
2026-03-03 13:12:33 +00:00
Jorge Martin Espinosa
7ed111d0df Remove runBlocking call to restore sessions when the app starts (#6193)
* Remove `runBlocking` call to restore sessions when the app starts

Sadly, to do this we need to manually handle restoring the state from Appyx using internal values. At least it doesn't seem like they're going to change any time soon (or ever).

This should take care of a few ANRs, although it may make loading the initial state a bit slower

* Add `ReplaceAllOperation` for state restoration

* Add warning comment for Appyx dependency
2026-02-24 09:51:43 +00:00
Jorge Martin Espinosa
ba75927d72 Limit the max number of opened rooms in the backstack (#6215)
* Limit the max number of opened rooms in the backstack

This should help with the `TransactionTooLargeExceptions` we were seeing, since every one of these nodes and their sub-nodes would be saved to the instance state.

Also, make sure we use `LoggedInFlowNode.attachRoom` as much as possible to ensure this check is used
2026-02-18 08:34:25 +01:00
ganfra
c17c1bf052 Use fade animation when replacing Placeholder 2026-02-17 12:23:35 +01:00
Benoit Marty
83fee6d9ba Remove NavigationState.Space.
We do not have the concept of current space.
2026-02-11 20:41:55 +01:00
ganfra
9641d3ef4f Add tests and clean code after RoomList Filter rework 2026-01-30 15:33:51 +01:00
Jorge Martin Espinosa
4b4492681b Add an empty state for the space screen if the user can modify its graph (#6064)
* Add an empty state for the space screen if the user can modify its graph. It adds a new 'create room' button that allows you to open the create room screen with some preset values.

* When computing the editable spaces in `ConfigureRoomPresenter`, also set up the initial selected parent space if possible

* Use `Builder` pattern for `CreateRoomEntryPoint`

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2026-01-27 11:12:12 +01:00
Jorge Martin Espinosa
f7bfcedd57 Try fixing performance metrics (#6046)
We've detected outliers in the `Up-to-date room list` and `Open a room` transactions in Sentry.

This commit tries to make sure we're starting/stopping the long running transactions when needed.
2026-01-26 15:41:58 +01:00
Benoit Marty
534b4d16c3 CrashDetectionEvents -> CrashDetectionEvent 2026-01-19 18:19:20 +01:00
Benoit Marty
dca227d3d7 RageshakeDetectionEvents -> RageshakeDetectionEvent 2026-01-19 18:17:58 +01:00
Jorge Martin Espinosa
03d14087e6 Create spaces (#5982)
* Allow creating a space with `CreateRoomParameters`

* Add 'Create space' menu item in the spaces home screen. Also, imports new strings related to spaces.

* Link the 'Create space' button with the screen to create the space

* Unify room access and visibility for `ConfigureRoom`, use the updated design

* Fix `EditRoomDetails` avatar size (68dp)

* Replace `EditableAvatarView` and `UnsavedAvatar` copmonents with `AvatarPickerView`

* `AvatarDataFetcherFactory`: Make sure we use a fallback image fetcher when the URL is not an MXC one (a local one, i.e.). This removes the previous need for a separate `UnsavedAvatarView`

* Use `AvatarPickerView` in all the screens where `EditableAvatarView` was used

* Improve naming and previews

* Update strings, remove unused ones for `RoomAccessItem`

* Make `isSpace` part of the `CreateRoomConfig`

* Ensure the content fits in the screenshots for `AvatarPickerSizesPreview`

* Add `AvatarDataFetcherFactoryTest`

* Add new feature flag for creating spaces

* Fix ripple being too large for the `Pick` state

* Tweak margins and section titles a bit

* Add preview for `HomeTopBar` with the spaces case

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2026-01-13 14:35:49 +01:00
Jorge Martin Espinosa
a234eb3e29 When handling incoming share, reuse existing room screen if possible (#6001) 2026-01-13 13:39:46 +01:00
Jorge Martin Espinosa
71031008dd Adjust metrics to the new specifications (#5937)
* Add `AnalyticsTransactions` with a set of `TransactionDefinition` items matching those in the user story

* Use that for `AnalyticsLongRunningTransactions`, make sure we send the right fields (name, operation, description)

* Add `AnalyticsSendMessageWatcher` to track how long it takes for an event to be sent and for us to get a call back for that from sync

* Add `Noop` implementation for enterprise
2026-01-05 16:23:26 +01:00
Benoit Marty
65c17eacc6 Merge pull request #5909 from element-hq/feature/bma/qrCodeLogin
Link new device using QrCode - First version
2025-12-18 16:08:21 +01:00
Jorge Martín
7fe3b18699 Distinguish between indexable and non-indexable extra data 2025-12-18 14:08:38 +01:00
Jorge Martín
5c6fee08fd Fix tests 2025-12-18 14:08:38 +01:00
Jorge Martín
18482a99e3 Add AnalyticsUserData, with keys for several extras we want to upload to Sentry.
Add the `HOMESERVER` extra, with a hashed homeserver value. This is only so we can identify devices using a problematic HS (like matrix.org under heavy load).
2025-12-18 14:08:38 +01:00
Benoit Marty
fd446e98dd Link new device using QrCode. 2025-12-16 16:14:04 +01:00
ElementBot
6880cf518c Sync Strings from Localazy (#5904)
Co-authored-by: bmarty <3940906+bmarty@users.noreply.github.com>
2025-12-15 23:51:19 +01:00
Jorge Martin Espinosa
aaf788b448 Fix crash when calling Room.predecessorRoom when the room is destroyed (#5894)
* Fix crash when calling `Client.predecessorRoom` when the room is destroyed

* Handle the root cause of this crash: destroying the room on activity recreation
2025-12-15 10:25:08 +01:00
Jorge Martin Espinosa
77be19bf3b Load JoinedRoom in home screen, pass it to the room flow (#5817)
* Load `JoinedRoom` in `HomeFlowNode.navigateToRoom`, then pass it to the next navigation nodes

* Add delayed loading indicator for cases when loading the room takes too long

* Avoid an extra FFI call in `RustRoomFactory`.

Use `RoomInfo.membership` instead.

Also use `computation` dispatcher, since it should reduce the delay when switching contexts.

* Remove the dispatcher usage when loading the room in `HomeFlowNode`, we immediately call a method that changes the dispatcher used

* Make sure only a single room is opened at a time
2025-12-02 15:22:55 +00:00
Jorge Martín
29117ce93d Add AnalyticsService.cancelLongRunningTransaction and AnalyticsService.finishLongRunningTransaction 2025-11-28 14:15:54 +01:00
Jorge Martín
884c547123 Extract from_notification extra to a constant in IntentNavigationExtras
Allow `IntentProvider` to receive extras and `PendingIntentFactory` to send them.
2025-11-28 14:15:54 +01:00
Jorge Martín
71bfffe58f Move analytic watchers to :services:analytics 2025-11-28 14:15:54 +01:00
Jorge Martín
27d376806c Add tests for DefaultAnalyticsColdStartWatcher 2025-11-28 14:15:54 +01:00
Jorge Martín
93feed38bf Add transaction trees for opening a room so we can have a nice trace view 2025-11-28 14:15:54 +01:00
Jorge Martín
2a011bf072 Add OpenRoom long running analytic transaction 2025-11-28 14:15:54 +01:00
Jorge Martín
c0e66e9d49 Add another performance check for cold start time until the cached room list is displayed 2025-11-28 14:15:54 +01:00
Jorge Martín
5681d7c611 Add a performance check for notification tap -> populated timeline time 2025-11-28 14:15:54 +01:00
Jorge Martín
1b868e73c7 Add a 'warm' room list performance check:
We want to measure how long it takes the SDK to update the room list when the app comes back from being in background.

Note we don't want to check this in cold starts, only warm ones.
2025-11-28 14:15:54 +01:00
Benoit Marty
24b76f2001 Fix crash when clicking fast on back key on the Add account screen. 2025-11-21 15:51:11 +01:00
Benoit Marty
45fe9cfc97 Fix navigation issue once incoming share is handled 2025-11-19 23:05:49 +01:00
Jorge Martin Espinosa
c6c2f4a267 Add some performance metrics for Sentry (#5760)
- Add `AnalyticsService.startTransaction(...)` to start a logging transaction that can be uploaded to Sentry if the user enabled the analytics upload.
- Add `AnalyticsTransaction` wrapper to abstract the Sentry ones.
- Added several helper methods to improve the UX around these transactions.
- Then measure:
  - Time until the first sync, and how it ended.
  - Time until the first rooms are displayed.
  - Time to load a room or a preview.
  - Time to load a timeline.
2025-11-19 11:42:55 +00:00
Benoit Marty
de2ab5a557 Merge pull request #5722 from element-hq/feature/bma/moduleCleanup
Module cleanup
2025-11-18 16:14:10 +01:00
Benoit Marty
13854bb2c7 Ensure that disabling (resp. enabling) notification unregisters (resp. registers) the pusher 2025-11-13 17:50:21 +01:00
Benoit Marty
b3ec256dfa API modules do not need to setup dependency injection.
Move the implementation to the impl modules.
2025-11-12 19:05:39 +01:00
Benoit Marty
185d4fadde Let notifications use avatar fallback.
Extract code which handles Matrix image to its own api / impl / test modules.
2025-11-12 11:28:42 +01:00
Benoit Marty
1292da2a72 Copyright: Add Element Creations Ltd. copyright 2025-11-10 11:05:05 +01:00
Benoit Marty
b748fcc631 Copyright: Add final period 2025-11-10 10:13:41 +01:00
Benoit Marty
0a0224b586 Copyright: run command uv run license-editor --repository ../element-x-android 2025-11-10 10:09:26 +01:00
Benoit Marty
cf19daf3a4 Rename handleEvents to handleEvent 2025-11-07 12:21:43 +01:00
ganfra
a33d4e8b42 Merge pull request #5668 from element-hq/feature/fga/space_settings
Space : prepare Space Settings screen
2025-11-05 16:18:09 +01:00
Benoit Marty
0367ae610c Session database: use the new count API. 2025-11-04 15:30:29 +01:00
Benoit Marty
c13fafd836 Merge pull request #5669 from element-hq/fix/forward-events-from-pinned-media-timeline
Fix forward events from media viewer from pinned media timeline
2025-11-04 09:52:01 +01:00
Benoit Marty
5b18f6f93e Code cleanup 2025-11-03 15:53:31 +01:00
Benoit Marty
876f692f3f Rename MessagesEntryPointNode to MessagesEntryPoint.NodeProxy for consistency. We already have a NodeProxy. 2025-11-03 15:17:27 +01:00
ganfra
1ff48467c6 Merge branch 'develop' into feature/fga/space_settings 2025-11-03 15:02:28 +01:00
Jorge Martín
0bed2ae386 Use the new fromPinnedEvents parameter in JoinedRoomLoadedFlowNode through TimelineBindings 2025-11-03 14:44:29 +01:00