Skip to content

feat(previews)!: read the enabled preview providers from the capability - #10

Merged
skjnldsv merged 1 commit into
mainfrom
feat/preview-capability
Sep 9, 2026
Merged

feat(previews)!: read the enabled preview providers from the capability#10
skjnldsv merged 1 commit into
mainfrom
feat/preview-capability

Conversation

@skjnldsv

@skjnldsv skjnldsv commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

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-state stops 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-by trailer.

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>
@skjnldsv skjnldsv added status: review Waiting for reviews type: breaking 💥 changes that require a new major version AI assisted labels Sep 9, 2026
@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.03%. Comparing base (ed534ef) to head (6e06187).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@skjnldsv
skjnldsv merged commit 37e69a1 into main Sep 9, 2026
18 checks passed
@skjnldsv
skjnldsv deleted the feat/preview-capability branch September 9, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI assisted status: review Waiting for reviews type: breaking 💥 changes that require a new major version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant