Skip to content

Keep every split-bar piece one height when the README block is stale - #4

Merged
augbastos merged 1 commit into
mainfrom
fix/split-bar-heights
Sep 16, 2026
Merged

augbastos merged 1 commit into
mainfrom
fix/split-bar-heights

Conversation

@augbastos

Copy link
Copy Markdown
Owner

What this changes

The hoverable language bar in the README broke into steps: each slice rendered at a slightly different height.

Cause. The README freezes each slice's width percentage until the next refresh, but the Worker drew each piece at the width computed from live data. Once the language mix moved, every piece had a different aspect ratio, so at the README's widths each one rendered at its own height — 26.5 to 38.3 px, measured on the live card.

Fix. /embed now puts each piece's declared width in its URL (w, millionths of the card), and the Worker draws caps and slices at that width, cached per width. However stale the block is, every piece keeps one height; only the proportions drift until the next refresh, as documented. Blocks without w keep the previous behaviour until they are regenerated.

A test generates a block, shifts the language mix, and asserts every piece renders at one height. It fails on the previous code.

AI use

Tick exactly one. This is the signal the scpe check reads — an unticked box counts as
no disclosure at all. Using AI is fine here; not saying so is what this asks about.

  • I used generative AI
  • I did not use generative AI

🤖 Generated with Claude Code

https://claude.ai/code/session_012ZGHwbkYyNewZwMVToYQbL

…ock is stale

A README freezes each slice's width percentage until the next refresh, but the Worker drew each piece at the width computed from live data. Once the language mix moved, every piece had a different aspect ratio, so at the README's widths each rendered at its own height and the bar broke into steps (26.5 to 38.3px measured on the live card). The embed now puts each piece's declared width in its URL (w, millionths of the card) and the Worker draws caps and slices at that width, cached per width. Blocks without w keep the live width. A test generates a block, shifts the mix, and asserts every piece renders at one height; it fails on the previous code.
@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: f35e48d3-7fb9-4253-9cc0-e9902c62236c


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

✅ AI-use disclosure found (checkbox: ai)

@augbastos
augbastos merged commit 3830240 into main Sep 16, 2026
16 checks passed
@augbastos
augbastos deleted the fix/split-bar-heights branch September 16, 2026 08:43
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