-
Notifications
You must be signed in to change notification settings - Fork 456
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
feat: reduce items rendering in left sidebar search results #14669
base: main
Are you sure you want to change the base?
Conversation
5d74dbe
to
a30186e
Compare
Signed-off-by: Dorra Jaouad <[email protected]>
Signed-off-by: Dorra Jaouad <[email protected]>
822e53b
to
21a55e2
Compare
21a55e2
to
8818ae1
Compare
…ationsResults. Refactor flat list creation Signed-off-by: Dorra Jaouad <[email protected]>
Signed-off-by: Dorra Jaouad <[email protected]>
Signed-off-by: Dorra Jaouad <[email protected]>
Signed-off-by: Dorra Jaouad <[email protected]>
8818ae1
to
e3a876f
Compare
<Hint v-else-if="contactsLoading" :hint="t('spreed', 'Loading …')" /> | ||
</ul> | ||
<SearchConversationsResults v-else | ||
ref="searchResults" |
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 should be considered in list-ref
prop for arrow navigation
src/components/LeftSidebar/SearchConversationsResults/SearchConversationsResults.vue
Show resolved
Hide resolved
<template v-if="sourcesWithoutResults"> | ||
<NcAppNavigationCaption :name="sourcesWithoutResultsList" /> | ||
<Hint :hint="t('spreed', 'No search results')" /> | ||
</template> |
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.
That IMO should be added as last items in searchResultsVirtual
array
src/components/LeftSidebar/SearchConversationsResults/SearchConversationsResults.vue
Show resolved
Hide resolved
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.
Some stylistic comments
src/components/LeftSidebar/SearchConversationsResults/SearchConversationsResults.vue
Show resolved
Hide resolved
src/components/LeftSidebar/SearchConversationsResults/SearchConversationsResults.vue
Show resolved
Hide resolved
src/components/LeftSidebar/SearchConversationsResults/SearchConversationsResults.vue
Show resolved
Hide resolved
src/components/LeftSidebar/SearchConversationsResults/SearchConversationsResults.vue
Show resolved
Hide resolved
src/components/LeftSidebar/SearchConversationsResults/SearchConversationsResults.vue
Show resolved
Hide resolved
// Add "New Conversation" option if allowed | ||
if (props.canStartConversations) { | ||
virtualList.push({ type: 'listItem', id: 'new_conversation', name: props.searchText, subname: t('spreed', 'New private 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.
Shouldn't it be before the search results?
const searchResultsConversationList = computed(() => { | ||
if (props.searchText !== '' || props.isFocused) { | ||
const lowerSearchText = props.searchText.toLowerCase() | ||
return props.conversationsList.filter(conversation => | ||
conversation.displayName.toLowerCase().includes(lowerSearchText) | ||
|| conversation.name.toLowerCase().includes(lowerSearchText) | ||
) | ||
} else { | ||
return [] | ||
} | ||
}) |
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 component is never used when searchText
is ''
so isFocused
and entire if
doesn't do anything here...
const computedStyleCaption = computed(() => { | ||
return { | ||
height: itemSize.value + 'px', | ||
alignItems: props.isCompact ? 'unset' : 'self-end', | ||
} | ||
}) | ||
|
||
const computedStyleFooter = computed(() => { | ||
return { | ||
marginBlockStart: props.isCompact ? '0' : '18px', // 54px (item height) - 36px (current height) | ||
} | ||
}) |
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.
nitpick: let's move it to the template to have all the layout in one place
We can keep computed for the value of marginBlockStart
to have it commented here, having only the CSS in the template (less CSS in JS).
const sourcesWithoutResults = computed(() => { | ||
return !hasResultsUsers.value | ||
|| !hasResultsGroups.value | ||
|| (isCirclesEnabled && !hasResultsCircles.value) | ||
}) |
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.
To make it clearer a boolean
const sourcesWithoutResults = computed(() => { | |
return !hasResultsUsers.value | |
|| !hasResultsGroups.value | |
|| (isCirclesEnabled && !hasResultsCircles.value) | |
}) | |
const hasSourcesWithoutResults = computed(() => { | |
return !hasResultsUsers.value | |
|| !hasResultsGroups.value | |
|| (isCirclesEnabled && !hasResultsCircles.value) | |
}) |
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.
Or we can only use sourcesWithoutResultsList
return isCirclesEnabled && !hasResultsCircles.value | ||
}) | ||
|
||
const sourcesWithoutResultsList = computed(() => { |
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.
nitpick: If we rename sourcesWithoutResults
, when this doesn't need to have List
const sourcesWithoutResultsList = computed(() => { | |
const sourcesWithoutResults = computed(() => { |
☑️ Resolves
Rendering went from
n
items rendered out ofn
(100%) to 15-30 items out ofn
items.🖌️ UI Checklist
🖼️ Screenshots / Screencasts
🚧 Tasks
🏁 Checklist