Repository navigation
Fix canvas description for v3 summaries and language-tagged v2 values - #4617
Merged
marlo-longley merged 1 commit intoOct 30, 2026
Merged
Conversation
getCanvasDescription returned the raw v2 `description` property. A Presentation 3 canvas `summary` was therefore never shown in the information panel, and a language-tagged v2 description reached SanitizedHtml as an object or array and was rendered as "[object Object]". Read `summary`, falling back to `description`, and resolve it for the current locale with PropertyValue, the same way the manifest summary is handled. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4617 +/- ##
=======================================
+ Coverage 94.9% 94.9% +0.1%
=======================================
Files 394 394
Lines 5846 5848 +2
Branches 2002 2003 +1
=======================================
+ Hits 5546 5548 +2
Misses 271 271
Partials 29 29 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
marlo-longley
approved these changes
Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "Current item" section of the information panel never shows the
summaryof a Presentation 3 canvas, and a language-tagged Presentation 2 canvasdescriptionshows up as[object Object].getCanvasDescriptioninsrc/state/selectors/canvases.jsreturnedcanvas.getProperty('description')as-is. Presentation 3 renamed that property tosummary, and the spec says clients SHOULD rendersummaryon a Canvas (3.0 § summary). So for v3 canvases the selector always returnsundefined. For example, both canvases in https://iiif-test.github.io/March2025/manifests/manifest.json have a summary that is not displayed. In v2 the value can also be a language-tagged object or an array of them:That value reaches
SanitizedHtmlunparsed, and DOMPurify turns it into the string[object Object],[object Object].The selector now reads
summaryand falls back todescription. It then picks the value for the current locale withPropertyValue.parse(...).getValue(locale), the same way the manifest summary is handled (#3633, #3780). It uses the samegetManifestLocaleasgetCanvasLabelandgetCanvasMetadata, so it also follows the locale picker. Plain string descriptions come back unchanged.I added tests to
__tests__/src/selectors/canvases.test.jsfor a v3 summary, a localized v2 description, and the two empty cases. I ran that file under Node 22 with a minimal jest-compatible runner against manifesto.js 4.3.5 and reselect 5.2.0. Onmain, the v3 and v2 cases fail: one returnsundefinedand the other returns the raw array. With this change all 26 tests in the file pass. I did not run lint, prettier or the full vitest suite locally.🤖 Generated with Claude Code