Commit Graph

38 Commits

Author SHA1 Message Date
ganfra
e3744636b6 Merge branch 'develop' into feature/fga/room_list_api 2023-06-28 15:14:06 +02:00
Benoit Marty
6a1004cbcd Fix test 2023-06-27 19:49:54 +02:00
Benoit Marty
2efbfab939 Cleanup 2023-06-27 19:49:54 +02:00
Benoit Marty
1b84d8e3ee Fix test compilation issue. 2023-06-27 19:43:03 +02:00
Benoit Marty
5c27952194 Create UnreadIndicatorAtom with preview. 2023-06-27 19:31:44 +02:00
Benoit Marty
d6f2d7a5d3 Rework AvatarSize.
Remove default value for AvatarSize, it has to be explicitely provided.
2023-06-27 19:23:37 +02:00
Yoan Pintas
e7e225dd3a Add JoinedRoom posthog event (#687) 2023-06-27 16:32:20 +00:00
Benoit Marty
d782162f27 Merge pull request #684 from vector-im/feature/bma/stringR
Quick PR to introduce `CommonStrings` type alias
2023-06-27 16:00:31 +02:00
ganfra
3d872ec0e2 RoomList: fix tests and sample 2023-06-27 14:06:58 +02:00
Marco Romano
2a82e1b4e4 Async API improvements "v2" (#672)
* Async API improvements "v2"

**NB: This PR actually changes only 3 files in `libraries/architecture/`. All the other changes are automated refactors to fix the calling code.**

This is a proposal for improvements to our `Async` type as discussed in: https://github.com/vector-im/element-x-android/pull/598/files#r1230664392 and in other chats.

Please bear in mind it is just a proposal, I'd love to hear your feedback about it, especially when it comes to naming: I've tried to make parameter and function names use a terminology similar to what we find in the Kotlin stdlib and its `Result` type.

I'm inclined to like more the non-extension flavours of the new `run*` APIs, though I'd also like your feedback about what API shape you prefer.

### Summary of the changes:
#### Functional
- Adds `exceptionOrNull()` API to complement the existing `dataOrNull()` API.
- Adds `isFailure()`, `isLoading()`, `isSuccess()` and `isUninitialized()` courtesy APIs.
- Renames `executeResult()` to `runUpdatingState()`:
	- Becomes the base API to which all the other similarly named APIs call into.
	- Makes it inline.
	- Adds contract.
	- Passes over any `prevData` to newre Async states.
	- Passes through the `block`s return value.
	- Adds unit tests.
- Renames `execute` to `runCatchingUpdatingState()` and makes it just call into `runUpdatingState()`
- Adds extension function overloads to the `run*` functions to accept `MutableState` as receiver

#### Cosmetics
- Reorders classes and methods in alphabetic order.
- Reorder parameter names to mimic conventions in Kotlin stdlib.
- Adds docstrings where useful.

* Use `fold()`

* rename pop to popFirst

* Add docstrings

* Please Detekt

* Rename exception to error.

* Please detekt

* Update existing usages.
2023-06-27 13:37:23 +02:00
ganfra
2a24d0196e Merge branch 'develop' into feature/fga/room_list_api 2023-06-27 10:47:50 +02:00
Benoit Marty
4a8c49fa28 Use CommonStrings everywhere 2023-06-27 09:45:00 +02:00
ganfra
e5c86675a4 RoomList: more rework on RoomSummaryDataSource 2023-06-26 18:02:53 +02:00
bmarty
9c5c578c67 Sync Strings from Localazy 2023-06-26 00:10:53 +00:00
ganfra
8ce65b4429 RoomList: change a bit the api of RoomSummaryDataSource 2023-06-22 12:34:07 +02:00
github-actions[bot]
3f7738c001 Sync Strings (#630)
* Sync Strings from Localazy

* Update strings, remove broken German translation

* Update screenshots

---------

Co-authored-by: bmarty <bmarty@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
Co-authored-by: ElementBot <benoitm+elementbot@element.io>
2023-06-19 11:18:01 +00:00
Benoit Marty
9321a9f718 Introduce simulateLongTask to ensure that the Presenter State Loading is visible.
Also do some cleanup on the tests.
2023-06-15 10:57:05 +02:00
Chris Smith
4b40a40b3b Invites: increase vertical padding to 16dp 2023-06-06 16:44:18 +01:00
github-actions[bot]
03c28ac52d Sync Strings (#522)
Sync Strings from Localazy
2023-06-05 15:26:50 +00:00
Chris Smith
9d52beb525 Invites: simplify string building 2023-06-05 11:51:00 +01:00
Chris Smith
e357f50379 Removed translated lines with wrong params 2023-06-02 15:53:01 +01:00
Chris Smith
ac6b2192a5 More string fiddling 2023-06-02 14:22:35 +01:00
Chris Smith
edf22ac373 Invites: tweak actions for decline dialog 2023-06-01 17:06:08 +01:00
Chris Smith
a38b0d7108 Invite list: show divider 2023-06-01 16:57:05 +01:00
Chris Smith
2c0d593ca6 Outlined button tweaks
Force the height in InviteSummaryRow as compose defaults to a min
height of 40dp

Change the button text style to ignore font padding so the text
aligns properly
2023-06-01 16:48:27 +01:00
Chris Smith
b1824c04e5 Invite list: various layout tweaks
- Larger avatar
- Include the MXID in the inviter
- Show inviter avatar to the left instead of inline
  (This may be weird in some translations, but it's what design
   wants and is consistent with iOS)
- Pad the name/alias if the notification dot is present
2023-06-01 16:33:00 +01:00
Chris Smith
e10b6ca9dd Invite list: typography tweaks 2023-06-01 10:06:25 +01:00
bmarty
3daea29a82 Sync Strings from Localazy 2023-05-29 00:09:47 +00:00
Chris Smith
c74d0a5d6b Fix bad preview name for invite list 2023-05-24 11:12:14 +01:00
Chris Smith
1eac67bf25 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
bf690c70b4 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
ebac9ef4b4 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
c22d181d8c Remove useless OptIn in tests 2023-05-12 10:05:39 +02:00
Chris Smith
2171f1a8ab Show badges for new invites (#355)
Show badges for new invites

Closes #238
2023-05-04 15:30:55 +00:00
bmarty
cd5e4458a6 Sync Strings from Localazy 2023-04-24 00:09:54 +00:00
Chris Smith
ae97a034e5 Accepting and declining invites
Hook up accept and decline buttons in the invites UI. Accept
will attempt to accept and then navigate to the room; decline
shows a confirmation dialog.

Fixes #106
2023-04-21 15:01:27 +01:00
Jorge Martin Espinosa
e651d2f9c5 Fix: improve offline indicator designs (#341)
* Use the right font weight for the offline indicator title.

* Remove unneeded suppression in some build files.
2023-04-19 15:58:56 +02:00
Chris Smith
e90211b5d8 Invite list view
Adds a CTA on the room list to view invites if there are any.

The invite list presents each invite with accept/decline buttons
and (for room invites) the sender details.

Fixes #102
2023-04-19 10:20:48 +01:00