Commit Graph

142 Commits

Author SHA1 Message Date
Chris Smith 198d6d4c56 Invite users to existing rooms (#441)
Invite users to existing rooms

Scope:

- Allow inviting from the room detail screen and the member list
- Invite option is only shown if the user has the correct power level
- Search flow the same as creating a new room, allowing multi-select
- Existing room members/invitees are disabled with a custom caption
- Sending is asynchronous, an error dialog will appear wherever the
  user is if necessary

Closes #245
2023-05-23 09:23:24 +00:00
Chris Smith 848f1cb988 Refactor search related functionality (#436)
Refactor search related functionality

This is a prelude to adding the feature of inviting users to
a room, getting everything in the right place and reusable.

What this does:

## User search refactor

Moves the (global) user search logic (dealing with MXIDs,
minimum lengths, debounces) into a `UserRepository`.

This now sits in a `usersearch` library, which will be
used by the create room flow and the new invite flow.

## SearchBar logic pull-up

Every place we use SearchBar, we're doing the same things
to style placeholders, show back/cancel buttons, etc.

We also have a results type that is duplicated for
basically every feature that uses the search bar.

I've pushed all this common functionality into the
SearchBar itself. This makes the component a bit less
general purpose, but saves a lot of repetition.

## Remove the userlist feature

Almost all the functionality of the userlist feature
is now exclusively used by the create room feature.
Room details uses its own version because the
requirements are different.

Components useful elsewhere (SelectedUsers and
SelectedUser) have gone to matrixui, everything else
has gone to createroom.

## Other bits and pieces

I've fixed everywhere that uses Scaffold to correctly
consume the WindowInsets if the contentPadding is
applied to the contents (which it universally is).
This was a change in the last version of Material3
(I guess previously Scaffold handled the consumption
for us). This fixes weird gaps above search bars.

Added overloads for the MatrixUserRow and
CheckedMatrixUserRow that take the name/subtitle/avatar
separately, so the invites list can pass arbitrary
text like "User has already been invited".

The `blockuser` package was for some reason not
under `impl` but alongside it, I've bumped it into
the right place.
2023-05-22 09:06:54 +00:00
Florian Renaud 56251fedd9 Remove useless composed call 2023-05-16 16:36:47 +02:00
Florian Renaud 7a36d084e6 change wording for DM creation dialog 2023-05-16 16:36:47 +02:00
Florian Renaud 2ed8515231 restrict room name to single line 2023-05-16 16:36:47 +02:00
Florian Renaud a3f0281525 Close keyboard when textfields lose focus 2023-05-16 16:36:47 +02:00
Florian Renaud d903901457 Select private privacy by default 2023-05-16 16:36:47 +02:00
Florian Renaud 6d9f6664d8 Make the configure room screen scrollable 2023-05-16 16:36:46 +02:00
Florian Renaud 2c39e8f9fc Fix test compilation 2023-05-16 15:37:22 +02:00
Florian Renaud f6ec8357f2 Use material3 ListItem 2023-05-16 14:29:18 +02:00
Florian Renaud afc32f4810 Merge remote-tracking branch 'origin/develop' into
feature/fre/create_room_select_avatar
2023-05-16 14:18:29 +02:00
Benoit Marty 457b83184a Use default material3 version again and cleanup @OptIn annotations.
Material3 is now 1.1.0
2023-05-15 12:28:31 +02:00
Florian Renaud 454fbe7f73 Merge pull request #400 from vector-im/renovate/kotlin
Update kotlin to v1.7.0
2023-05-12 17:03:41 +02:00
Chris Smith 92e9d3a127 Fix a few FFI leaks (#405)
Fix a few FFI leaks

These are instances where we obtain an FFIObject and don't call
Close on it to release the underlying reference on the Rust side.

The worst instance here was leaking an object per room member
every time we refreshed the member list
2023-05-12 10:50:39 +00:00
Florian Renaud 719dd20555 Remove useless OptIn in tests 2023-05-12 10:05:39 +02:00
Florian Renaud 38967a2f4d Add more tests 2023-05-11 23:03:47 +02:00
Florian Renaud 42e5a86c54 Fix test build 2023-05-11 17:34:40 +02:00
Florian Renaud 610faf942d Reformat some code 2023-05-11 17:31:56 +02:00
Florian Renaud edb2cee361 Clear cached image after room creation 2023-05-11 16:30:38 +02:00
Florian Renaud 27f6f5cd3b upload avatar within the room creation 2023-05-11 16:30:38 +02:00
Florian Renaud 17dd489e6a Add missing tests 2023-05-11 16:30:38 +02:00
Florian Renaud 750b427bc4 Add todo and screenshot tests 2023-05-11 16:30:37 +02:00
Florian Renaud 33ee366c8d Fix tests after rebase 2023-05-11 16:30:37 +02:00
Florian Renaud 929ebc79c5 Delete cached avatar URI 2023-05-11 16:30:37 +02:00
Florian Renaud a28c0170f6 Rework and add remove button 2023-05-11 16:30:37 +02:00
Florian Renaud fcdc737a81 WIP pick avatar image 2023-05-11 16:30:37 +02:00
bmarty f54b4e9f7e Sync Strings from Localazy 2023-05-08 00:08:48 +00:00
Florian Renaud 403014b1dd Fix navigation broken 2023-05-05 17:11:45 +02:00
Florian Renaud 73473bc2d2 Add tests 2023-05-04 16:34:38 +02:00
Florian Renaud ca35d696dd Enable create DM action 2023-05-04 16:27:50 +02:00
Florian Renaud 310be7a14a Perform get profile request on matrix ID 2023-05-04 16:27:50 +02:00
Chris Smith a6569387e3 Add debounce/minimum length for add user search (#387)
This functionality was already implemented, it just didn't
have the right parameters configured for the user list
presenter.

Closes #109
2023-05-04 12:30:20 +00:00
Jorge Martin Espinosa 014c0f4186 [Media upload] Add media pickers to the Room screen and the composer (#380)
* Add media pickers to the Room screen and the composer.

* Fix exclude rules for translations
2023-05-04 11:51:03 +02:00
Chris Smith 581c5ab2d2 Move and refactor MatrixUser (#381)
Move and refactor MatrixUser

Instead of living in matrixui and having an AvatarData, this can
reside in the matrix module and just have the URL. An extension
method in matrixui can then provide the AvatarData when required.

This removes some small duplication, and pushes the UI-specific
information (i.e., what size of avatar is going to be rendered)
further down the stack. It also aligns the field names with those
used by the rust SDK (e.g. "displayName" instead of "userName").
2023-05-03 16:30:19 +00:00
Chris Smith 99f571b4eb Search for users to start a new DM. (#376)
Search for users to start a new DM.

Hooks up the create room UI to the matrix client to get
search results. Searches are debounced for 500ms and
only executed when 3 or more characters are entered.

Wrap the result state so we can distinguish between
"no results because we haven't searched yet" and
"no results because the API returned nothing", and
add a "No results found" message in the UI for the
latter case.

Closes #95
2023-05-03 13:26:31 +00:00
Benoit Marty 79cc6161a3 Merge pull request #370 from vector-im/sync-localazy
Sync Strings
2023-05-02 17:45:50 +02:00
bmarty 8f1793ffa4 Sync Strings from Localazy 2023-05-01 00:09:50 +00:00
ganfra 40f3f2873b Merge branch 'develop' into feature/fga/some_room_related_fixes 2023-04-27 17:25:12 +02:00
bmarty 860777d20c Sync Strings from Localazy 2023-04-24 00:09:54 +00:00
ganfra a1869a3019 Improve handling members 2023-04-20 18:21:47 +02:00
Jorge Martin Espinosa fae3417181 Validate several ids in constructors (#336)
* Validate ids in constructors.

* Remove redundant `.value` usage in string interpolation.

* Make a distinction between `SessionId` and `UserId` in `TestData`.
2023-04-18 16:17:13 +00:00
Jorge Martin Espinosa de010545fb Update Gradle to 8.1 and AGP to v8.0 (#329)
* Update AGP to 8.0.0.

* Set JAVA_HOME to JDK17

* Update lint version.

* Use right JDK for dependency analysis, replace deprecated env var.

* Upgrade to Gradle 8.1.

* Remove `@Supress(DSL_SCOPE_VIOLATION)` as it's no longer needed.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-17 08:49:52 +00:00
Florian Renaud 509299b1d2 Revert "move instruction"
This reverts commit 9c56c62548.
2023-04-14 17:27:47 +02:00
Florian Renaud 9c56c62548 move instruction 2023-04-14 16:49:11 +02:00
Florian Renaud 9fcbab851a Rename callbacks for clarity and consistency 2023-04-14 16:46:45 +02:00
Florian Renaud 3c9af936ab Add tests on create action 2023-04-14 16:26:14 +02:00
Florian Renaud 81fc3406c8 Handle create room action 2023-04-14 14:57:25 +02:00
Florian Renaud c9edd8c6cd Add missing test 2023-04-14 14:54:38 +02:00
Florian Renaud b59fab03e1 Fix privacy item binding 2023-04-14 14:05:07 +02:00
Florian Renaud 1bc59bb9ab update ConfigureRoomPresenter unit tests 2023-04-14 09:17:44 +02:00