-
Notifications
You must be signed in to change notification settings - Fork 731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Space explore rooms screen alignment with design in figma #5834
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code seems ok, just some small feedback.
Also, in your screenshot, I see a search icon instead of the filter icon, but in the code, it looks ok, can you confirm?
else -> host.stringProvider.getString(R.string.action_join) | ||
if (filteredChildInfo.isEmpty()) { | ||
spaceDirectoryFilterNoResults { | ||
id("no results") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it probably works but I don't see any existing id containing spaces inside so I'd suggest not using spaces in ids
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is also one in the same file :)
id("HS no Support")
but I agree it feels weird, so I changed both to be consistent with majority in the project
return filter.split(" ").all { | ||
spaceChildInfo.name?.contains(it, ignoreCase = true).orFalse() || | ||
spaceChildInfo.topic?.contains(it, ignoreCase = true).orFalse() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I understand, if the filter is "Jo Do", it will also match "DoeJohn", is that expected? Should we take care of the ordering of the matches?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's ok to not take ordering in account since there should not be so many items after filter is applied. Also that's actually a copy-paste and this is 4th copy of this code, so I think I'll create a small refactoring issue for this later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have an issue to track this refactoring change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just found that there is exactly same implementation of SpaceChild MatchFilter, so I've reused that instead of copy paste.
And about issue - I'm not sure if it's actually could be refactored, so I decided to take a look on that after this will be merged and decide what to do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it should be aligned with the other platforms to have the same results, so I agree it would be the object of a dedicated PR.
The same issue exists about the search in the user directory which leads to different results depending on the platform.
# Conflicts: # vector/src/main/java/im/vector/app/features/spaces/explore/SpaceDirectoryController.kt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As Florian had pointed out, the implementation using the search icon looks different from the design in the issue which has the filter icon. If this was communicated somewhere, can we get some visibility on it? Furthermore, as per the screenshots above, I don't have the standard three-dot menu icon. As I'm not too familiar with this page, are there scenarios where this is expected?
changelog.d/5658.misc
Outdated
@@ -0,0 +1 @@ | |||
space explore UI is aligned with design in Figma |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these are to be used as release notes then I think it's better to:
- Tag this as
.feature
rather than.misc
(from a user perspective this is a feature change more than a misc or bugfix) - Describe the design change itself instead of relating it back to figma (which external users/contributors may not have access to)
return filter.split(" ").all { | ||
spaceChildInfo.name?.contains(it, ignoreCase = true).orFalse() || | ||
spaceChildInfo.topic?.contains(it, ignoreCase = true).orFalse() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have an issue to track this refactoring change?
@@ -196,4 +209,20 @@ class SpaceDirectoryController @Inject constructor( | |||
} | |||
} | |||
} | |||
|
|||
class RoomSearchMatchFilter : Predicate<SpaceChildInfo> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We try and keep only one class per file (as per #5817 (comment))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed this duplicate and reused existing implementation
} | ||
} | ||
|
||
private fun filter(query: String?) { | ||
setState { copy(currentFilter = query ?: "") } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's nicer to use query.orEmpty()
here
When SearchView is inflated as action view for menu, it doesn't receive styled attrs from xml so all icons are default. And there is no way to set this icons for SearchView on runtime. We could do a custom View or try custom ActionProvider, but it looks like overkill for changing one icon.
three-dot appears if there is any item to be shown. Currently there is only one item - add room, and it could be hidden if you can't add room to this space. In that case entire three-dot menu will not be displayed |
… match filter replaced with existing implementation, small code style tweaks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clarification. LGTM
I did a similar change for a fork, I confirm that you cannot change the default icon for a specific SearchView (except by changing it for all the SearchView in the application, which is not the goal). So, I had to do it programmatically in the "onPrepareOptionsMenu" and it worked great as far as I know. I don't think it is a blocker for this PR but it'd be great to have the correct icon regarding the performed action at the end: Is a search or a filter applied to the room list? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one remark, else LGTM (static review)
@@ -0,0 +1,36 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's not necessary to explicitly use LinearLayoutCompat
, LinearLayout
is OK. I think LinearLayoutCompat
will be inflated at runtime by AppCompatViewInflater
anyway (but after checking this file I may be wrong).
* develop: (251 commits) Space explore rooms screen alignment with design in figma (#5834) leaving space aligned with ios (#5942) Fix usage of System.currentTimeMillis(). This a bit mocky but anyway it's better to use SystemClock.elapsedRealtime() for this case. Update TimelinePreviousLastForwardTest.kt Changelog.d Rename 'getDomain' to 'getServerName'. Well-known lookups should not include the port of a server. Ah it was used in Gplay variant. Anyway I think we can still remove this now. Fix parsing of location data in non encrypted room Additionally increment for TimelinePreviousLastForwardTest Notify other devices of acceptance of verification request Instead of using a magic number, explicitly test for the events we expect. Adding comments on some strings and removing non necessary plural Remove ShortcutBadger lib and usage (it was dead code) Version++ Fastlane file Towncrier Add `.login` to get the username of the PR merger. Rename folder for the PlayStore Remove empty translations ... # Conflicts: # matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/SessionModule.kt
Matrix SDKIntegration Tests Results:
|
Type of change
Content
current implementation of "Explore Space" screen doesn't match Figma design
Motivation and context
closes #5658
Screenshots / GIFs
Tests
Tested devices
Checklist