Skip to content

feat(viewer): show a picture's blurhash, at its size, while it loads - #145

Merged
skjnldsv merged 1 commit into
mainfrom
feat/blurhash-placeholder
Oct 15, 2026
Merged

skjnldsv merged 1 commit into
mainfrom
feat/blurhash-placeholder

Conversation

@skjnldsv

@skjnldsv skjnldsv commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

While a picture loads, the viewer shows a spinner on an empty backdrop. When the server keeps the picture's blurhash and its size, it now shows its blurred colours instead, in the box the picture will take, so nothing moves when it lands.

Relates to nextcloud/viewer#703

Loading Loaded

A blurhash says nothing of a picture's proportions, so it takes both: metadata-blurhash, which the server generates, and metadata-photos-size, which the Photos app records with the EXIF rotation applied. Photos nodes carry both. Files asks for the blurhash only, so the image handler has Files lists ask for the size too. Registering that property pulls the webdav client into the registration chunk until @nextcloud/files ships nextcloud-libraries/nextcloud-files#1792.

The size also sets how far the picture zooms before the sharper preview has been fetched. It is only a starting point that loading can raise: Photos fills in 256×256 for a file it has not read yet.

Component tests cover the placeholder's size, the spinner alone with a blurhash but no size, and the zoom. A playground test opens photo.jpg with its real blurhash and size, slowed down, and checks the placeholder's proportions and that the picture lands in the same box.

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

@skjnldsv skjnldsv added this to the 2.0.0 milestone Oct 15, 2026
@skjnldsv skjnldsv self-assigned this Oct 15, 2026
@codecov

codecov Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.18182% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.42%. Comparing base (6cb232b) to head (97a3cf6).

Files with missing lines Patch % Lines
lib/components/Images.vue 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #145      +/-   ##
==========================================
+ Coverage   92.34%   92.42%   +0.07%     
==========================================
  Files          48       49       +1     
  Lines        4051     4103      +52     
  Branches      887      898      +11     
==========================================
+ Hits         3741     3792      +51     
- Misses        289      290       +1     
  Partials       21       21              

☔ 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 requested review from mejo- and susnux October 15, 2026 13:31

@artonge artonge left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a call to registerDavProperty for those two props, I assume the Viewer simply uses them if it finds them?

@skjnldsv

Copy link
Copy Markdown
Contributor Author

I don't see a call to registerDavProperty for those two props, I assume the Viewer simply uses them if it finds them?

nope, it's absolutely needed, you're right!
We just need nextcloud-libraries/nextcloud-files#1792 too to ensure we don't ship the whole webdav code here too

A picture whose blurhash and size the server keeps (the size comes from
the Photos app) shows as its blurred colours, in the box it will take,
instead of a spinner alone. Its size also sets how far the picture
zooms before the sharper preview has been fetched. The image handler
has the Files list ask for the size, as Files asks for the blurhash.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
@skjnldsv
skjnldsv force-pushed the feat/blurhash-placeholder branch from 1fbf0eb to 97a3cf6 Compare October 15, 2026 14:08
@skjnldsv
skjnldsv enabled auto-merge October 15, 2026 14:10
@skjnldsv
skjnldsv merged commit c2257a3 into main Oct 15, 2026
21 checks passed
@skjnldsv
skjnldsv deleted the feat/blurhash-placeholder branch October 15, 2026 14:12
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.

2 participants