Skip to content

File icons: only .elp and .elpx should use the eXeLearning icon, not every .zip #21

@erseco

Description

@erseco

Summary

Right now every .zip file in the Files app picks up the eXeLearning icon, not just .elpx packages. The icon should only apply to actual eXeLearning files — driven by extension (.elp legacy, .elpx modern) — and plain .zip files should fall back to Nextcloud's default archive icon.

Bonus ask: if Nextcloud lets us, give legacy .elp files a slightly different icon (a badge, a muted variant, anything visually distinguishable) so users can spot at a glance that the file is from an older eXeLearning version (see #20 for the migration path).

Root cause (suspected)

The current mapping registered by make up and documented in the README is:

{ "elpx": ["application/vnd.exelearning.elpx", "application/zip"] }

That part is fine — it only tags .elpx files. The problem appears when config/mimetypealiases.json aliases application/zip (or some equivalent) to the exelearning icon: every zip in Nextcloud then inherits the icon. The alias should be on application/vnd.exelearning.elpx only, not on application/zip.

(Confirming the exact source is part of the implementation work — the symptom is reproducible: upload any unrelated .zip and it gets the eXeLearning icon in the Files list.)

Desired behavior

  • .elpx → eXeLearning icon (current behavior, keep it).
  • .elp → eXeLearning icon, ideally with a distinguishing mark (badge, faded colour, "legacy" overlay) so users see it differs from .elpx.
  • .zip → Nextcloud's default archive icon. Unchanged from a vanilla Nextcloud install.
  • Anything else → untouched.

Acceptance criteria

  • Upload a non-eXeLearning .zip to Files. It shows the default archive icon, not the eXeLearning icon.
  • Upload a .elpx and a legacy .elp. Both show eXeLearning-themed icons, visibly distinguishable from each other.
  • The fix survives make down && make up (it must be done by something the app installs, not a manual config edit by the user).
  • No regression in the preview/viewer path — clicking the file still opens the viewer/editor as today.

Notes / implementation hints

  • Nextcloud's icon system is extension → MIME → icon name. The chain to inspect:
    • config/mimetypemapping.json (extension → MIME) — what make up writes.
    • config/mimetypealiases.json (MIME → icon-name) — likely the source of the over-broad icon, if it aliases application/zip.
    • img/<name>.svg shipped by the app — the actual icon assets.
  • If content-based detection (zip sniffing) inside the icon path isn't feasible (Nextcloud renders icons from MIME alone), going by extension alone is acceptable: .elp/.elpx get the eXeLearning icon, .zip does not. That matches what the user expects.
  • For the legacy badge, options:
    • Ship a second SVG (img/elp-legacy.svg) and alias application/x-exelearning-legacy (or whatever MIME we settle on for .elp) to it.
    • Or one SVG with an inline <text>v2</text> overlay if we want to avoid a second asset.

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