PER-10621: use Archivematica thumbnails#1051
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1051 +/- ##
==========================================
+ Coverage 52.13% 52.22% +0.09%
==========================================
Files 354 354
Lines 12085 12090 +5
Branches 2181 2186 +5
==========================================
+ Hits 6300 6314 +14
+ Misses 5555 5551 -4
+ Partials 230 225 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
46004fa to
309741d
Compare
2e54c37 to
b63b1dc
Compare
9ce98b6 to
b071b9e
Compare
b071b9e to
18db8cd
Compare
|
I think this is ready for review now @slifty -- I would test it on dev. |
There was a problem hiding this comment.
Pull request overview
Updates the web-app’s thumbnail handling to prefer Archivematica’s 256px thumbnails so thumbnails can still render when other sizes are missing, aligning with the post-#923 thumbnail access approach.
Changes:
- Avoids re-queuing thumbnail refreshes when a 256px thumbnail is already present.
- Adjusts Stela record shaping to read thumbnail URLs from a
thumbnailUrlsmap (including256) and maps them ontoRecordVO. - Adds
thumbnail256to the lean whitelist and adds a unit test for the Stela record conversion.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/app/shared/services/data/data.service.ts | Tweaks missing-thumbnail detection to account for thumbnail256. |
| src/app/shared/services/api/record.repo.ts | Updates Stela record typing and conversion to use thumbnailUrls (including 256). |
| src/app/shared/services/api/record.repo.spec.ts | Adds test coverage for mapping thumbnailUrls onto RecordVO thumb fields. |
| src/app/shared/services/api/base.ts | Adds thumbnail256 to LeanWhitelist so lean responses can include the 256px thumbnail. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Dang here I was ready to hit approve, but at least a few of the things copilot found look legitimate |
73eff00 to
6eff793
Compare
Map the 256 size thumbnail from the stela response to the record and folder. Also check for any thumbnail from the data service when deciding whether or not to refresh an item.
6eff793 to
91ecedc
Compare
|
At last I believe this is ready for re-review, @aasandei-vsp ! Sorry for the long wait. |
Use the 256 size thumbnails wherever possible in the web-app. This is a followup to #923, which changed the way we load thumbnails in general. With this change, thumbnails will appear even if the other sizes are not available.
For thumbnails to appear in the file list, it needs companion PR https://github.com/PermanentOrg/back-end/pull/881. This one alone fixes the thumbnail in the sidebar editing modal.
I tested this by uploading a record on dev, checking to make sure that it got an Archivematica thumbnail (
thumbnail256was not null), then runningupdate record set thumburl200 = null, thumburl500 = null, thumburl1000 = null, thumburl2000 = null where recordid = _ID_OF_NEW_RECORDin the database directly.I mentioned this in the commit message, but I'm not sure this test is particularly useful - I just wanted to guard against a regression here somehow. Suggestions welcome!