Skip to content

Show a friendlier message for legacy .elp packages (contentv3, no index.html) and save as .elpx on first edit #20

@erseco

Description

@erseco

Summary

Legacy .elp packages produced by old eXeLearning versions (ones that contain contentv3.* and no index.html) currently fail to open with a raw technical error. We should detect that shape, show a user-friendly notice explaining the file is from an older eXeLearning version, and on save migrate it to the modern .elpx extension.

Current behavior

Opening a legacy .elp in the Nextcloud viewer surfaces this error:

Failed to open eXeLearning package.
The package does not contain an index.html.

Show details
Error: The package does not contain an index.html.
at Proxy.open (http://localhost:8080/custom_apps/exelearning/js/exelearning-view.js?v=…:2:220225)

That message is accurate but unhelpful — it tells the user nothing about why the file is broken or what to do about it.

Desired behavior

  1. Detection. When the package is opened and index.html is absent, peek inside the zip for contentv3.* (or any other reliable legacy marker — contentv2.*, the absence of index.html, etc.). If it matches the legacy shape, branch into the legacy path instead of throwing the raw error.

  2. User-facing notice. Show a notice / modal along the lines of:

    This file is from an older version of eXeLearning and cannot be previewed directly. Open it in the editor to migrate it to the current format — saving will store it as .elpx.

    With a primary action Open in eXeLearning editor (the editor handles the migration automatically when loading legacy projects).

  3. Save-as-.elpx. When the editor saves a project that originated from a legacy .elp, the file written back to Nextcloud should use the .elpx extension (renaming the original, or leaving the .elp in place and adding <basename>.elpx — pick whichever is least surprising; renaming is what the desktop eXeLearning does).

Acceptance criteria

  • Opening a legacy .elp (one with contentv3 and no index.html) shows the friendly notice, not the raw Error: string.
  • The notice offers a one-click way to open the file in the bundled editor.
  • Saving from the editor writes a .elpx (extension migrated) and the new file is what shows up in the Files list afterwards.
  • A modern .elpx is unaffected — it still previews as today.

Notes

  • The legacy detection should live before the current "no index.html" check in src/elpx/ so the error path is the new branch, not the existing throw.
  • The application/vnd.exelearning.elpx MIME mapping registered by make up only covers .elpx; legacy .elp files arrive as application/zip. The viewer should still be the registered handler for both, or we wire up a second MIME entry — needs a decision in implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions