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

Integrate search resource selection #13008

Conversation

AlexVelezLl
Copy link
Member

@AlexVelezLl AlexVelezLl commented Jan 15, 2025

Summary

  • Integrate search filters panel to lesson resource selection
  • Add a new immersive header to the side panel modal component.
Compartir.pantalla.-.2025-01-15.17_44_57.mp4

References

Closes #12987

Reviewer guidance

  • Edit a lesson
  • Change browser route path from "/lesson" to "lessontemp".
  • Click on "Manage resources".
  • Click on the search button from the first page on the side panel, or from within any topic
  • Play and try any possible combination with different filters, browsing search results topics, browser back/forward buttons navigation, etc.

@github-actions github-actions bot added APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend labels Jan 15, 2025
@AlexVelezLl AlexVelezLl force-pushed the integrate-search-resource-selection branch from c731c48 to f982e74 Compare January 16, 2025 15:04
@marcellamaki
Copy link
Member

@pcenov - this is not urgent, but depending on how time consuming your laptop reset process is, this could go to the top of your list for Friday or Monday. Thank you!

@pcenov
Copy link
Member

pcenov commented Jan 20, 2025

Hi @AlexVelezLl and @marcellamaki - I confirm that the search is integrated as specified above.

Here are a few general observations based on my testing which can probably be tracked as follow-up issues if not already tracked somewhere else:

  1. We probably need to indicate in a better way within the search panel that there are no channels to import from when there aren't any as currently this is what I see in that case:

2025-01-20_14-45-55

  1. As specified in Figma, when we open the search panel the Category filter should be expanded by default while currently it's not:

category

3 There are quite a few design differences if the current implementation is closely compared to Figma such as the back arrow and the label are not centered, the keywords label should be removed, the icons for the categories are not added etc. Since I am not sure if this is in scope for this PR I am just mentioning it here as a consideration:

differences

  1. When searching by selecting filters it's not immediately clear how the user should proceed the search (the user has to click the search icon next to the empty keywords field). In this case I was expecting to immediately see the filtered results after having applied a filter:
not.clear.how.to.proceed.mp4
  1. When testing the mobile view in Chrome's mobile devices emulator everything looks ok, but when I open the search panel in Chrome on my Samsung Note 10 phone I can only see the 'N resources selected' text and not the "Save & Finish" button as it's covered by the device's taskbar:

2025-01-20_15-44-38

Copy link
Member

@nucleogenesis nucleogenesis left a comment

Choose a reason for hiding this comment

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

Overall the changes are looking good. I left a handful of largely non-blocking comments. Happy to chat further about anything I noted.

I haven't finished going through every file yet, so I will be coming back to give a few parts another closer look

},
computed: {
isTopic() {
return !this.content.isLeaf;
},
headingElement() {
return this.headingLevel ? `h${this.headingLevel}` : 'h3';
Copy link
Member

Choose a reason for hiding this comment

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

Non-blocking: given the default value of headingLevel the conditional could be removed here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

@AlexVelezLl
Copy link
Member Author

Thanks @pcenov!

  1. I think this can be reported in a different issue :).
  2. Just implemed this!
  3. I have added the "Search in ..." as title on top of the search box when we open the filters from within a foder, and "Keywords" if we open it from the index (where we see the channels and bookmarks).

image

I think the icons are still not available cc: @marcellamaki, so probably should be reported in a different issue. And the border-bottom in the side panel modal header I think its something we have in develop but not in the figma specs. (honestly I am not sure neither about the reason of this difference but it has been accepted for a long time 😅 cc: @marcellamaki)

  1. @marcellamaki and @jtamiace will tell better about the expected behaviour of this. Right now the current implementation is that the user needs to click on the search button to open the search results.
  2. Im not being able to replicate this, I have tried it on my browser but it seems the line is breaking correctly. Could you provide more details how can I reproduce it?

image

@pcenov
Copy link
Member

pcenov commented Jan 22, 2025

Thank @AlexVelezLl,
Here are my comments for the issues we are discussing:

  1. I have reported a follow-up issue here Manage lesson resources > Search - No indication that there are no imported resources on the device #13021
  2. I confirm that this is fixed now.
    For points 3, 4 @marcellamaki pls let us know how to proceed. A note that in the Library page we are showing the results to the user immediately after applying the filter so that's my expectation for this search too. :)
  3. @AlexVelezLl in order to replicate the issue you need to check it in an actual mobile phone as the problem is caused by the device's taskbar. I have double checked that this happens consistently. :)

@AlexVelezLl AlexVelezLl force-pushed the integrate-search-resource-selection branch from 22dc161 to 26db2b8 Compare January 24, 2025 16:30
@AlexVelezLl
Copy link
Member Author

Hi @pcenov! I have pushed some changes to open the search results just after clicking on a filter. Also I think I have fixed the wrong positioning of the bottom bar when we open the side panel in a mobile device, could you give it a check, please? 😃

@pcenov
Copy link
Member

pcenov commented Jan 28, 2025

Thanks @AlexVelezLl - I confirm that now selecting a filter bring the user to the search results and that the "Save & Finish" button is no longer covered by the device's taskbar.

I was able to identify one additional mobile issue - the filter by categories is not working in mobile view. This can be replicated both in Chrome's emulator and in an actual device:

cannot.select.a.category.in.mobile.view.mp4

As always, let me know if this is not in scope for this PR and I'll file a follow-up issue.

@marcellamaki
Copy link
Member

@pcenov @AlexVelezLl - I wonder if this Categories bug on mobile is related to the other one (which I don't remember where it popped up, actually.... last week). But it was I think a discussion of the windowIsLarge view and the conditions of the category search modal that had been moved to common. If it is in fact that, I think we can open a follow up issue (or add this to an existing issue), @AlexVelezLl. Sorry my brain is not 100% back online yet 😄 And thank you Alex for adjusting the expected behavior for the search results!

@AlexVelezLl
Copy link
Member Author

AlexVelezLl commented Jan 28, 2025

I wonder if this Categories bug on mobile is related to the other one (which I don't remember where it popped up, actually.... last week). But it was I think a discussion of the windowIsLarge

Yes @marcellamaki, its the same, once that one is fixed, this will be fixed automatically :). I think we didnt end up with any follow up actions in that conversation 😅.

@marcellamaki
Copy link
Member

Ah okay - I will open an issue then and we can put it in the backlog for the meeting today. Thank you for remembering Alex :)

@marcellamaki
Copy link
Member

And back to answer questions on a few other points:

  1. I also do not know why there is a bottom border on the header. I think we can remove it, but it doesn't have to be in the issue, if you'd like to file a follow up @pcenov.
  2. the icons we will need to add in KDS, and then update in Kolibri, so I will open issues for that as well. I lost track of this and appreciate the reminder

I think that is it on the remaining questions that you both had? So, both are important but neither blocking for this PR. And, I am in process of re-reviewing this PR for code review and will add any additional code comments in a little while :)

Copy link
Member

@marcellamaki marcellamaki left a comment

Choose a reason for hiding this comment

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

Hi @AlexVelezLl - I've added a few comments, I don't think any of them are blocking but more just thoughts and points of discussion. I'll do one more re-review, but then I think we will probably be able to go ahead with approving and merging this!

@@ -13,7 +13,7 @@
icon="delete"
size="mini"
class="filter-chip-button"
@click="$emit('removeItem', item)"
@click="$emit('removeItem', item, { isLast: items.length === 1 })"
Copy link
Member

Choose a reason for hiding this comment

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

is this to indicate that there are no more search chips and so in addition to removing the item we want to.... change something else about the UI?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I did it to save us a tick from redirecting back. The main "thing" here is that searchTerms gets its value directly from the route query, that means that we need the route query to be updated to have its value updated, so it will "cost" a couple of ticks more before we have the displayingSearchResults prop to be false and then to redirect.

An alternative could be just to watch displayingSearchResults and wait until it is false to do the redirectBack, but wanted to be more proactive, save a couple of ticks (I mean, not waiting until displayingSearchResults gets updated) and be explicit in the code that the last item being removed will redirect us back.

@marcellamaki
Copy link
Member

I've done a little bit more manual QA, and I noticed what seems like a rather specific edge case, but searching at the "all channels" level, if I navigate into a folder within the search, the "back to search results" returns me to the main seleciton index, not the search results. (This isn't the case with search results that are within a channel or folder)

Screen.Recording.2025-01-31.at.1.51.16.PM.mov

@AlexVelezLl AlexVelezLl force-pushed the integrate-search-resource-selection branch from e9575f3 to 696cfa9 Compare February 1, 2025 00:41
@AlexVelezLl
Copy link
Member Author

Thanks @marcellamaki! I hadnt realized that case existed, I have just fixed it, and rebased my PR :)

const searchFetch = {
data: useSearchObject.results,
loading: useSearchObject.searchLoading,
hasMore: computed(() => !!useSearchObject.more.value),
Copy link
Member

Choose a reason for hiding this comment

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

Can this be reduced just to hasMore: computed(() => useSearchObject.more.value) ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi @ozer550! In this case its not the same, because hasMore should be a boolean value, and useSearchObject.more.value is an object, the "more" object. So to transform it to boolean we can do either !!useSearchObject.more.value or Boolean(useSearchObject.more.value), but personally I like more the former 😅.

Copy link
Member

@marcellamaki marcellamaki left a comment

Choose a reason for hiding this comment

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

Thank you @AlexVelezLl - I think all feedback has been addressed now. While I suspect Peter and Radina may find a few more things when we do full QA of this feature, I think this is in good shape to merge, and we can handle any follow up issues as they come. 🎉

@marcellamaki marcellamaki merged commit 4b993e4 into learningequality:develop Feb 4, 2025
37 checks passed
@AlexVelezLl AlexVelezLl deleted the integrate-search-resource-selection branch February 4, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend
Projects
None yet
6 participants