Skip to content
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

Merged
merged 5 commits into from
May 19, 2022

Conversation

fedrunov
Copy link
Contributor

@fedrunov fedrunov commented Apr 25, 2022

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other

Content

current implementation of "Explore Space" screen doesn't match Figma design

Motivation and context

closes #5658

Screenshots / GIFs

Before After
Screenshot 2022-04-25 at 15 01 24 Screenshot 2022-04-25 at 15 06 45

Tests

  • open app drawer (left panel)
  • click on any space menu button
  • open space explore scree

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

@github-actions
Copy link

github-actions bot commented Apr 25, 2022

Unit Test Results

122 files  ±0  122 suites  ±0   2m 8s ⏱️ -17s
205 tests ±0  205 ✔️ ±0  0 💤 ±0  0 ±0 
690 runs  ±0  690 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit dc8c7b1. ± Comparison against base commit 424fb55.

♻️ This comment has been updated with latest results.

@fedrunov fedrunov changed the title Space explore rooms screen redisign Space explore rooms screen alignment with design in figma Apr 25, 2022
@fedrunov fedrunov requested review from a team, bmarty, Florian14 and ericdecanini and removed request for a team May 5, 2022 11:51
Copy link
Contributor

@Florian14 Florian14 left a 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")
Copy link
Contributor

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

Copy link
Contributor Author

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

Comment on lines 221 to 224
return filter.split(" ").all {
spaceChildInfo.name?.contains(it, ignoreCase = true).orFalse() ||
spaceChildInfo.topic?.contains(it, ignoreCase = true).orFalse()
}
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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.

NIkita Fedrunov added 2 commits May 11, 2022 12:29
# Conflicts:
#	vector/src/main/java/im/vector/app/features/spaces/explore/SpaceDirectoryController.kt
@fedrunov fedrunov requested a review from Florian14 May 11, 2022 11:14
Copy link
Contributor

@ericdecanini ericdecanini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

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?

@@ -0,0 +1 @@
space explore UI is aligned with design in Figma
Copy link
Contributor

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:

  1. Tag this as .feature rather than .misc (from a user perspective this is a feature change more than a misc or bugfix)
  2. Describe the design change itself instead of relating it back to figma (which external users/contributors may not have access to)

Comment on lines 221 to 224
return filter.split(" ").all {
spaceChildInfo.name?.contains(it, ignoreCase = true).orFalse() ||
spaceChildInfo.topic?.contains(it, ignoreCase = true).orFalse()
}
Copy link
Contributor

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> {
Copy link
Contributor

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))

Copy link
Contributor Author

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 ?: "") }
Copy link
Contributor

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

@fedrunov
Copy link
Contributor Author

fedrunov commented May 13, 2022

Also, in your screenshot, I see a search icon instead of the filter icon, but in the code, it looks ok, can you confirm?

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?

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.

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?

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
Copy link
Contributor

@ericdecanini ericdecanini left a 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

@Florian14
Copy link
Contributor

Also, in your screenshot, I see a search icon instead of the filter icon, but in the code, it looks ok, can you confirm?

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?

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.

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?

Copy link
Member

@bmarty bmarty left a 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"
Copy link
Member

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).

@fedrunov fedrunov merged commit a30912f into develop May 19, 2022
@fedrunov fedrunov deleted the feature/nfe/space_explore_ui_alignment branch May 19, 2022 09:49
onurays added a commit that referenced this pull request May 19, 2022
* develop:
  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.
onurays added a commit that referenced this pull request May 19, 2022
* 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
@github-actions
Copy link

Matrix SDK

Integration Tests Results:

  • [org.matrix.android.sdk.session]
    = passed=20 failures=0 errors=0 skipped=3
  • [org.matrix.android.sdk.account]
    = passed=3 failures=0 errors=0 skipped=2
  • [org.matrix.android.sdk.internal]
    = passed=55 failures=2 errors=0 skipped=1
  • [org.matrix.android.sdk.ordering]
    = passed=16 failures=0 errors=0 skipped=0
  • [org.matrix.android.sdk.PermalinkParserTest]
    = passed=2 failures=0 errors=0 skipped=0

piersonleo pushed a commit to piersonleo/element-android that referenced this pull request Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Converge on Explore rooms view for Spaces
4 participants