Skip to content

fix(mobile): stop a covered file preview from painting through the one above it - #828

Merged
huichen merged 1 commit into
mainfrom
fix/preview-stack-overlap
Sep 25, 2026
Merged

huichen merged 1 commit into
mainfrom
fix/preview-stack-overlap

Conversation

@huichen

@huichen huichen commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

A document linked from a previewed document opens as a second layer over the first, and the covered layer stays mounted on purpose so that going back returns to the same place. Those layers were absolutely positioned with no background, while a document's text is transparent — so the two documents drew over each other: both headers in one row and the covered document's lines showing through between the top document's.

Paint every layer with the surface color, which is what makes "later siblings paint on top" actually hide what is below:

  • previewLayer gains backgroundColor: colors.surface (same color previewSafe already paints).
  • Regression test in the preview stack suite asserts both layers are opaque; it fails without the style (backgroundColor is undefined) and passes with it.

Checks: mobile tsc --noEmit, eslint on the touched files, and full mobile jest (125 suites / 1923 tests) green.

…e above it

Opening a document linked from a previewed document stacks a second layer over the first, and the covered layer stays mounted on purpose so that going back returns to the same place. The layers were absolutely positioned with no background and a document's text is transparent, so the two documents drew over each other: both headers in the same row, and the covered document's lines showing through between the top document's.

Paint every layer with the surface color, which is what makes later siblings painting on top actually hide what is below them.

The test fails without the style (backgroundColor undefined) and passes with it.
@huichen
huichen enabled auto-merge (squash) September 25, 2026 10:31
@huichen
huichen merged commit 95e228c into main Sep 25, 2026
12 checks passed
@huichen
huichen deleted the fix/preview-stack-overlap branch September 25, 2026 10:34
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.

1 participant