Skip to content

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 MisRob and bjester 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.

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 :)

<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?

: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.

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

@akolson
Copy link
Member Author

akolson commented Feb 10, 2025

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

Hi @marcellamaki! Thanks for the review. I was able to work my way around the comments and have mades some tweaks. Happy to hear anymore thoughts, comments or suggestions. Thanks

@akolson akolson requested a review from rtibbles March 4, 2025 18:52
Copy link
Member

@bjester bjester left a comment

Choose a reason for hiding this comment

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

I'm confused where the backend API went and why it isn't connected here? The backend is what provides the recommendations, and so even without the API connected to the backend, I feel the backend should still be connected in this PR, unless we have another issue? I recall reviewing a PR for it, but I can't find it

Copy link
Member

@bjester bjester left a comment

Choose a reason for hiding this comment

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

Leaving some thoughts

on_delete=models.CASCADE,
)
channel = models.ForeignKey(
Channel,
Copy link
Member

Choose a reason for hiding this comment

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

Since contentnode is associated with kolibri_public.models.ContentNode, I think it would make sense if this was also in alignment with kolibri_public. Although, I think as its written this seems best suited to be able to return the main_tree_id. Just more of a reflection and not a requested change.

id: recommendation.id,
nodeId: recommendation.node_id,
rootId: recommendation.main_tree_id,
parent: recommendation.parent_id,
Copy link
Member

Choose a reason for hiding this comment

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

Where are we providing the these fields?

rootId: recommendation.main_tree_id,
parent: recommendation.parent_id,
});
const channel = await this.loadChannel(node.channel_id);
Copy link
Member

Choose a reason for hiding this comment

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

We might want to dedupe this.

@akolson akolson requested a review from bjester April 8, 2025 15:06
Copy link
Member

@bjester bjester left a comment

Choose a reason for hiding this comment

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

Tested and approved!

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