Repository navigation
[Feature] Codeblock: match shadcn (Base UI + vega) - #656
Merged
Merged
Conversation
- CodeblockContent: scroll-fade-x, scrollbar-thin and data-wrap:scroll-fade-y, with the scroll-fade-x/-y utilities ported to the installer and docs CSS. - Copy failures show nothing, as in shadcn; clipboard_error:/error_label: are deprecated and ignored. - Audit: fixture covers header, title, footer and numbered diff lines; selectors and the style/onClick props in the map; baseline at 8a353667. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 13 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The shadcn audit of the Codeblock found one visual gap and one behavior difference. This PR fixes both and widens the audit fixture so every part of the component gets checked in the browser.
What changes
CodeblockContentgets shadcn'sscroll-fade-x scrollbar-thin data-wrap:scroll-fade-y. When a line is wider than the block, the cut edge fades out (and the start fades too once you scroll), and the scrollbar is thin. Withwrap: truethe fade runs top and bottom.scroll-fade-xandscroll-fade-yutilities are ported from shadcn'stailwind.css(MIT) into the installer template (tailwind.css.erb) and the docs CSS, next to thescroll-fade-bMessageScroller already uses.scrollbar-thincomes with Tailwind 4.3.Deprecated
Codeblock(clipboard_error:)andCodeblockCopyButton(error_label:)are still accepted but ignored, with a deprecation warning. They can be removed in the next major.Audit
removed,addedandhighlightedvariants. The map gains selectors forCodeblockHeader,CodeblockTitle,CodeblockLineandCodeblockFooter, which the audit never rendered before.styleonCodeblockContentandonClickonCodeblockCopyButton.onClickis a registered divergence (audit/divergences/codeblock.yml): Ruby has no React event prop, and adata: {action: ...}passed in runs next to the copy.8a353667.collectdoesn't comparemask-imageorscrollbar-width, so onmainit reported the content as matching. I checked both by hand here.Before / after
A line wider than the block, light mode, pointer over the block (the copy button only shows on hover or focus):
Audit on main (before)
Audit on this PR (after)
Test steps
cd gem && bundle exec rake(tests and standardrb).cd docs && bin/dev, open/docs/codeblockand narrow the window until a line overflows. The cut edge fades, and scrolling right fades the start as well.Warning[:deprecated] = true,Codeblock(code, clipboard_error: "x")prints a deprecation warning.🤖 Generated with Claude Code
Summary by cubic
Closes the last visual and behavioral gaps between the Codeblock and shadcn's: overflowing lines now fade at the cut edge instead of being clipped, and a failed copy shows nothing instead of announcing "Copy failed".
Migration
clipboard_error:anderror_label:are ignored and emit a deprecation warning; remove them in the next major.scroll-fade-x/scroll-fade-yutilities were added to the installer template and the manual install docs CSS, so existing projects must regenerate their Tailwind CSS or copy the utilities to get the fade.Audit
CodeblockHeader,CodeblockTitle,CodeblockLine, andCodeblockFooter.onClickas a divergence: a Rubydata: {action: ...}runs alongside the copy.Written for commit 844118e. Summary will update on new commits.