Keep every split-bar piece one height when the README block is stale - #4
Merged
Merged
Conversation
…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.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 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. Comment |
Contributor
|
✅ AI-use disclosure found (checkbox: ai) |
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.
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.
/embednow 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 withoutwkeep 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
scpecheck reads — an unticked box counts asno disclosure at all. Using AI is fine here; not saying so is what this asks about.
🤖 Generated with Claude Code
https://claude.ai/code/session_012ZGHwbkYyNewZwMVToYQbL