kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Upgrade H5P core library with split-out font and theme stylesheets

Open rtibblesbot opened this issue 2 months ago • 3 comments

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

Upgrade the vendored H5P core to upstream h5p/h5p-php-library@cb64a1f, adding the stylesheets upstream split out. The automated bump in #15455 drops them.

Complexity: Low Target branch: develop

Context

  • Upstream moved @font-face rules into styles/h5p-fonts.css.
  • Upstream moved the --h5p-theme-* variables into styles/h5p-theme-variables.css and styles/h5p-theme.css.
  • kolibri/plugins/h5p_viewer/h5p_build/h5pBundle.js imports none of these files.
  • With #15455 as-is:
    • icon glyphs render blank or as tofu
    • the confirmation dialog has no dim backdrop or shadow (reproduced in QA: Lesson 9, Check → Finish)
    • with theme: true the dialog renders unstyled, and axe reports a critical button-name violation

The Change

  • h5pBundle.js should import h5p-fonts.css, h5p-theme-variables.css and h5p-theme.css, in upstream's order.
  • downloadH5PVendor.js should exempt h5p-fonts.css from the per-file purge. Its fontFace: true purge would empty a fonts-only file.
  • Rebuild with pnpm run build-h5p in kolibri/plugins/h5p_viewer and commit the output.

Acceptance Criteria

  • [ ] .h5p-commit-sha is cb64a1f3884408487c3178e31fc140f5d45ca165 or newer
  • [ ] Built CSS in static/h5p/ contains @font-face{font-family:h5p
  • [ ] Built CSS contains --h5p-theme-main-cta-base:
  • [ ] .woff2 font files are present in static/h5p/
  • [ ] H5P icon glyphs render correctly
  • [ ] The confirmation dialog in Lesson 9 (Check → Finish) has its backdrop and shadow
  • [ ] axe reports no button-name violation on that dialog

References

  • #15455
  • https://github.com/h5p/h5p-php-library/compare/4237a6c75a35a10ea78e303a4380938e2d958543...cb64a1f3884408487c3178e31fc140f5d45ca165

AI usage

Drafted by Claude Code from its review of #15455, at a maintainer's request. The bot checked the file paths against develop.

rtibblesbot avatar Oct 02 '26 13:10 rtibblesbot

Plan: Bump vendored H5P core to h5p/h5p-php-library@cb64a1f with its fonts and theme stylesheets bundled.

  • [ ] Bundle the split-out stylesheets and rebuild
  • [ ] Verify rendering in a live H5P activity
  • [ ] Self-review the produced code

Assumptions — the issue did not settle these; say so if one is wrong.

  • h5p-fonts.css is exempted whole, per the issue: ships Inter + Open Sans (~1 MB woff2); if too heavy, keep only the h5p/h5p-theme faces.
  • Existing imports reorder to upstream's (confirmation-dialog before core-button); if wrong, the cascade between those two differs from upstream's.
  • No OFL/LICENSE text is copied beside the Inter and Open Sans woff2; if redistribution needs it, copy fonts/*/OFL.txt and LICENSE.txt into static/h5p/.
  • Any H5P activity with a Check → Finish confirmation dialog stands in for "Lesson 9"; if that lesson exercises something else, QA misses it.

@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly

How was this generated?
  • Implemented code following the pre-approved plan using test-driven development (red-green-refactor)
  • Ran the project's full test suite and linter before committing
  • For UI changes: captured live screenshots to verify rendering
  • For backend changes: verified with example API/CLI output

rtibblesbot avatar Oct 04 '26 05:10 rtibblesbot

@rtibbles Blocked — these cannot be assumed either way:

  • Confirmation-dialog shadow: upstream cb64a1f removed it on purpose (8703485d "VA-1168 Remove popup shadow"). Restore it with a Kolibri override stylesheet after the vendor CSS (box-shadow: 0 0 6px 6px rgba(10,10,10,.3)), or drop "shadow" from the AC and match upstream?

@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly

How was this generated?
  • Implemented code following the pre-approved plan using test-driven development (red-green-refactor)
  • Ran the project's full test suite and linter before committing
  • For UI changes: captured live screenshots to verify rendering
  • For backend changes: verified with example API/CLI output

rtibblesbot avatar Oct 04 '26 05:10 rtibblesbot

Restore with the override.

rtibbles avatar Oct 04 '26 16:10 rtibbles