Skip to content

fix(cards): make the cover edge visible on the black page - #99

Merged
dyphire merged 1 commit into
mainfrom
fix/card-edge-on-cover
Nov 28, 2026
Merged

dyphire merged 1 commit into
mainfrom
fix/card-edge-on-cover

Conversation

@dyphire

@dyphire dyphire commented Nov 28, 2026

Copy link
Copy Markdown
Member

Why

On the pure-black theme a dark cover has no edge of its own. A grid card puts its title and series lines on #000000 under a #141416 cover, so the card runs into the page with nothing where it ends; the horizontal skeleton's surface fallback (#141416) is 1.1:1 against the page. The white 4 % shadow iOS uses to separate covers is too faint to survive that.

How

  • ColorScheme.cardBackground (Theme.kt): #2C2C2E in dark, surface in light — the value of iOS Color.cardBackground. A fixed step rather than a surfaceContainer* role, because the ladder above surface is already spoken for by dialog cards (surfaceContainerHigh / surfaceContainerHighest).
  • CoverArt ring (Components.kt): the port of iOS ThumbnailImage.borderOverlay — 0.5 dp onBackground at 15 % on the cover, drawn above the content overlay and above the placeholder.
  • Horizontal skeleton falls back to cardBackground instead of surface.
  • Grid cards in overlay mode paint the same ring on the same rect themselves, after their CardTextOverlay.

The bottom edge

The ring is stroked with drawWithContent inset by half its width instead of Modifier.border. border traces the outline, so half the hairline landed outside the rect and the text-overlay scrim that closes a card in overlay mode (0.88 black at its bottom) swallowed exactly that half — top, left and right of the ring survived, the bottom edge did not. Inking the stroke inside keeps the whole line on the cover. Overlay mode additionally needs the ring painted after the scrim, which is where iOS puts borderOverlay relative to the content overlay.

Verification

  • :app:compileDebugKotlin and :app:assembleDebug pass.
  • Checked against the reported screenshot: the placeholder card's ring was visible on three sides only (top row 54 vs 25 fill) and faded to nothing by the card bottom; the fix keeps all four sides at the same weight.

A dark cover on the pure-black theme has no boundary of its own: a grid card's
title and series lines sit on #000000 under a #141416 cover, and the card runs
into the page with no visible edge where it ends. The white 4 % shadow that
separates covers on iOS is too faint to survive that, and the horizontal
skeleton's `surface` fallback (#141416) is 1.1:1 against the page.

iOS never had the problem because `ThumbnailImage.borderOverlay` strokes a 0.5 pt
`Color.primary` ring at 15 % on the cover - its comment calls it "the card edge
where covers blend into the background" - and paints `Color.cardBackground`
(#2C2C2E) under its other cards. Port both: `CoverArt` rings the cover (and
the placeholder, which is what makes an unloaded grid read as cards at once),
and `ColorScheme` gains `cardBackground` for the untinted horizontal skeleton.

The ring is stroked with `drawWithContent` inside the cover rect instead of
`Modifier.border`. `border` traces the outline, so half of the hairline fell
outside the rect, and the text-overlay scrim that closes a card in overlay
mode (0.88 black at its bottom) swallowed exactly that half: the top, left and
right of the ring survived, the bottom edge - the one that has to separate the
card from the page - did not. A grid card in overlay mode now paints the same
ring on the same rect itself, after its `CardTextOverlay`, which is where
iOS's `borderOverlay` sits relative to the content overlay.
@dyphire
dyphire merged commit affb2a7 into main Nov 28, 2026
1 check passed
@dyphire
dyphire deleted the fix/card-edge-on-cover branch November 28, 2026 17:26
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