Commit Graph

142 Commits

Author SHA1 Message Date
Benoit Marty
0f499567f9 Fix Konsist test. 2026-02-25 15:51:21 +01:00
Skye Elliot
028ec221b0 Add history sharing badges to room details (#6132)
* feat: Add history sharing badges to room details view

* tests: Add snapshots for history sharing room details badges

* fix: Disable soft-wrapping in badges, use FlowRow

* tests: Add unit test for `RoomDetailsState` and history sharing badges.

* tests: Add `MatrixBadgeAtomNeutralWrappingPreview` to exceptions

* chore: Re-order `MatrixBadgeAtom` previews

* fix: Add `Immutable` annotation to `RoomHistoryVisibility`.

* fix: Correct translation for shared badge
2026-02-06 19:03:52 +00:00
ganfra
36fb3e251d Add tests for SpaceFiltersPresenter and SpaceFiltersView and fix quality 2026-02-04 14:42:57 +01:00
Skye Elliot
8a05f525fa Remove "history may be shared" banner. (#6087)
* Revert "Add alert to encrypted rooms with visible history (Android). (#5709)"

This reverts commit d0ba02dd7e.

* fix: Restore identity state change preview and snapshot.
2026-01-27 14:15:41 +00:00
Jorge Martin Espinosa
0313fa56dd Create a new room in a space (#6061)
* Add `SpaceService.editableSpaces` and `SpaceService.addChildToSpace`

* Add `parentSpace` to `CreateRoomConfig`

* Allow setting a parent space to a room in `ConfigureRoomPresenter`, make sure the room is added to the parent space when creating it

* `ConfigureRoomPresenter`: Load the list of possible spaces a room can be added to

* Refactor `RoomVisibilityState` to internally use `JoinRuleItem`

This gets rid of `RoomAccess` and `RoomAccessItem`, and it will allow us to map the join rule items in a cleaner way to both join rules and the UI

* Implement the UI changes:

- Display the parent space.
- Allow selecting a new one.
- Import needed strings.

* Fix existing tests

* Add `@Immutable` annotation to `SpaceRoom`, since it was detected as unstable.

Maybe because of `RoomType`?

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2026-01-26 18:23:02 +01:00
Benoit Marty
657a610f53 Metro 0.10.0: Classes annotated with ContributesIntoSet do not need to be annotated with Inject. 2026-01-20 10:13:39 +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
Benoit Marty
df76e283d0 Fix konsist test. 2026-01-09 15:36:10 +01:00
Benoit Marty
1f2b7eb641 Add exceptions. 2025-12-19 09:44:58 +01:00
Skye Elliot
d0ba02dd7e Add alert to encrypted rooms with visible history (Android). (#5709)
* feat: Add visible history alert to encrypted rooms.

- Adds a dismissable alert that is displayed whenever the user opens a
  room with `history_visibility` != `joined`. When cleared, this is
  recorded in the app's data store.
- When opening a room with `history_visibility` = `joined`, this flag is
  cleared.`

Issue: https://github.com/element-hq/element-meta/issues/2875

* chore: Fix linting issues.

* feat: Move alert showing logic into state presenter.

* chore: Fix linting issues.

* tests: Fixup tests.

* feat: Use real link.

* chore: Update license header.

* chore: Add (c) to license headers.

* chore: Add `.` to license header.

* feat: Lock alert behind history sharing developer setting.

* ci: Trigger record screenshots

* feat: Create repo key using session ID for multi-account support.

* feat: Use session ID hash for constructing data store.

* tests: Correct and update tests.

* tests: Update snapshots.

* feat: Prevent identity alert from displaying with history visibility alert.

* feat: Tidy up HistoryVisibleStatePresenter logic, update previews.

* chore: Remove unused import.

* chore: Update screenshots.

* feat: Add translation string.

* chore: Remove redundant temporary translation file.
2025-12-08 21:19:15 +01:00
ganfra
d62f250e00 quality: fix warnings 2025-11-25 14:30:59 +01:00
Benoit Marty
ccd704acd9 Enable Konsist test. 2025-11-17 18:03:43 +01:00
Benoit Marty
2667b3e5f8 Copyright: update test 2025-11-10 11:25:37 +01:00
Benoit Marty
d103382993 Copyright: update enterprise code. 2025-11-10 11:23:26 +01:00
Benoit Marty
f5f1cee53b Copyright: Update Konsist test 2025-11-10 11:05:28 +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
ganfra
05d5ec78bb design(home) : clean up 2025-10-23 17:22:39 +02:00
ganfra
296b85eb2f design(home): rename RomListTopBar to HomeTopBar 2025-10-23 16:11:26 +02:00
Benoit Marty
52dffa5418 Merge branch 'develop' into feature/bma/metro070 2025-10-23 11:30:25 +02:00
Benoit Marty
375c5c7c7d Ignore the new test for now. 2025-10-23 08:56:32 +02:00
Benoit Marty
9285db9348 Add test around metro annotation.
Metro 0.7.0 make optional to use @Inject when the class is annotation by @ContributesBinding
2025-10-22 17:34:07 +02:00
Benoit Marty
80c0c17336 Remove exception 2025-10-22 17:25:59 +02:00
Jorge Martin Espinosa
597c9b473a Sync notifications using WorkManager (#5545)
* Initial implementation of notification sync using `WorkManager`

* Use custom `MetroWorkerFactory` to allow assisted injection in WorkManager Workers

* Add tests for `FetchNotificationWorker`. Create `FakeNotificationResolverQueue` to help testing.

* Add more tests, fix Konsist checks

* Add tests for `SyncNotificationWorkManagerRequest`

* Simplify `FakeNotificationResolverQueue`
2025-10-17 09:51:27 +00:00
Benoit Marty
370300f810 Remove custom color for enterprise build. 2025-10-15 14:10:42 +02:00
Benoit Marty
8b703ed046 Let the enterprise build be able to update the colors. 2025-10-15 11:25:58 +02:00
Benoit Marty
c16903c57c Add exception to Konsist test. 2025-10-13 09:25:24 +02:00
Benoit Marty
f9ba0819f2 Add Konsist test on Immutable annotation 2025-10-09 15:36:06 +02:00
Benoit Marty
da78386d25 Add Konsist test to check that toPersistentList() is not used.
Same for `toPersistentSet()` and `toPersistentMap()`.
Fix existing issues.
2025-10-08 15:51:18 +02:00
Benoit Marty
c3157e5caf Add exception for Konsist test. 2025-10-06 10:17:31 +02:00
Benoit Marty
9b6df78bac Add Konsist test to check Metro annotation. 2025-09-29 09:32:44 +02:00
Benoit Marty
73a6ba2849 Multi accounts - experimental first implementation (#5285)
* Multi account - Do not reset analytics store on sign out.

Else when 1 of many accounts is removed, the analytics opt in screen is displayed again.

* Multi accounts - first implementation.

* Multi accounts - Prevent user from logging twice with the same account

* Multi accounts - ignore automatic GoBack in case of error.

* Multi accounts - update first view when adding an account.

* Rename method storeData to addSession.

* Multi accounts - handle account switch when coming from a notification

* Multi accounts - handle login link when there is already an account.

* Multi accounts - handle click on push history for not current account.

* Multi accounts - improve layout and add preview.

* Add accountselect modules

* Multi accounts - incoming share with account selection

* Multi accounts - check the feature flag before allowing login using login link.

* Multi accounts - swipe on account icon

* Cleanup

* Multi accounts - fix other implementation of SessionStore

* Multi accounts - fix PreferencesRootPresenterTest

* Multi accounts - Add test on AccountSelectPresenter

* Multi accounts - Fix test on HomePresenter - WIP

* Update database to be able to sort accounts by creation date.

* Add unit test on takeCurrentUserWithNeighbors

* Fix test and improve code.

* Add exception

* Multi accounts - handle permalink

* Code quality

* Multi accounts - localization

* Fix issue after rebase on develop

* Fix issue after rebase on develop

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Update Multi accounts flag details.

* Add missing test on DatabaseSessionStore

* Add missing preview on LoginModeView

* Remove dead code.

* Add missing preview on PushHistoryView

* Document API.

* Rename API and update test.

* Remove MatrixAuthenticationService.loggedInStateFlow()

* Update screenshots

* Remove unused import

* Add exception

* Fix compilation issue after rebase on develop.

* Update screenshots

* Fix test

* Avoid calling getLatestSession() twice

* Rename `matrixUserAndNeighbors` to `currentUserAndNeighbors`

* Extract code to its own class.

* Add comment to clarify the code.

* Init current user profile with what we now have in the database.

It allows having the cached data (user display name and avatar) when starting the application when no network is available.

* Let the RustMatrixClient update the profile in the session database

* Fix test.

* When logging out from Pin code screen, logout from all the sessions.

tom

* Make PushData.clientSecret mandatory.
Also do not restore the last session as a fallback, it can lead to error in a multi account context, or even when a ghost pusher send a Push.

* Change test in RustMatrixAuthenticationServiceTest

* Do not use MatrixAuthenticationService in RootFlowNode, only use SessionStore

* Remove MatrixAuthenticationService.getLatestSessionId()

* Fix compilation issue after merging develop

* Add test on DefaultAccountSelectEntryPoint

* Fix compilation issue after merging develop

* Introduce LoggedInAccountSwitcherNode, to improve animation when switching between accounts.

* Rename Node to follow naming convention.

* Fix navigation issue after login.

* Remove unused import

* Revert "Fix navigation issue after login."

This reverts commit e409630856d7a7e741548016d7afe174ff1b40f7.

* Revert "Rename Node to follow naming convention."

This reverts commit 883b1f37c7207512d9f6605749977ad9045846a1.

* Revert "Introduce LoggedInAccountSwitcherNode, to improve animation when switching between accounts."

This reverts commit 9c698ff8152aceb5fd2b8b5ab5f609d28de64d24.

* Metro now have `@AssistedInject`.

* Update screenshots

* Introduce DelegateTransitionHandler and use it in RootFlowNode

---------

Co-authored-by: ElementBot <android@element.io>
Co-authored-by: ganfra <francoisg@element.io>
2025-09-26 15:45:06 +02:00
Benoit Marty
17c1f21927 Add Konsist test. 2025-09-16 10:50:34 +02:00
Richard van der Hoff
5f920eb100 Show progress dialog while we are sending invites in a room (#5342)
* Add `InvitePeopleState.sendInvitesAction`

Keep track of the progress on sending invites with a new state property.

* Keep `RoomInviteMembersView` open until invites are sent

* Sync strings from localazy

* extend `ProgressDialog` to support custom content

For my current design, a simple text element is insufficient. I extend
`ProgressDialog` to give more flexibility over the content of the dialog.

* Show progress dialog while invites are being sent

* Add new ProgressDialog previews to the naming exceptions list

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
Co-authored-by: Jorge Martín <jorgem@element.io>
2025-09-12 10:35:37 +00:00
Benoit Marty
73b210440f Fix typo in annotation name. 2025-08-25 11:58:32 +02:00
Benoit Marty
c13d9a935b Test previews with a11y details and add a first example with HomeViewA11yPreview. 2025-08-25 11:10:23 +02:00
Benoit Marty
c53af0c7bc Fix test. 2025-08-20 17:51:58 +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
c0fe9f2616 Allow preview function name to end with RtlPreview 2025-08-18 17:16:48 +02:00
Benoit Marty
aa1c51f5c9 Code cleanup 2025-08-11 14:53:40 +02:00
Benoit Marty
1fe15e7b23 Add Konsist test to check that files do not have double license header.
It seems that sometimes Android Studio is doing this mistake.
2025-08-11 10:36:40 +02:00
Jorge Martin Espinosa
955263bee1 Force last owner of a room to pass ownership when leaving (#5094)
* Move `ChangeRoles*` classes to their own module so they can be shared

* Hook the change roles screen to the leave room action, add confirmation dialogs

* Use enum instead of sealed interface for `ChangeRoomMemberRolesListType`

* Try to improve communications between nodes

* refactor (leave room) : makes sure to expose only necessary code from api module

* Add `:libraries:previewutils` module to share some test fixtures used for UI previews

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
Co-authored-by: ganfra <francoisg@matrix.org>
2025-08-05 17:24:14 +02:00
Benoit Marty
370daea759 Cleanup 2025-07-11 16:19:11 +02:00
Benoit Marty
470ed51758 Add preview for mentions in the context of the timeline. 2025-07-08 18:49:22 +02:00
Benoit Marty
39cf20e686 Fix issue after rebase. 2025-07-07 17:24:58 +02:00
Benoit Marty
bcc01d5007 Apply gradient to focused Event. 2025-07-07 15:03:30 +02:00
Benoit Marty
5541ca7427 Improve Konsist test. 2025-07-07 14:49:09 +02:00
Benoit Marty
ea94ec32b4 Remove bloom effect and replace by linear gradient
Use semantic colors.
2025-07-07 14:49:07 +02:00
Benoit Marty
5de36fcf1b Fix wrong TopAppBar usage 2025-07-04 09:43:30 +02:00