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

Move useChannels & SearchChips to kolibri-common #12745

Conversation

nucleogenesis
Copy link
Member

@nucleogenesis nucleogenesis commented Oct 24, 2024

Summary

  • Moves SearchChips into kolibri-common w/ other Search components
  • SearchChips gets languages from injectBaseSearch#availableLanguages instead of useLanguages
  • Moves useChannels (and mocks) into kolibri-common - this simplified the SearchChips move as it depends on useChannels and useChannels seems well suited for a move to the common package
  • Removes useLanguageses and all references to it
  • Updates references throughout

References

Closes #12720

Reviewer guidance

  • Can you search and navigate the Library without issue?
  • Can remove search chips by clicking their X (or by clicking "clear all")
  • Languages work in the search filters (this was the bug that led me to find this issue)

Testing checklist

  • 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
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • 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

@nucleogenesis nucleogenesis added the TODO: needs review Waiting for review label Oct 24, 2024
@github-actions github-actions bot added APP: Learn Re: Learn App (content, quizzes, lessons, etc.) DEV: frontend labels Oct 24, 2024
@radinamatic
Copy link
Member

Something is still iffy (check the console errors) when filtering by languages, as no selected language search chips appear when tested the EXE asset from this PR in Firefox. This was working correctly in 0.17.1:

this PR 0.17.1
2024-10-25_20-09-20 2024-10-25_20-16-18

db-logs.zip


export default {
name: 'SearchChips',
mixins: [commonCoreStrings],
setup() {
const { languagesMap } = useLanguages();
const { availableLanguages } = injectBaseSearch();
const languagesMap = availableLanguages.reduce((map, lang) => {
Copy link
Member

Choose a reason for hiding this comment

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

Ah yes, this is confirmed by @radinamatic's testing - this needs to either get the availableLanguages or access the .value.

@nucleogenesis nucleogenesis force-pushed the 0.18--useLanguages-SearchChips-fixaroos branch from c72320f to a48f10b Compare October 31, 2024 19:02
@nucleogenesis nucleogenesis force-pushed the 0.18--useLanguages-SearchChips-fixaroos branch from a48f10b to 5a9ea16 Compare October 31, 2024 19:09
@nucleogenesis
Copy link
Member Author

@radinamatic sorry for the delay here - I've fixed the issue noted and the language chips show up correctly now.

Copy link
Member

@rtibbles rtibbles left a comment

Choose a reason for hiding this comment

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

Not seeing any code concerns in here, all useful cleanup.

@pcenov
Copy link
Member

pcenov commented Nov 4, 2024

LGTM now @radinamatic - the issue reported by you is fixed now and there are no regressions caused by this PR.

Copy link
Member

@rtibbles rtibbles left a comment

Choose a reason for hiding this comment

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

Code checks out, QA checks out. This is good to merge.

@rtibbles rtibbles merged commit 831e516 into learningequality:develop Nov 4, 2024
34 checks passed
@radinamatic
Copy link
Member

Thank you @pcenov! 👍🏽

@nucleogenesis I did notice one thing while testing over the weekend, and I wanted to investigate more but then the ⛈️ happened: Clear all button does clear the displayed search results and the filter applied for the search actions performed using Keywords, Categories, Activities and the Show resources options.

However, it does not clear the applied filters for any of the dropdown options (Language, Level, Channel, Accessibility). Search results are cleared, but the previously applied filter apparently stays visible, but not actually applied anymore, and the user needs to clear them manually. This can be confusing and we should force them cleared as for the other filtering options in the sidebar.

clear-dropdown.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APP: Learn Re: Learn App (content, quizzes, lessons, etc.) DEV: frontend TODO: needs review Waiting for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

useLanguage broken after move to kolibri-common
4 participants