Skip to content

Conversation

rtibbles
Copy link
Member

@rtibbles rtibbles commented Jul 2, 2025

Summary

  • Migrates most content renderer verbiage to content viewer (to align with previous renaming of plugins similarly)
  • Migrates ContentRenderer component to ContentViewer, but keeps registration of component for now with deprecation warning
  • Create useContentViewer composable, which exposes the main composable for content viewers, and also exports the default props
  • useContentViewer composables takes the props and context arguments to the setup function as arguments, and an options object for additional configuration - currently this is only used for the defaultDuration for duration based progress calculations, which was previously provided by a public computed prop.
  • Adds deprecation warnings for viewer components that have not migrated to the composable
  • Because of the deliberate limitations of the composition API, you can no longer listen to events that the component itself emits, so all handling of emitted events is updated to either use exported methods within the component, or add listening at the ContentViewer component level instead
  • Migrates all existing content viewer components to use the composable, but with minimal changes to allow
  • Consolidates the 'extra' props from HTML5 and Bloompub components into the content viewer component
  • Deletes unused file prop
  • Deletes all references to "available" and "kind" props that have not been used for 5+ years.

References

Fixes #12744 (mostly) the deprecation warnings and handling can be cleaned up in develop.

Reviewer guidance

Does every content viewer still work (use the QA Channel to test this)?

Have I got every important instance of renderer as nomenclature? (noting I deliberately did not update the CustomChannelRenderer at this point, because it is a) possibly broken, and b) not easily tested).

Have I updated every instance of an error being emitted by a component and instead used the reportError method?

A lot of this work was done by Claude code, but the 'renderer' renaming I did just using VSCode find replace tooling to be more surgical.

I have manually tested every content viewer.

@rtibbles rtibbles added this to the Kolibri 0.18: Planned Patch 2 milestone Jul 2, 2025
@github-actions github-actions bot added DEV: renderers HTML5 apps, videos, exercises, etc. APP: Learn Re: Learn App (content, quizzes, lessons, etc.) APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend DEV: tools Internal tooling for development SIZE: large labels Jul 2, 2025
Copy link
Contributor

github-actions bot commented Jul 3, 2025

@rtibbles rtibbles force-pushed the content_viewer_composable branch 2 times, most recently from 20ba899 to 9b4be6f Compare July 9, 2025 14:01
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.

Code review looks good to me -- the approach is straightforward and the renaming within the diff lines up. I will do a confirmation on Monday that we aren't missing any of the replacements for the renaming (I haven't grepped everything yet). But, I think this is ready for manual QA. @pcenov and @radinamatic, can this go on the to-do list?

return component;
}

logger.warn(
Copy link
Member

Choose a reason for hiding this comment

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

👍

@rtibbles rtibbles force-pushed the content_viewer_composable branch from 9b4be6f to 69430d0 Compare July 14, 2025 20:10
@radinamatic
Copy link
Member

radinamatic commented Jul 15, 2025

Found two issues after reviewing all types of resources from the QA channel:

  1. PDF files do not open properly:

    PDF.mp4
  2. Exercises display only the first question and do not seem to load the rest after checking the answer:

    exercises.mp4

Tested in Chrome and Firefox on Ubuntu.
kolibri.txt

@radinamatic
Copy link
Member

There were also a bunch of 404 errors about fonts in the console for PhET sims, but nothing apparent in the UI:

2025-07-15_06-16-50

@rtibbles
Copy link
Member Author

I am very confident the PhET 404s are pre-existing. Will fix the other two issues.

@rtibbles rtibbles force-pushed the content_viewer_composable branch 2 times, most recently from 48bda60 to 8c08662 Compare July 15, 2025 22:22
@radinamatic
Copy link
Member

PDFs and exercises now displaying a-Ok! 👏🏽

PDF Exercise
PDF exercise

Copy link
Member

@radinamatic radinamatic left a comment

Choose a reason for hiding this comment

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

All resource types now check out! 💯 🎉 :shipit:

rtibbles added 2 commits July 17, 2025 10:50
Deprecate ContentRenderer mixin and ContentRenderer API.
Migrate usage of ContentRenderer to ContentViewer.
Rename code and docs to prefer 'viewer' to 'renderer'.
Consolidate content viewer props.
Remove stale prop passing for unused/nonexistent props.
@rtibbles rtibbles force-pushed the content_viewer_composable branch from 8c08662 to 3b08b57 Compare July 17, 2025 17:51
@radinamatic
Copy link
Member

Re-testing after the latest commits was uneventful, all resources are opening and displaying correctly! Merge away! 🚀 💥

@rtibbles rtibbles merged commit 04fc38f into learningequality:release-v0.18.x Jul 17, 2025
51 checks passed
@rtibbles rtibbles deleted the content_viewer_composable branch July 17, 2025 19:18
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.) APP: Learn Re: Learn App (content, quizzes, lessons, etc.) DEV: frontend DEV: renderers HTML5 apps, videos, exercises, etc. DEV: tools Internal tooling for development SIZE: large SIZE: very large
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants