feat(previews)!: read the enabled preview providers from the capability - #10
Merged
Conversation
Whether the viewer offers heic, heif, tiff and friends depends on which preview providers the server has enabled. That arrived as an initial state the viewer app provided on every page, which is the last thing tying the library to an app of its own. It is a core capability now, so the library reads it wherever capabilities are, public share pages included, and @nextcloud/initial-state stops being a peer dependency. BREAKING CHANGE: needs a server exposing core.previews.enabled_providers. On an older one no preview-only mime is offered, which is what a server with the providers disabled reports anyway. Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10 +/- ##
==========================================
+ Coverage 71.85% 72.03% +0.17%
==========================================
Files 33 33
Lines 2285 2285
Branches 375 377 +2
==========================================
+ Hits 1642 1646 +4
+ Misses 637 633 -4
Partials 6 6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Sep 9, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Whether the viewer offers heic, heif, tiff and the other preview-only mimes depends on which preview providers the server has enabled. That list arrived as an initial state, provided on every page by the viewer app — the last thing tying the library to an app of its own.
It becomes a core capability,
core.previews.enabled_providers, so the library reads it wherever capabilities already are, public share pages included, and@nextcloud/initial-statestops being a peer dependency.Needs the matching server change (nextcloud/server#63954). On a server without it,
getCapabilities()returns nothing for previews and no preview-only mime is offered — the same thing a server with those providers disabled reports today, so it degrades rather than breaks.Covered by a spec that registers the image handler against a server reporting a heic provider, one reporting only jpeg, and one reporting nothing.
👾 This pull request was assisted by Claude Code, commits carry an
Assisted-bytrailer.