Skip to content

fix(reader): texture the scrolled-mode top inset mask - #4563

Merged
chrox merged 1 commit into
mainfrom
fix/scrolled-notch-texture-4486
Jun 12, 2026
Merged

fix(reader): texture the scrolled-mode top inset mask#4563
chrox merged 1 commit into
mainfrom
fix/scrolled-notch-texture-4486

Conversation

@chrox

@chrox chrox commented Jun 12, 2026

Copy link
Copy Markdown
Member

Closes #4486

Problem

In scrolled mode with a background texture, the top safe-area (unsafe header) strip renders as a flat untextured block (reporter's screenshot, and reproduced on a Xiaomi 13):

The notch-area div in SectionInfo masks the top inset with opaque bg-base-100 at z-10 so content scrolling under the status bar is hidden — but the texture paints at the z-0 layer (.foliate-viewer::before), so the mask occludes it.

Fix

  • Give the mask its own texture overlay: add .notch-masked::before to the texture CSS in styles/textures.ts (gated to the scrolled-horizontal case via a conditional class, so the paginated/vertical transparent notch is untouched).
  • Make the notch element span the grid cell (inset-0) and clip its visible/hit area down to the inset strip with clip-path: inset(0 0 calc(100% - topInset) 0). background-size: cover/contain resolves against the element box, so sharing the viewer's paint box is what keeps the mask's texture tiles aligned with .foliate-viewer::before at the seam. clip-path also clips hit-testing, so the click target stays the inset strip, exactly as before.
  • mix-blend-mode: multiply blends against the notch's own opaque bg-base-100 inside its z-10 stacking context — identical color math to the viewer area below.

Verification on a Xiaomi 13 (fuxi)

Drove the installed app over adb + CDP with scrolled mode + Leaves texture (cover):

  • Before: flat strip over the inset; the strip→texture boundary measures row-to-row MAE 11913 (hard seam).
  • After applying the exact CSS this change produces: the strip renders the texture and the same boundary measures MAE 230 — the level of ordinary adjacent texture rows, i.e. pixel-continuous tiles.
  • elementsFromPoint: the notch is hit-testable inside the strip and absent from the stack mid-screen, so content taps are unaffected.

Tests

  • SectionInfo.test.tsx: notch spans the cell, clips to the inset, and carries notch-masked only in scrolled horizontal mode (transparent notch in paginated/vertical stays untextured).
  • textures.test.ts: mounted texture CSS covers .notch-masked::before.

🤖 Generated with Claude Code

In scrolled mode the notch-area masks the top safe-area inset with
opaque bg-base-100 so content scrolling under the status bar is hidden,
but it painted over the background texture (.foliate-viewer::before at
the z-0 layer), leaving a flat untextured strip across the unsafe
header area.

Give the mask its own texture ::before (.notch-masked in textures.ts)
and make the element span the grid cell, clipped down to the inset
strip with clip-path — background-size cover/contain resolves against
the element box, so the full-cell box is what keeps the mask's tiles
aligned with the viewer's at the seam. clip-path also clips
hit-testing, so the click target stays the inset strip only.

Verified on a Xiaomi 13: the strip now renders the texture with a
pixel-continuous seam (row-to-row MAE at the boundary dropped from
11913 to 230, the level of ordinary texture rows), and
elementsFromPoint confirms the notch is hit-testable only inside the
strip.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@chrox
chrox merged commit ee01fcd into main Jun 12, 2026
10 checks passed
@chrox
chrox deleted the fix/scrolled-notch-texture-4486 branch June 12, 2026 15:39
dalzyu added a commit to dalzyu/readest-hermes that referenced this pull request Jun 18, 2026
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.

About the scrolling mode header display

1 participant