Skip to content

Reset zoom and center on each page#4220

Merged
jcoyne merged 4 commits intomainfrom
marlo-pres-view
Mar 13, 2026
Merged

Reset zoom and center on each page#4220
jcoyne merged 4 commits intomainfrom
marlo-pres-view

Conversation

@marlo-longley
Copy link
Copy Markdown
Member

@marlo-longley marlo-longley commented Jan 16, 2026

Addresses:
#4217
#4199

  • Change default to preserveViewport: false
  • Reset zoom and center on each page
  • Add a test for OpenSeadragonComponent
  • If initialViewerConfig is set, override preserveViewport: false

This is different from the aspect ratio calculation (#4117) and just recalculates the center if the bounds change at all. I'm interested to hear opinions on that -- it was just easier for me to get my head around but might not be what we want.

Behavior resulting from this PR:

  • preserveViewport: false: each page resets its zoom and center, including between pages with different bounds/sizes (such as paging from a cover --> 2-page book spread)
  • preserveViewport: true: zoom and pan is kept between pages. Re-centering does not occur between pages with different bounds/sizes. If you are zoomed in on a book cover, and then page into a 2-page spread, the spread will be off-center. If you then center the 2-page spread and continue to page forward, the rest of the 2-page spreads will be centered.

Seeking input on:

  • initialViewerConfig (to test, see the demo page at https://deploy-preview-4220--mirador-dev.netlify.app/viewer-config) -- now that preserveViewport is actually working, I would love input on this setting. Right now if initialViewerConfig is set and preserveViewport: false (again, this is the new default), the manifest loads the initialConfig, but on paging forward, the views are reset. Is this the intended behavior?

@marlo-longley marlo-longley marked this pull request as draft January 16, 2026 22:14
@marlo-longley marlo-longley force-pushed the marlo-pres-view branch 2 times, most recently from c45d2b5 to aaf65ee Compare January 20, 2026 17:53
@marlo-longley marlo-longley marked this pull request as ready for review February 12, 2026 15:54
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 96.77419% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 95.2%. Comparing base (ff5ec95) to head (e78884b).
⚠️ Report is 24 commits behind head on main.

Files with missing lines Patch % Lines
src/state/sagas/windows.js 83.4% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #4220     +/-   ##
=======================================
- Coverage   95.3%   95.2%   -0.0%     
=======================================
  Files        326     326             
  Lines      16200   16220     +20     
  Branches    2555    2569     +14     
=======================================
+ Hits       15423   15440     +17     
- Misses       772     774      +2     
- Partials       5       6      +1     

☔ View full report in Codecov by Sentry.
📢 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.

@jcoyne jcoyne merged commit 7b6d23b into main Mar 13, 2026
9 checks passed
@jcoyne jcoyne deleted the marlo-pres-view branch March 13, 2026 17:18
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