Repository navigation
kit/ui: rows, share buttons, posters and ad slots, plus kit/testing - #31
Merged
Merged
Conversation
…rogress) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…gelog Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
kit-showcase | 0eb23f1 | Commit Preview URL Branch Preview URL |
Dec 06 2026, 07:10 AM |
…o touch Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… optional button; row header centred Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…tall house ads get a corner mark - Phones: 7 or 8 buttons wrap as rows of 4, 9 or 10 as rows of 5; none is left alone on a line. The share sheet's button comes first there, and its place is kept while the page comes alive. - Tall house ads show the product's icon, or its initials, large in the lower corner. - Changelog: the five new UiText strings are marked as breaking. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…fused, and never throw Found in the walkthrough: in a browser that refuses the clipboard API and has no prompt(), the button threw and said nothing. It now tries the clipboard API, then a selected off-screen field, then the browser's own box, and stays quiet if all three fail. The browser test now expects "Link copied" in Firefox and WebKit too. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
jgb-solutions
marked this pull request as ready for review
December 6, 2026 07:10
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
Patterns for content sites, in
kit/ui(plain HTML withdata-slot, no behaviour library), with their own stylesheetui/patterns.css.Railand its parts: a row that scrolls sideways, no scrollbar, two arrows at the top right on every screen size (compact on touch screens, 44 px touch area), each disabled at its end, both hidden while the whole row fits.layout="inline"for a row of chips. Right-to-left aware; instant scrolling for people who ask for less motion. Before it is measured a row counts as fitting, so no arrow flashes in.ShareButtons(shareLinks,shareEmailHref): the one order (WhatsApp, Facebook, X, Telegram, Pinterest, LinkedIn, email, copy link) plus the phone's share sheet (first on a phone, last on a wide screen). On a phone the buttons wrap into even rows (4 + 4, 5 + 4), never one alone on a line. Plain links, no third-party script, icons from one cached file (ui/share-icons.svg; brand marks from Simple Icons, CC0). The email link is written between Cloudflare's<!--email_off-->comments. Copy link tries the clipboard API, then a selected field, then the browser's own box, and never throws.Poster: keeps its shape and shows initials on a colour made from the title when there is no picture.AdSlot(pickHouseAd): reserved height, a label, and a house ad (a wash of the brand colour, the product's name, one line, an optional button, and its icon or initials large in a tall slot's corner) that shows until the network marks its element as filled, by CSS alone (:has([data-ad-status='filled'])).enabled={false}renders nothing.kit/testing(new entry):checkTouchTargetsandadsAfterContent, self-contained functions forpage.evaluate.Choices to review
patterns.cssis 3.29 kB gzipped;core.cssstays at 6.57 kB. A page without rows, share buttons or ads (an admin) doesn't carry these rules, and an app that imports both into its own CSS still ships one file.--share-toneper network itself.UiTextgains five strings (shareOn,shareByEmail,copyLink,linkCopied,shareMore): breaking for an app that builds its own text object. The Haitian Creole strings need a native reader.Sizes (gzipped)
ui/core.cssPoster)ui/patterns.css(new)Checks
Types, 275 unit tests (19 new), build,
check:package,check:size,check:install, format, audit. Browser tests:e2e/patterns.spec.tsin Chromium, Firefox and WebKit at desktop size and at phone sizes, with the showcase's own suite (axe, the Content-Security-Policy, the page list) covering the new Patterns page.The new 44 px check found one fault in the showcase itself: its name link was 28 px tall on a phone. Fixed.
Walkthrough
Done on this pull request's preview build, at a phone size with a touch profile and at desktop width. One real fault, fixed: where a browser refuses the clipboard API and has no prompt box, "Copy link" threw and said nothing. Everything else passed: the menu drawer and focus back, row arrows and swiping, no scrollbar, even share rows with correct links, posters, both ad slots, no control under 44 px, no page wider than the phone, no console or CSP error, the 404 page, the keyboard order.
Not verified
email_offcomments around a link React did not write (documented by Cloudflare; to be checked on a Cloudflare host when the first app adopts this).:has()hiding the house ad in real ad traffic (the test sets the attribute by hand).Docs and skills
Read: Cloudflare's "Email Address Obfuscation" page (the
email_offcomments, what is and isn't rewritten); the vendored Modern Web Guidance guides for scroll snap and carousels; WCAG 2.5.8 and 2.5.5 (target size); the repo's own rules forkit/ui(data-slot,:where(), tokens only).Security review
ShareButtonswrites one list item withdangerouslySetInnerHTML(the email link, so the comments can exist). Every value in it is attribute-escaped (& " ' < >), the title and address are also URL-encoded, and a unit test feeds it hostile values and checks that no tag buta,svgandusecomes out.rel="noopener noreferrer". No third-party script, no new request from the kit.share-icons.svgholds symbols only (a test fails onscript,hreforurl(in it).kit/testingimports nothing and runs only in tests.bun audit: no vulnerabilities.🤖 Generated with Claude Code