Repository navigation
A cold turn of the iPad opens a whole spread, and turning back keeps his page - #324
Open
arimendelow wants to merge 4 commits into
Open
arimendelow wants to merge 4 commits into
arimendelow wants to merge 4 commits into
Conversation
…er (#302) The cold-turn check counted a look from before the turn as the whole spread. Two iPad tests now judge the turn in frames and reads: the display frames the unfold's leaf stood risen waiting on its spread, screenshot looks with a blank page or a standing grey band, the chapter's page loaded anew, and his first words back upright. UI-test-only probes: reader.leafStoodFrames and reader.reflowFreshPages.
…his page (#302) Readium's default spread (.auto) flipped on every turn of the iPad and reloaded the chapter's page: the restore waited 3 to 10 s on the reload while the unfold's leaf stood risen over the old page with the right page blank, and the reload opened at the chapter's first page, the title page that flashed on the way back. Gatefold lays a reflowable spread out itself, so the spread is now .never (fixed-layout books keep Readium's). The page also opened with a placeholder width's margins (a phone's) and kept them until the columns changed, so an iPad read in portrait with the wrong margins until its first turn on its side; turned back, his words fell a third of a page down another page (16 became 17). A width change that calls for new margins now applies them.
…a second (#302 review) - The page gets new margins with the same columns only when the width crosses a step of the share or Readium's gutter, so a live resize no longer reflows on every width; fixed-layout books skip it, and the host settles a layout measured before it loaded. - The display link counting the standing leaf runs only under UI tests. - The cold-turn test allows the leaf a second of frames at the top of its rise (hosted runners: main 226, the fix 22), waits for a reflow newer than the one before the turn, and keeps screenshots only on failure. - ipad-rotate-midturn's timeout carries the two new tests.
… headroom (#302 re-review)
arimendelow
enabled auto-merge (squash)
November 12, 2026 19:59
This branch has not been deployed
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.
Fixes #302
Cold turn to landscape. Readium's default
spread: .autoflipped on every turn of the iPad and reloaded the chapter's page. The restore then waited 3–10 s for that reload, and meanwhile the unfold's leaf finished its 2.6 s lift and stood still over the old portrait page with the right page blank. Gatefold lays out a reflowable spread itself, in CSS columns, so the spread is now.neverfor reflowable books; fixed-layout books keep Readium's default.Rotate back. The reload opened at the chapter's first page, which caused the title-page flash. The off-by-one had a second cause: the page opened with margins for a placeholder width (a phone's) and kept them until the columns changed. So portrait was read with the wrong margins until the first turn on its side set the real ones, and back upright his words fell about a third of a page into another page.
updateLayoutnow gives the page its margins when the width crosses one of their steps (wide or narrow page share, or Readium's gutter breakpoint), even with the same columns. Within a step nothing changes, so a live resize doesn't reflow on every width, and fixed-layout books skip it.Tests (
RotationMidTransitionUITests, shardipad-rotate-midturn), judged in frames and reads:testAColdTurnOnItsSideOpensAWholeSpreadWithNoStandingLeafreads the display frames the risen leaf stood waiting (new UI-test probereader.leafStoodFrames). It counts screenshot looks with a blank page or a standing grey band while the leaf stood, or after the reflow settled.testTurnedOnItsSideAndBackHeIsOnHisPagecounts chapter reloads (new probereader.reflowFreshPages) and compares his first words before and after by hash.Red and green probes (not-for-merge branches running only these two tests on a hosted runner):
Locally (iPad Pro 13 simulator): on main the leaf stood 70 frames with 5 standing looks, the page reloaded 2 times, and his first words started 350 characters in. With the fix: 0 frames, 0 reloads, offset 0.
This touches
ReaderModel(place work for #259/#310 is in flight there):epubPreferencesgainsfixedLayout, andupdateLayoutgains the margins re-apply.