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

Implement recommendations display #4803

Open
wants to merge 39 commits into
base: search-recommendations
Choose a base branch
from

Conversation

akolson
Copy link
Member

@akolson akolson commented Nov 4, 2024

Summary

Description of the change(s) you made

This pr Implements the following

  • UI changes required for search recommendations to be made in the "Import from other channels
    " page. See reference for details.
  • Pagination to allow for the loading of resources depending on whether good recommendations exist or not.
  • Loading states and error reporting for the search recommendations UI.
  • Adds the search recommendations string feature file for easier use and maintenance of strings in light of string translation.
  • Conditionalizes the search recommendations display using the ai enabled flag.

Manual verification steps performed

  1. Select a channel
  2. Click the "Add" button and select "Import from channels"
  3. View changes to the UI and responsiveness.
  4. Use the pagination to view more resources, observing the loading states in the process
  5. Login with a user whose ai feature flag is turned off; they should not be able to view the recommendations side panel. Also, no recommendations related content should be loaded in the network tab on inspection.
  6. Clicking the "About Recommendations" link, should display the about modal with information about recommendations

Screenshots (if applicable)

Good recommendations
Screenshot 2024-11-04 at 08 21 40
Pagination - View more good recommendation
Screenshot 2024-11-04 at 08 21 40
Pagination - Other (not so good) recommendations
Screenshot 2024-12-05 at 02 13 10
Pagination - No good recommendations
Screenshot 2024-12-05 at 02 17 09
Loading state
Screenshot 2024-12-05 at 02 15 39
About recommendations
Screenshot 2024-11-04 at 08 21 51
AI feature flag off
Screenshot 2024-12-05 at 02 24 21

Are there any risky areas that deserve extra testing?

References

Closes #4565
Closes #4566
Closes #4683
Closes #4775

Comments

The KCard component is generally in a good place, however there could be few issues that could pop up here and there. For the latest changes you can yarn link the KDS develop branch or use the latest release on npm, if up-to-date with develop


Contributor's Checklist

PR process:

  • If this is an important user-facing change, PR or related issue the CHANGELOG label been added to this PR. Note: items with this label will be added to the CHANGELOG at a later time
  • If this includes an internal dependency change, a link to the diff is provided
  • The docs label has been added if this introduces a change that needs to be updated in the user docs?
  • If any Python requirements have changed, the updated requirements.txt files also included in this PR
  • Opportunities for using Google Analytics here are noted
  • Migrations are safe for a large db

Studio-specifc:

  • All user-facing strings are translated properly
  • The notranslate class been added to elements that shouldn't be translated by Google Chrome's automatic translation feature (e.g. icons, user-generated text)
  • All UI components are LTR and RTL compliant
  • Views are organized into pages, components, and layouts directories as described in the docs
  • Users' storage used is recalculated properly on any changes to main tree files
  • If there new ways this uses user data that needs to be factored into our Privacy Policy, it has been noted.

Testing:

  • Code is clean and well-commented
  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Any new interactions have been added to the QA Sheet
  • Critical and brittle code paths are covered by unit tests

Reviewer's Checklist

This section is for reviewers to fill out.

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

akolson added 24 commits August 29, 2024 16:44
@akolson akolson requested review from bjester and MisRob November 4, 2024 05:28
@bjester bjester self-assigned this Nov 5, 2024
@MisRob
Copy link
Member

MisRob commented Nov 6, 2024

Tagging @MisRob here for any thoughts on the implementation of the KCard component and how it can be improved. Noting here I have also shared feedback with Misha on my KCard usage experience.

Thanks @akolson! I will prioritize reviewing parts related to cards in this PR and follow-up on your Slack feedback on that opportunity.

package.json Outdated Show resolved Hide resolved
…mplement-recommendations-display

# Conflicts:
#	contentcuration/contentcuration/frontend/RecommendedResourceCard/components/RecommendedResourceCard.vue
#	package.json
#	yarn.lock
@MisRob
Copy link
Member

MisRob commented Dec 6, 2024

@akolson Chiming in to say so far so good! The way the card is implemented around KCard makes much sense. Thanks for reading the docs on a11y :) I can do more detailed review of card parts as soon as we finalize. Wouldn't expect anything major to come up.

@akolson akolson marked this pull request as ready for review December 10, 2024 15:22
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.

Added a few questions/comments! I still want to do some manual testing but overall looking very good so far @akolson :)

@@ -2,70 +2,92 @@

<ImportFromChannelsModal>
<template #default="{ preview }">
<VSheet>
<div style="width: 1400px;">
Copy link
Member

Choose a reason for hiding this comment

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

I know we are not super concerned with mobile responsiveness/optimization on studio, but I'm wondering if this needs to be somewhat more dynamically sized?

this.defaultMessages = defaultMessages;
this._nameSpace = nameSpace;
this._defaultMessages = defaultMessages;
for (const key in defaultMessages) {
Copy link
Member

Choose a reason for hiding this comment

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

Nice that this is now going to be in studio too! We've already made use of the same thing in Kolibri in the last few months since Richard added it :)

Copy link
Member Author

Choose a reason for hiding this comment

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

💯

:headingLevel="2"
:node="recommendation"
:selected.sync="selected"
@change_selected="handleChangeSelected"
Copy link
Member

Choose a reason for hiding this comment

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

I am not super familiar with using .sync so this may just be my own misunderstanding but I'm wondering why we have both a change selection event and a selection prop binding? are they doing different things? I'm also not clear on where handleChangeSelected is coming from

Copy link
Member Author

Choose a reason for hiding this comment

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

The RecommendedResourceCard reuses existing functionality (the selected vuex state and handleChangeSelected handler) used by the main panel to allow for resource imports, as they do pretty much the same thing.

  • The selected state keeps track of what has been selected and deselected.
  • The handleChangeSelected handler updates the selected state.
  • The handleChangeSelected receives an isSelected callback from the clicked checkbox in the recommended resource card and passes back with the associated node selected or deselected
  • The selected prop is only passed for use in the isSelected callback whichI think we can directly declare in the recommended resources card to remove the ambiguity.

@@ -312,6 +312,11 @@
const totalCount = this.recommendations.length + this.otherRecommendations.length;
return displayCount < totalCount;
},
browseWindowStyle() {
return {
width: this.isAIFeatureEnabled ? '1200px' : '800px',
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 I mentioned this somewhere else to, and I know this is sort of a pre-existing problem in studio, but just wanted to flag here as well and see if we want to have these larger hardcoded width values

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll post in design and see if they have any thoughts. The design changes I think were based on how studio was structured.

@@ -79,6 +72,9 @@
},
},
computed: {
channelName() {
return this.node.channel?.name || '';
Copy link
Member

Choose a reason for hiding this comment

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

Would there ever not be a channel name?

Copy link
Member Author

Choose a reason for hiding this comment

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

Most likely not. If I can recall correctly, this change was in response to a bug I was experience while simulating the recommendations while using Studio's local app data. For some reason, some the the resources returned no channel names. I'll add a comment so this can be removed once the integration is complete.

Copy link
Member Author

Choose a reason for hiding this comment

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

Noting that this is only for illustration purposes on the frontend and will be removed once the integration with the recommendations API is in place

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.

5 participants