Commit Graph

97 Commits

Author SHA1 Message Date
Jorge Martín
e06bacbff3 Redo DI gradle setup code 2025-09-04 16:49:20 +02:00
Jorge Martín
fc3153bd26 Fix lint issues and restore commented out code 2025-09-04 16:49:18 +02:00
Jorge Martín
92a4b8b66b Start migrating Anvil KSP to Metro 2025-09-04 16:48:34 +02:00
Jorge Martin Espinosa
285066c206 Threads - first iteration (#5165)
* Initial threads support: parse `ThreadSummary`.

Replace several `isThreaded` values with `EventThreadInfo`, which contains the info about the event either being the root of a thread or part of it.

* Add `Threaded` timeline mode

* Add a `liveTimeline` parameter to `TimelineController`'s  constructor. This way we can customise which timeline will be used as the 'live' one. Also add `@LiveTimeline` DI qualifier for the actual live timeline of the room.

* Create `ThreadedMessagesNode`. Allow opening a thread in a separate screen.

* Add the callbacks for the list menu actions - even if they're the wrong ones and will send the data to the room instead

* Send attachments and location in threads

* Fix polls in threads, add support for sending voice messages in threads

* Display thread summaries only when the feature flag is enabled

* Use 'Reply' instead of 'Reply in thread' when in threaded timeline mode

* Remove incorrect usage of `Timeline` in `MessageComposerPresenter`. This led to replies to threaded events not appearing as actual replies.

---------

Co-authored-by: ElementBot <android@element.io>
2025-08-19 13:35:48 +00:00
Benoit Marty
75b4a4ba9d Suppress deprecation warning for test. 2025-08-12 15:52:08 +02:00
renovate[bot]
58e1503e61 Update dependency org.matrix.rustcomponents:sdk-android to v25.7.23 (#5073)
* Update dependency org.matrix.rustcomponents:sdk-android to v25.7.23

* Adapt to SDK changes:

- Add 'creator' role, adapt existing logic to it.
- Remove `ReplyParameters`, replace with `EventId` where possible.
- Fix changes in OIDC auth methods.
- Add more join rules.

* Make sure both creators and users with power level >= 150 are displayed as 'owners' in the room member list.

* Don't close the roles and permissions screen if the user is a creator

* Use `MediaPreviewValue.DEFAULT` for `MediaPreviewConfig.DEFAULT` too

* Improve APIs around checking roles and power levels:
    - Ensure `RoomInfo.RoomPowerLevels.users` can't be directly used to check power levels since it can't check the power levels for creators.
    - Add a few helper functions to handle actions that relied on the previous `users` property, and docs to explain their usages.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2025-07-24 11:58:30 +02:00
Benoit Marty
584aaa6fe4 Fix typo 2025-07-17 15:14:49 +02:00
Benoit Marty
e3f07a1273 Remove blank line 2025-07-16 11:23:42 +02:00
Benoit Marty
9dbb2634ab FAB: iterate on design 2025-07-16 10:11:53 +02:00
Benoit Marty
4afc20798c [a11y] Ensure that heading() is applied to all screen titles. 2025-07-04 12:15:42 +02:00
renovate[bot]
31bb1848e4 fix(deps): update dependency org.matrix.rustcomponents:sdk-android to v25.6.18 (#4894)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2025-06-18 15:10:47 +00: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
Benoit Marty
caf25894d6 Reduce API of JoinedRoom, caller must use the Timeline API from liveTimeline instead. (#4731)
This removes lots of boilerplate code.
2025-05-20 09:07:43 +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
Jorge Martin Espinosa
60ef6c6d89 Fix the share location URI (#4544)
* Fix the share location URI

Use `ENGLISH` locale to make sure the coordinates are formatted using the right decimal separator.

Also, when no label parameter was added, the URI just centered the map on some coordinates, instead of adding a marker.
2025-04-07 11:56:25 +02:00
Benoit Marty
87fd1372a9 Element config (#4471)
* Add handy extension "VariantDimension.buildConfigFieldStr"

* Update configuration for MapTiler.

* Update configuration for Sentry.

* Build AnalyticsConfig depending on analytics configuration.

* Configure analytics policy url.

* Add handy extension "VariantDimension.buildConfigFieldBoolean"

* Configure legal urls.

* Add a way to disable rageshake / reporting bugs.

* Update screenshots

* Quality

* Fix test

* Use `ifBlank` extension

* Add missing configuration for PostHog

* Update configuration for Rageshake.

* Add build log.

* Disable crash detection if rageshake feature is not available.
Disabled twice.

* Hide link to analytics policy if the link is missing.

* Fix test when run in enterprise context.

* Use RageshakeFeatureAvailability where appropriate.

* Rename file.

* Move some classes to their correct module.

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2025-03-27 11:25:04 +01:00
Benoit Marty
f0a6a0037c Let element enterprise be able to configure id for mapTiler. (#4446)
* Let element enterprise configure the ids for maptiler service.

* Disable location sharing and location viewer is the service is not available.

* Fix compilation issue on connected test

* Do not allow to reload the map if the mapId is not available.

* Update screenshots

* Rename file.

* Better to inject a string provider here, so we can unit test DefaultLocationService.

---------

Co-authored-by: ElementBot <android@element.io>
2025-03-21 17:06:52 +01:00
Benoit Marty
d44f5e563f Replace Material icons with Compound icons wherever it's possible 2025-02-26 22:19:19 +01:00
Benoit Marty
05fc76822a Apply dual licenses: AGPL + Element Commercial to file headers.
2 replace all actions have been performed:
- "SPDX-License-Identifier: AGPL-3.0-only" to "SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial"
- "Please see LICENSE in the repository root for full details." to "Please see LICENSE files in the repository root for full details."
2025-01-07 10:05:04 +01:00
Benoit Marty
9852ce6821 Fix API Break: introduce EventOrTransactionId 2024-10-18 08:49:11 +02:00
Jorge Martin Espinosa
2efdb3ae45 Centralise the DI code generation logic (#3562)
* Create Anvil extension helper

* Use the helper everywhere
2024-09-30 12:20:28 +00:00
Benoit Marty
62a6e916a6 Migrate license to AGPL - XML files. 2024-09-06 17:43:35 +02:00
Benoit Marty
2b016227e9 Migrate license to AGPL.
Run script `uv run license-editor --repository ../element-x-android`
2024-09-06 17:19:19 +02:00
Benoit Marty
94f38f1af5 Rework FakeMatrixRoom so that it contains only lambdas. (#3229)
* Upgrade lint to 8.7.0-alpha01

* FakeMatrixRoom: lambda everywhere

Fix test compilation issues
2024-07-22 10:39:48 +02:00
Jorge Martin Espinosa
950e502ca6 Improve screenshot testing with ComposablePreviewScanner (#3125)
* Use ComposablePreviewScanner to rework how screenshot testing works
* Add test sharding
* Update screenshots
* Fixes for Element Gallery

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
Co-authored-by: Benoit Marty <benoit@matrix.org>
2024-07-03 13:05:06 +02:00
ganfra
dfae2e50c9 Draft : refactor a bit ComposerMode and formatting management so we don't mess up with draft restoration. 2024-06-25 11:35:22 +02:00
ganfra
71667dc235 Reply : refactor so we can use ReplyToDetails in Composer and Timeline 2024-06-21 12:23:17 +02:00
Benoit Marty
9367f58216 Rename some class from Impl to Default 2024-05-31 09:47:27 +02:00
ganfra
395b3c4806 Merge branch 'develop' into renovate/org.maplibre.gl-android-sdk-11.x 2024-05-29 15:43:25 +02:00
Benoit Marty
87689d787e Lambda parameters in a composable function should be in present tense, not past tense.
https://mrmans0n.github.io/compose-rules/rules/#naming-parameters-properly
2024-05-29 12:18:23 +02:00
Benoit Marty
db21cd439e Rename class (code quality) 2024-05-23 14:38:49 +02:00
ganfra
526c33df17 maplibre : remove all mapbox references and update plugin to be compatible. 2024-05-21 16:12:19 +02:00
Benoit Marty
67e0ca9202 Add name to call argument. 2024-03-08 17:30:32 +01:00
Benoit Marty
b6aa44d374 Remove unused val. 2024-02-21 18:30:08 +01:00
Benoit Marty
b48aa45d51 Add first tests for ShowLocationView 2024-02-19 13:36:08 +01:00
Benoit Marty
9c599a298a Introduce fun aShowLocationState to reduce boilerplate code. 2024-02-19 13:35:24 +01:00
Jorge Martin Espinosa
973c57d401 Update Compound to v0.0.5 and update icons (#2380)
Update Compound to `v0.0.5`:

- Make sure we fix all the breaking changes.
- Update some icons to use the compound version instead.
-Replace icons with their Compound counterparts when possible.
- Clean up unused icons.
- Fix issues with incorrect icons or sizes being used after replacing the temporary icons with the Compound ones.

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2024-02-12 16:41:58 +00:00
Benoit Marty
378692f743 Fix moar ktlint issues 2024-01-11 10:02:10 +01:00
renovate[bot]
7e9cda3aa9 Update plugin ktlint to v12.1.0 (#2200)
* Update plugin ktlint to v12.1.0

* Run `./gradlew ktlintFormat` and fix some issues manually.

* Fix other issues reproted by Ktlint

* Limit false positives, KtLint removes unnecessary curly brace in String templates.

* Remove useless Unit

* Minor improvements over ktlint changes

* Restore `AlertDialogContent` behaviour

* 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: Jorge Martín <jorgem@element.io>
Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2024-01-10 16:22:24 +01:00
Benoit Marty
d9fb5ce007 Remove now useless ExperimentalLayoutApi opt in 2023-12-28 12:41:02 +01:00
Benoit Marty
7c58a843dc Add Konsist test to use isTrue() instead of isEqualTo(true), and fix existing issues. 2023-12-04 15:23:36 +01:00
Benoit Marty
65924eac6b Add Konsist test to use isFalse() instead of isEqualTo(false), and fix existing issues. 2023-12-04 15:21:50 +01:00
Benoit Marty
45883975c4 Add Konsist test to check that assertThat is imported, and fix existing issues. 2023-12-04 15:18:01 +01:00
Jorge Martin Espinosa
a8b85fb4e6 Extract compound tokens and theming to compound-android library (#1888)
* Replace tokens & icons with the external Compound ones

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-11-27 10:30:07 +01:00
Benoit Marty
4ae0790cc1 Remove default value for lambda.
We enforce a value to be provided and it's better for code coverage.
2023-11-22 17:28:23 +01:00
Jorge Martin Espinosa
14cf2b0440 Iterate design on several screens: update icons, replace PreferenceTexts (#1771)
- Batch import new icons from the design team.
- Rename _september icons since they're just extra icons that need to be integrated in Compound in the future, and it should be ok if we don't distinguish between ic_september_*, ic_november_* etc., so all icons are now simply ic_* in the designsystem module.
- Create a new CompoundIconListPreviewProvider to add chunked lists of icons for previews. Add an exception for it to Konsist.
- Move some icons to use Compound icons.
- Remove most PreferenceText usages, use ListItem instead.

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-11-15 10:52:37 +01:00
jonnyandrew
e376feba22 Add analytics for voice messages (#1706) 2023-11-02 09:32:22 +00:00
Jorge Martin Espinosa
0bd9c78836 Initial support for member suggestions (#1631)
* Initial support for member suggestion (search and UI)

* Add custom `BottomSheetScaffold` implementation to workaround several scrolling bugs

* Start searching as soon as `@` is typed, add UI following initial designs

* Extract suggestion processing code

* Extract component, add previews, fix tests

* Add tests

* Add exception from kover to the forked bottom sheet code

* Add a feature flag for mentions

- Extract composer & mention suggestions to their composable.
- Extract mentions suggestions processing to its own class.
- Add `MatrixRoom.canTriggerRoomNotification` function.
- Update strings and conditions for displaying the `@room` mention.

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-10-27 10:26:40 +00:00
jonnyandrew
ffa6c43503 [Voice messages] Add voice recording UI (#1546)
---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-10-12 15:17:18 +00:00