Skip to content

Clamp long titles to a few lines with full-title hover tooltip - #13

Merged
philoking merged 1 commit into
mainfrom
clamp-long-titles
Jun 28, 2026
Merged

philoking merged 1 commit into
mainfrom
clamp-long-titles

Conversation

@philoking

Copy link
Copy Markdown
Owner

Problem

Runaway headlines (the quote-lede ones like "He's sitting with his arms folded, in a suit, you know, 'impress me'…") wreck the Latest grid. Grid cards take their height from the tallest card in the row, so a single giant title leaves huge uneven gaps and pushes the rest of the cards into ragged rows.

Fix

In digest.html:

  • Clamp titles with -webkit-line-clamp + overflow: hidden: hero lead → 4 lines, hero-side mini and grid cards → 3 lines. A too-long headline now ends in an ellipsis instead of blowing out its card.
  • Full title on hover via a native title="" tooltip on each heading, escaped with the existing escapeAttr() helper. Added to all four render sites: hero lead, hero side, grid card, and the saved-search card.

This keeps grid rows even while the complete headline is always one hover away.

🤖 Generated with Claude Code

Runaway headlines (e.g. the "He's sitting with his arms folded…" quote-lede
ones) blew out the Latest grid: grid cards take their height from the tallest
card in the row, so one giant title left huge uneven gaps and pushed cards
into ragged rows.

Clamp titles with -webkit-line-clamp (lead 4 lines, mini/card 3) and expose
the full headline via a native title="" hover tooltip on each heading, using
the existing escapeAttr() helper. Covers hero lead, hero side, grid, and the
saved-search card.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@philoking
philoking merged commit 822944e into main Jun 28, 2026
2 checks passed
@philoking
philoking deleted the clamp-long-titles branch June 28, 2026 03:49
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