Skip to content

Per 10621 thumbnail autorefresh - #1113

Draft
cecilia-donnelly wants to merge 4 commits into
mainfrom
per-10621-thumbnail-autorefresh
Draft

Per 10621 thumbnail autorefresh#1113
cecilia-donnelly wants to merge 4 commits into
mainfrom
per-10621-thumbnail-autorefresh

Conversation

@cecilia-donnelly

@cecilia-donnelly cecilia-donnelly commented Aug 2, 2026

Copy link
Copy Markdown
Member

We had a couple bugs preventing thumbnails from appearing immediately on upload, as they should. This is adding some perceived slowness to the app.

These changes need careful review, but seem to make thumbnails appear on upload again which is desirable.

Warning

The major issue here is that the fixes need to touch a service DataService and a component FolderPickerComponent that are present in a lot of places and the code we introduce cannot be isolated. The fixes will need a lot of testing outside the thumbnails scope.
Also, this fix just bypasses a big problem we are having accross the app. We are mutating objects in place instead of replacing them, so even if the reference is the same, the object has changed. This makes any object highly unreliable for using it inside an Angular context.

This would be the behavior for records:
https://www.loom.com/share/b3cbb52bf5bc4c03a0bf2c57d658ad83

Manual test cases

Thumbnail appears after upload

(Private view - run in both list view and grid view)

Single image

  1. Upload one JPG into the open folder.
    • EXPECTED: the row appears immediately with no thumbnail, then the thumbnail fills in on its own within a few seconds. No page refresh, no navigating away.

Several images at once

  1. Upload 5 JPGs in one go. Do not do anything else.(click, reload etc.).
    • EXPECTED: every one of them gets its thumbnail, not all at once. None is left permanently blank.
  2. Repeat with a mix of file types (JPG, PNG, PDF, a .zip).
    • EXPECTED: images and PDFs get thumbnails; the zip keeps its archive icon; nothing else is disturbed.

Leaving the folder mid-refresh

  1. Upload a JPG and immediately navigate to another folder before the thumbnail appears.
    • EXPECTED: navigation is instant and the new folder behaves normally.
  2. Navigate back into the original folder.
    • EXPECTED: the thumbnail is there or appears shortly.

Lazy loading other thumbnail sizes

(Private view - run in list view)

Clicking a row before it has loaded

  1. Click a row that has a blank thumbnail.
    • EXPECTED: The image in the sidebar loads at some point, with no refresh.

Double clicking a row before it has loaded

  1. Double click a row that has a blank thumbnail.
    • EXPECTED: The image in full screen loads.

Share previews

(covered by specs — still verify once by hand, this is the highest-risk behaviour in the branch)

Listed share (preview toggle on)

  1. Open a share preview link for a share that is restricted.
    • EXPECTED: every record shows a stock placeholder image from assets/img/preview/. No real file content is visible anywhere on the page.
  2. Wait 10 seconds on the page, then look again.
    • EXPECTED: still stock images. A late-arriving real thumbnail must never replace one.

Unlisted share

  1. Open an unlisted share link.
    • EXPECTED: real thumbnails are shown.

Public archive(My testing on local of this is unreliable, as some functionality is not available)

Record thumbnails on first load

  1. Open a public archive that contains images.
    • EXPECTED: grid view, and every image tile shows its thumbnail without a refresh.

Folder tiles

  1. Look at a folder tile whose folder contains images.
    • EXPECTED: the tile shows a thumbnail borrowed from one of those images.
  2. Open a folder that is empty.
    • EXPECTED: the tile shows the folder_open icon rather than a broken image.
  3. Open a folder containing only subfolders, and one containing only non-image files.
    • EXPECTED: perm_media for subfolders-only, description for mixed non-image files. No blank tiles.

Navigation

  1. Navigate several folders deep and back out using the breadcrumbs.
    • EXPECTED: thumbnails render at every level.
  2. Switch to a timeline-view folder if the archive has one.
    • EXPECTED: it loads. Timeline thumbnails appear.

Move and Copy through the folder picker (I could not run all of them on local, because of how local BE systems are configured)

(no thumbnails involved — this is regression cover for the picker template change)

Move a single item

  1. Click on a row, choose Move from the top menu. Navigate into a subfolder and confirm.
    • EXPECTED: the picker lists folders only, with folder icons and no image thumbnails. The move succeeds and the list refreshes.

Copy a multi-selection

  1. Multi-select several items, including at least one folder, and choose Copy.
    • EXPECTED: the folders being copied are not offered as destinations.
    • EXPECTED: the copy succeeds and a success message appears.

Picker navigation

  1. Inside the picker, navigate several folders deep and use Back.
    • EXPECTED: the trail is correct(current folder name at the top) and the destination button(Move, Copy) enables/disables appropriately.

Choosing a profile photo or banner

(covered by specs — still verify once by hand)

Thumbnails on first open

  1. Open the profile panel from the left menu, click the profile photo, and navigate into a folder of images.
    • EXPECTED: thumbnails appear as soon as the folder lists. You should not have to select an image or leave and come back to make them show up.
  2. Do the same for Change Banner.
    • EXPECTED: same behaviour.

Selected record preview in picker

  1. While in the profile panel, image profile picker, click one of the images in the picker.
    • EXPECTED: the large preview above the footer shows that image, not a blank box.
  2. Press Back.
    • EXPECTED: you return to the list with thumbnails still showing.

The photo updates in place

  1. While in the profile panel, image profile picker, choose an image and confirm.
    • EXPECTED: the profile photo in the panel updates immediately after the picker closes. No refresh, no navigating away.
  2. Change the banner too.
    • EXPECTED: the banner updates immediately, as it did before this branch.

Cancelling

  1. Open the picker for the profile photo and cancel without choosing.
    • EXPECTED: the existing photo is unchanged.
  2. Do the same for the banner.
    • EXPECTED: the existing banner is unchanged.

@codecov

codecov Bot commented Aug 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.12195% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.38%. Comparing base (8c2bb85) to head (6b23183).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
.../components/profile-edit/profile-edit.component.ts 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1113      +/-   ##
==========================================
+ Coverage   52.26%   52.38%   +0.12%     
==========================================
  Files         354      354              
  Lines       12093    12117      +24     
  Branches     2186     2191       +5     
==========================================
+ Hits         6320     6348      +28     
+ Misses       5550     5543       -7     
- Partials      223      226       +3     

☔ 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.

@cecilia-donnelly
cecilia-donnelly force-pushed the per-10621-thumbnail-autorefresh branch 4 times, most recently from d7506a6 to 3249b4a Compare August 2, 2026 13:38
@cecilia-donnelly

Copy link
Copy Markdown
Member Author

@aasandei-vsp , can we pair on this? It is a bigger change than I expected when I picked it up! I thought the first commit would do it.

@cecilia-donnelly

Copy link
Copy Markdown
Member Author

This appears to be working, but a note from Claude for our discussion: "Two threads for later: the id normalization to strings (which retires isSameId), and hideItemsInCurrentFolder carrying the same parentFolder_linkId mismatch — likely swept up by the same work."

cecilia-donnelly and others added 3 commits August 4, 2026 14:42
This only works for the first thumbnail of an uploaded set.
This is a more complex fix that should get in-depth review, since it
changes the data service and I am not confident in it. Claude suggests
that in the switch to the stela "children" endpoint we missed a couple
points. We weren't correctly tracking the responses because of the
string/number id mismatch, so there are some workarounds for that in
here.
… from BE

After upload, the thumbnail is not immediatelly generated, so we keep calling
the BE until it is available. So the list item will subscribe to this refresh
and populate the thumbnail whenever is available.

One important thing to mention is that thumbnails should not be available for
restricted shares, so making sure that we only show it after we check if the
share is restricted or not is vital, that's why the isUnlistedShare variable
is needed.

Issue: PER-10580
@aasandei-vsp
aasandei-vsp force-pushed the per-10621-thumbnail-autorefresh branch from 3249b4a to 74a5094 Compare August 4, 2026 11:50
…ilable

This fix just bypasses a big problem we are having accross the app. We are
mutating objects in place instead of replacing them, so even if the reference
is the same, the object has changed. This makes any object highly unreliable
for using it inside an Angular context.

In this situation, we were using a pipe for rendering the thumbnails,
which is the correct approach. The issue is the pipe would update when
the object reference changes, which never happens in our case, even
though the thumbnailUrls do.

Issue: PER-10580
@aasandei-vsp aasandei-vsp self-assigned this Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants