-
Notifications
You must be signed in to change notification settings - Fork 3k
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
#37605 Do not show "member not found" when loading member list #37731
#37605 Do not show "member not found" when loading member list #37731
Conversation
@aimane-chnaif Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
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.
LGTM and tests well
@aimane-chnaif all yours |
@@ -422,7 +422,7 @@ function BaseSelectionList<TItem extends ListItem>( | |||
/> | |||
</View> | |||
)} | |||
{!!headerMessage && ( | |||
{!!headerMessage && !showLoadingPlaceholder && ( |
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.
This changes affects all pages where SelectionList is used. This is not safe change.
I suggest to hide header message only when loading skeleton shows.
{!!headerMessage && !showLoadingPlaceholder && ( | |
{!!headerMessage && !(flattenedSections.allOptions.length === 0 && showLoadingPlaceholder) && ( |
Or define shouldShowSkeletonView
variable and update to !!headerMessage && !shouldShowSkeletonView
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.
@burczu bump on the comment above
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.
@aimane-chnaif You may be right this is not the place for this change but your proposed change does not fix the root issue we want to address with this PR - the message is visible while loading members for some short period. I think I need to find completely different approach to fix this - I'll try to fix it today then.
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.
@aimane-chnaif I've changed the approach by introducing new prop in the BaseSelectionList
component called notFoundMessage
- this way we can threat this special message separately and show it only after loading process is finished (if there is no items loaded). Other messages could show up even while loading, as it was before.
What do you think?
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.
How about fixing this in WorkspaceMembersPage
only, instead of introducing new prop in this base component?
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.
@aimane-chnaif I've tried and the message is shown for some milliseconds no matter what condition I use - I think because the beginning state of the list is loading, only fixing it in this component fixes the issue...
</View> | ||
)} | ||
{!!headerMessage && renderTopMessage(headerMessage)} | ||
{!!notFoundMessage && !showLoadingPlaceholder && !sections.some((item) => item.data.length > 0) && renderTopMessage(notFoundMessage)} |
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.
!sections.some((item) => item.data.length > 0)
- is this condition different from flattenedSections.allOptions.length === 0
which was used to show skeleton view?
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.
@aimane-chnaif no difference from what I see - I can use it instead if you like
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.
changed
{!!headerMessage && renderTopMessage(headerMessage)} | ||
{!!notFoundMessage && !showLoadingPlaceholder && flattenedSections.allOptions.length === 0 && renderTopMessage(notFoundMessage)} |
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 am not sure about the case when 2 messages show at the same time.
But swap these rows so not found message should be above header message.
Or hide header message when not found message shows.
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.
swapped
Sorry for back and forth but I personally like what I suggested before - #37731 (comment) Please check this: |
We should not show not found message when we don't know yet how many members |
@aimane-chnaif no worries - this issue is kind of tricky... I've checked what you proposed in this comment in a first place and the Not found message was glitching while the loader was visible, so this is not our solution... |
ok |
@aimane-chnaif I think the best would be to just introduce some |
When So |
Actually, I found interesting thing. |
yes unless we wanna update logic to
|
@aimane-chnaif I think I've fixed it - you are right with this condition but I've used it incorrectly (silly mistake). The condition is an equivalent of |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb Chromemchrome.moviOS: Nativeios.moviOS: mWeb Safarimsafari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
🚀 Deployed to production by https://github.com/luacmartins in version: 1.4.50-5 🚀
|
Details
This PR fixes the issue with showing the header message of the Selection List before the list is loaded.
Fixed Issues
$ #37605
PROPOSAL: n/a
Tests
Offline tests
Same as above.
QA Steps
Same as above.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Screen.Recording.2024-03-05.at.12.16.37.mov
Android: mWeb Chrome
Screen.Recording.2024-03-05.at.12.17.23.mov
iOS: Native
Screen.Recording.2024-03-05.at.12.04.38.mov
iOS: mWeb Safari
Screen.Recording.2024-03-05.at.12.06.06.mov
MacOS: Chrome / Safari
Screen.Recording.2024-03-05.at.11.54.35.mov
MacOS: Desktop
Screen.Recording.2024-03-05.at.11.56.19.mov