Skip to content

feat(images): show the file itself past the server's preview size - #172

Merged
skjnldsv merged 1 commit into
mainfrom
feat/preview-limit-original
Oct 22, 2026
Merged

skjnldsv merged 1 commit into
mainfrom
feat/preview-limit-original

Conversation

@skjnldsv

Copy link
Copy Markdown
Contributor

An admin can cap previews well below the screen size with preview_max_x/preview_max_y. The viewer then shows a small preview stretched over the screen, so pictures look blurry. The server now sends that cap in its capabilities (nextcloud/server#65714). When the preview would be smaller than the space it fills, the viewer loads the file itself instead.

This only applies to formats the browser can show on its own, and only when the share allows downloading. Older servers don't send the cap and keep the current behaviour.

Fixes nextcloud/viewer#3014

Not tried by hand on an instance with a low cap yet.

👾 This pull request was assisted by Claude Code, commits carry an Assisted-by trailer.

An admin can cap previews below the screen, and the picture then shows
blurred. The server now advertises the cap, so a picture the browser can
show is loaded whole when its preview would be smaller than the space.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
@skjnldsv skjnldsv added this to the 2.0.0 milestone Oct 22, 2026
@skjnldsv skjnldsv self-assigned this Oct 22, 2026
@codecov

codecov Bot commented Oct 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 91.99%. Comparing base (bffa989) to head (86e0c91).

Files with missing lines Patch % Lines
lib/utils/previewUtils.ts 93.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #172   +/-   ##
=======================================
  Coverage   91.99%   91.99%           
=======================================
  Files          54       54           
  Lines        4572     4587   +15     
  Branches      989      997    +8     
=======================================
+ Hits         4206     4220   +14     
  Misses        342      342           
- Partials       24       25    +1     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@skjnldsv
skjnldsv merged commit 599ba20 into main Oct 22, 2026
20 checks passed
@skjnldsv
skjnldsv deleted the feat/preview-limit-original branch October 22, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option to disable previews

1 participant