Skip to content

course cards: four RU share cards clip their URL at 33 lessons #1441

Description

@gHashTag

Defect

With 33 lessons the progress strip on the course share cards (public/{,ru/}learn/<slug>/card.png, 1200x630) is about 64 px longer than with 30, and four Russian cards now run their URL into the right edge of the image:

lesson card last URL pixel, main (30 cells) with 33 cells
9 ru/learn/compiles-is-not-correct x=1144 x=1197 (clipped)
11 ru/learn/t27c-on-a-real-machine x=1133 x=1197 (clipped)
12 ru/learn/seven-backends-and-t27b x=1144 x=1198 (clipped, final "b" lost)
26 ru/learn/same-bits-on-the-board x=1133 x=1197 (clipped)

Eight more cards keep less than 40 px of the 64 px side margin. Measured by scanning the URL row (y 552-590) of every card for the URL colour.

Cause

apps/website/scripts/course-pages.mjs:108-110 fixes the strip and the URL in pixels: 13 px cells with a 4 px gap, a 9 px module break, a 17 px monospace URL with white-space: nowrap. Nothing shrinks when the lesson count grows.

Fix (needs owner-approved-foreign)

The fix is in course-pages.mjs, a hand-written .mjs file, so under the owner's only-t27 rule it waits for the owner's label. One line of CSS is enough, for example letting the URL shrink (min-width: 0; overflow: hidden; text-overflow: ellipsis) or deriving the cell size from C.lessons.length so the strip has a fixed width. Renaming the four slugs is not an option: they are live URLs.

Found while landing #1440.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions