Preflight: stop white lines along the edges of full-page pictures

All gates green, both reviewers terminal and quiet at HEAD, nothing waiting on you.

Ready for review Mergeable Bots quiet 0 decisions waiting Board: Personal Review
PR #8459 Files changed Commits BL-17009 Devin review

What this PR is about

Problem

When a picture is meant to fill its area, a thin white line often shows along one or more of its edges. It happens most after dragging the origami splitter until the picture looks like it fills its pane, and with Fit Space or Expand to Fill Space. It is most noticeable where the picture runs to the edge of the page.

Cause

Bloom fits a background picture inside its picture area without cropping. Origami split positions are percentages, so the area is almost never exactly the picture's shape, and a sliver of 0.02 to 0.3px is left over. Fit Space had the same problem because it sized to whole pixels. Chrome also snaps an image to whole pixels before applying the Edit tab's zoom, so the drawn picture can stop up to another half pixel short. Either way, the white page shows through.

Magnified top edge of a picture: before, a strip of white page shows between the picture and the edge; after, the picture overhangs by 1px and is clipped.

What the PR does

  • A background picture now overhangs each edge of its picture area that it reaches, or comes within 2px of reaching, by 1px. The area already clips it, so the overhang is never seen. This holds in both fit modes. The picture keeps its proportions, and a cropped picture keeps its crop.
  • Pages fitted before this change re-fit once when they are opened.
  • Fit Space counts as already done when the picture covers the whole area, is centred, and is enlarged no more than the overhang explains.
  • When the origami splitter resizes a pane, overlays on the picture keep their place. The repositioning code works out the size the picture was fitted to from its size and centred position.

Quality gate

CheckResult
TypecheckPassed
Lint (eslint, changed files)Passed
TypeScript tests (vitest, full suite)Passed 1194 tests ยท 96 files
C# tests (dotnet test)Not run: no C# in the diff, and the C# tests neither build nor read the front-end code.
Merge with masterUp to date, mergeable
Repo check: e2e specs at the nightly's window sizeDid not apply: the diff adds or changes no e2e specs.

What changed this run

This was the first run. It moved the branch onto master, opened the draft PR, and fixed four bugs that review found in how Fit Space and the origami resize treat the overhang. Two were found by the light review and two by Devin. See the commit list.

Reviewer outcomes

ReviewerOutcome
Local review (light sub-agent pass)2 findings, both fixed. Fit Space stayed enabled after use on wide canvases, and counted a near-miss as done; its "already done" check was rewritten.
DevinComplete. Round 1 raised 2 bugs, both fixed: overlays pinned left after an origami resize, and Fit Space unable to re-centre an off-centre crop. The re-review at HEAD marks both resolved, with no new findings and no flags.
CI (pr-automation)Passed
CodeRabbitNot active: the repo's config turns automatic review off.

Worth knowing

  • Not fixed, by agreement: at some zoom levels a light pixel column can still show exactly at the page edge where a picture runs off the page. Chrome anti-aliases the white page background and the clipped picture separately at a page edge that falls mid-pixel. The tester notes say so.
  • The overlay fix (origami resize) and the off-centre crop case are covered by unit tests only. Nobody has dragged the splitter in Bloom on a page with bubbles, or re-centred a crop with Fit Space. Fit Space greying out after a fit was checked in the running Bloom.
  • The test book's own image files also had white edge rows. Those were trimmed by hand and are not part of this PR.

Decisions

Nothing is waiting on you. You settled the two open questions during the run: leave the page-edge line for later, and apply the overhang in every theme.