Repository navigation
fix(cards): make the cover edge visible on the black page - #99
Merged
Merged
Conversation
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.
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.
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
#000000under a#141416cover, so the card runs into the page with nothing where it ends; the horizontal skeleton'ssurfacefallback (#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):#2C2C2Ein dark,surfacein light — the value of iOSColor.cardBackground. A fixed step rather than asurfaceContainer*role, because the ladder abovesurfaceis already spoken for by dialog cards (surfaceContainerHigh/surfaceContainerHighest).CoverArtring (Components.kt): the port of iOSThumbnailImage.borderOverlay— 0.5 dponBackgroundat 15 % on the cover, drawn above the content overlay and above the placeholder.cardBackgroundinstead ofsurface.CardTextOverlay.The bottom edge
The ring is stroked with
drawWithContentinset by half its width instead ofModifier.border.bordertraces 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 putsborderOverlayrelative to the content overlay.Verification
:app:compileDebugKotlinand:app:assembleDebugpass.