Smoother shimmer for the slots in long grids and song lists

Open
#254 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
css, javascript

Research direction

Start in src/Melodex.Web/wwwroot/css/app.css at the .tile-grid > div:not([class])::after and .card:has(> table.slots)::before rules, and at grid.js, which measures the slot shapes. Check the @keyframes shimmer block and the prefers-reduced-motion rules. Done means the shine moves on a layer inside still masked shapes, only screen-tall and sticky, with no paint flashing in the sandbox (docs/testing.md) during fast scrolling, and @keyframes shimmer removed once unused. Agree the approach on the issue before building.

Written by the indexing model from the issue text.

Description

enhancement frontend
What you'd like to do

Long grids of artists and albums (#14) and long song lists (#10) draw only the rows near the screen. Rows not drawn yet show slots shaped like tiles or song rows, shimmering, so fast scrolling fills in rather than flashing blank. The shimmer is a background moved with background-position on a masked pseudo-element as tall as the whole grid or list, so the browser repaints all of it on every frame:

  • grids: .tile-grid > div:not([class])::after, with shapes measured by grid.js;
  • song lists: .card:has(> table.slots)::before.

Both are in src/Melodex.Web/wwwroot/css/app.css. Covers and text lines were already changed (#5) to a still shape with the shine moved by transform on a layer of its own, which isn't repainted.

How it could work

The same idea, but the shine can't just be moved with transform here: the shapes come from the mask on the same pseudo-element, and moving it would move the mask with it. So:

  • Keep the masked shapes still, and put the shine on a layer of its own inside them, moved with transform. A mask on a parent clips a child moved by transform without repainting. That probably means a real element (or a wrapper) rather than only pseudo-elements.
  • Make the shine only as tall as the screen, sticky in view, not as tall as the grid: it only needs to be where you can see it.
  • Keep what works now: slots line up with the tiles and rows drawn, phone layouts, playlists' extra button, and prefers-reduced-motion.
  • Once nothing uses @keyframes shimmer any more, remove it.
Anything else

Check it in the sandbox with a long Library grid and a long playlist, scrolling fast, with the browser's paint flashing on: the slots shouldn't flash while they shimmer, and scrolling should stay smooth on a phone.

Building it
  • I'd like to build this myself, once it's agreed.
Dominant language
C#
Stars
0
Forks
0
Avg merge
9h 10m
Merged PRs (30d)
126

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Dextrd/Melodex

All issues in Dextrd/Melodex

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.