-
Notifications
You must be signed in to change notification settings - Fork 788
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 the "useSearch" composable and search filters panel into the results list in quizzes #13083
Integrate the "useSearch" composable and search filters panel into the results list in quizzes #13083
Conversation
Build Artifacts
|
5286738
to
bbffa9c
Compare
@@ -16,12 +16,14 @@ import SelectionIndex from '../views/common/resourceSelection/subPages/Selection | |||
import SelectFromChannels from '../views/common/resourceSelection/subPages/SelectFromTopicTree.vue'; |
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.
Let's change the import name to SelectFromTopicTree
so there is consistency.
60816cb
to
54263ec
Compare
Hi @AllanOXDi - I've only done a very preliminary read through and quick manual QA, and while I think there will a few adjustments that need to be made, my initial takeaway is that this is looking great! Going through the basic workflow I can search, see my results, open search result folders and go back to search, and add questions. Well done. I'll come back later today with more focused feedback but overall, a very strong start :) nice work. |
@@ -21,7 +21,7 @@ | |||
:contentCheckboxDisabled="contentCheckboxDisabled" | |||
:contentCardLink="contentLink" | |||
:contentCardMessage="contentCardMessage" | |||
:showRadioButtons="!multi" | |||
:showRadioButtons="showRadioButton" |
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'm a little bit confused about what's happening here with the radio buttons. My thinking is that maybe there is some pre-existing 0.17 work that allows for selection for practice quizzes, that is colliding a bit with this new scenario, of making individual questions selectable. I realized in the bug bash last week that I hadn't fully specced out the updates to practice quizzes, and I think that can be done in follow up since it's about selection of resources in general, not just in search results. But here in your work, we do want to have the selection be a checkbox (if selecting the whole resource) rather than a radio 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.
If there's anything you want to chat through about this, let me know and we can outline together what the scenarios need to be :)
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 kinder confusing because I see on the spec it's a radio button. Since the goal here is to allow selecting individual questions, switching to checkboxes for whole-resource selection sounds like the right approach.
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 understanding the context of the multi
prop would be a great starting point. From a quick read through, the showRadioButton
is some kind of a toggle between the use of radio or checkboxes. I guess its mean to offer flexibility for the card.
The multi
props context in the SelectFromBookmarks.vue
and SelectFromTopics.vue
is !settings?.selectPracticeQuiz
(which i think means practice quiz is selectable or not?) so using target === SelectionTarget.QUIZ
could break functionality, I think?
But back to Marcella's point, its probably best to chat about this "in-person" as it could involve a few moving pieces. Hopefully that helps
@@ -235,6 +245,9 @@ | |||
} | |||
return ViewMoreButtonStates.NO_MORE; | |||
}, | |||
showRadioButton() { | |||
return this.target === SelectionTarget.QUIZ; |
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.
Using SelectionTarget here is a great idea - but I think we might need to extend it (see the comment about re: practice quizzes, which might be easier to just talk through " in person")
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.
Hi @AllanOXDi! I was just passing by, and just noted a couple of things to be aware of :).
@@ -23,6 +23,7 @@ | |||
v-if="target === SelectionTarget.QUIZ && !settings.selectPracticeQuiz" | |||
class="mb-24" | |||
:settings="settings" | |||
:hideSetting="true" |
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 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 have a looked at the spec I did not see where we are showing it
https://www.figma.com/design/lVJt5ukOrxS9qay0rXy7GC/0.18-Coach-updates?node-id=107-28854&t=74AwO4l2G3YAYHd8-0
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.
Ah thats just for practice quizzes then. Not for all instances of Selection Index. With this we are currently breaking this spec https://www.figma.com/design/lVJt5ukOrxS9qay0rXy7GC/0.18-Coach-updates?node-id=2189-178270&t=CUt0c5tq2iT8oGZD-0
|
||
const params = get(route).params; | ||
if (params?.quizId) { | ||
getParams.contains_quiz = true; |
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 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 we should pass these filters in other way, we shouldnt rely on route.params.quizId for that, since this is a generic composable that can be used in multiple contexts, and the useBaseSearch composable shouldnt know the logic of when to apply the contains_quiz
to true)
@@ -253,7 +254,7 @@ export default function useBaseSearch({ | |||
if (get(displayingSearchResults)) { | |||
getParams.max_results = 25; | |||
const terms = get(searchTerms); | |||
set(searchResultsLoading, true); |
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.
Why should we remove this loading state? This will make that we dont see the circular loader when the search is loading.
type: Function, | ||
required: true, | ||
}, | ||
target: { |
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.
Non-blocking but to be aware of. Should these two new subpages be rather a common subpage that we can use for both lessons and quizzes? I have tried to keep the common subpages in common/resourceSelection/subPages
to avoid too much code duplication, although if the quizzes search results and search filters pages differs too much from the lessons search results, then it would make sense to have these two components separated. But if this is the case, then we dont need these target
prop, since this component will be always rendered in the quizzes context.
@@ -290,8 +291,8 @@ export default function useBaseSearch({ | |||
set(_results, data.results || []); | |||
set(more, data.more); | |||
_setAvailableLabels(data.labels); |
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 set(searchResultsLoading, false);
should be inside the then
callback so we set the search results to false just after we have successfully fetched the search 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.
I am leaving this out because once its left within api call the loading state does not stop and no data displays.
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.
No @AllanOXDi, we cant left this out, because we are breaking the loading state of the search results fetch. We use this composable in Learn too. And we can see here that the loading state is gone now :').
Before this PR:
Compartir.pantalla.-.2025-03-07.14_23_12.mp4
After, with this specific change:
Compartir.pantalla.-.2025-03-07.14_24_44.mp4
When we make changes on something that was already implemented, we also need to bear in mind how is this affecting to all the parts of the code that uses this composable/method/component, and why the current implementation is like that, to know if we can safely change it :), unfortunately this is not the case :/
Let me know what is the error you are seeing with this, and we can figure out how can we solve it without breaking the loading state. We have pretty much the same behaviour in Lessons so we can take inspiration from the implementation we have in lessons and figure out why in Lessons work fine, and here not.
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 just found the error you are seeing. To avoid the infinite loading, you will need to copy this subpageLoading
computed property we have in lessons, and skip the loading if the current page is the search filters page fc945b4#diff-19b8c2b6b4d2b12a66a9d9a35c3a4e6b6312c432540bfbab30346aaa9ae83ea0R140. That is how it is solved in lessons and we can copy this to quizzes too :)
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 @AllanOXDi! Is looking good! Just left some observations on things that can be still polished a little bit more.
@@ -59,9 +59,10 @@ | |||
:hasMore="hasMore" | |||
:fetchMore="fetchMore" | |||
:loadingMore="loadingMore" | |||
:multi="!settings?.selectPracticeQuiz" | |||
:multi="settings?.selectPracticeQuiz" |
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 correct condition here is !settings?.selectPracticeQuiz
, this condition negated.
When we go through the "select practice quiz" flow, the intention is that we select just one resource, thats why this multi
exists, so just when we are selecting practice quiz, the multi
condition should be false. Thats why this condition should be :multi="!settings?.selectPracticeQuiz"
With this, we are being able to select multiple resources when selecting a practice quiz:
Note the difference when we go to create a new quiz as "select quiz" vs "create new quiz"
:selectionRules="selectionRules" | ||
:selectAllRules="selectAllRules" | ||
:target="target" |
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 dont need this target prop anymore.
@@ -385,6 +405,11 @@ | |||
}, | |||
annotator: annotateTopicsWithDescendantCounts, | |||
}, | |||
quizSearch: { |
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 dont have this quizSearch
in the useResourceSeleciton, what is it for?
@@ -290,8 +291,8 @@ export default function useBaseSearch({ | |||
set(_results, data.results || []); | |||
set(more, data.more); | |||
_setAvailableLabels(data.labels); |
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 just found the error you are seeing. To avoid the infinite loading, you will need to copy this subpageLoading
computed property we have in lessons, and skip the loading if the current page is the search filters page fc945b4#diff-19b8c2b6b4d2b12a66a9d9a35c3a4e6b6312c432540bfbab30346aaa9ae83ea0R140. That is how it is solved in lessons and we can copy this to quizzes too :)
@@ -0,0 +1,138 @@ | |||
<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.
Could we have a follow up issue for unifying these two components with the ones we have in lessons? I think that there are few differences to what we have in lessons and there is some non-trivial logic that would be good to have de-duplicated cc: @marcellamaki
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.
Yes! there will be some planned, incremental refactoring that we do that I'm planning for the 0.18 patch releases to further clean up and consolidate some logic, without getting into the weeds on everything right now. It's a good suggestion to do that for this code, @AlexVelezLl
|
||
const query = get(route).query; | ||
if (query?.filter_quiz) { | ||
getParams.contains_quiz = true; |
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 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.
Hi @AllanOXDi - it seems like Alex has shared some helpful notes here. I think the practice quizzes are still a bit of a sticking point. It sounds like the two of you will connect on monday, but please let me know if it's helpful for me to jump into a call to clarify anything.
For the scope of this issue:
- let's focus only on the "create" quiz workflow (non-practice quizzes) which should be a checkbox/multi selection option integrated with the topic/resource/question selection workflow.
- I'm not concerned about the changes here causing "regressions" in practice quizzes, or that workflow not being completed; let's prioritize getting the create quiz workflow ready to go here, and then revisit the practice quizzes separately
Other than that, this seems very close to ready, with just a few suggestions on cleanup. I'll be happy to do another review pass after you two have a cohack, but I anticipate that will address most of the feedback. Thanks again for the work here, @AllanOXDi - it's looking good!
@pcenov @radinamatic - this is ready for QA team review, and I'd like to request it goes to the top of the list for Wednesday please. There are some known follow up issues to be filed with Practice Quizzes (aka the "select quiz" workflow), so let's focus QA here just on using search in the regular "new quiz" (or editing a quiz) experience. I'd also like us to put as much as we can into follow up issues just so we can potentially assign to multiple team members to help keep things moving, and I'll review any feedback comments tomorrow to help sort that out. |
Observed the following issues:
filters.should.be.for.exercises.only.mp4
show.only.folders.withc.exercises.mp4
select.a.practice.quiz.mp4
folder.with.already.selected.questions.mp4 |
Thank you @pcenov - I think we may move those tasks to follow up, so that we can distribute them among a few people, but still plan to get them resolved promptly so we can tag a beta release (cc @radinamatic). I am going to do one more code read through, and will follow up @AllanOXDi. Thanks everyone for the effort here with Allan's effort, the close code review, and the QA. nearly there! |
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.
Alright - let's go ahead and get this merged in - thank you @AllanOXDi! I'll sort out follow up issues for the handful of things that Peter mentioned
Feedback addressed, and remaining items will be addressed in follow up issues :)
Summary
Integrate search filters panel to quiz selection
Add a new immersive header to the side panel modal component.
References
Closes #13035
Reviewer guidance