Repository navigation
feat(registry): add 4 community components - #4906
Conversation
Edit accuracy: accurate 1216 (base branch 1216), smooth 1045 of thoseThe gate passes. Quarantined, measured but not gated (1)
|
…o put your brand in it A 1080x1080, 9s block for answer-engine and AI-visibility marketing. A prompt types into a chat card, the assistant answers with a ranked list of three picks, then re-ranks: the promoted brand slides into its slot (brandRank 1-3), the picks below step down, the third fades out of the list, and the brand row lands with the one accent highlight and a drawn check. Monochrome placeholder UI; prompt, lead-in, pick names, brand, rank, accent, ink and ground are variables.
Add a motion-primitive component that hangs content from a fixed pivot and lets it settle with a damped oscillation, like a hanging sign coming to rest on its hook. The swing rides a single unitless custom property (--hf-swing-angle) that the timeline eases 1 -> 0, so only rotation animates and it stays sub-pixel under the seek-by-frame capture engine. The demo drives it with a damped-oscillation ease (a cosine inside an exponential decay, normalised to land exactly upright) so the sign passes through center several times, each pass smaller, before it rests. Four enum variables: pivot (top-center/left/right), amplitude (gentle/standard/wide), direction (right/left), tone (ink/paper/accent, each a bg/fg pair to keep AA contrast on any frame). The snippet is recipe-only and does not own its timeline; its demo carries the same variable declaration. Ran npx hyperframes lint/validate on both files, regenerated registry.json via scripts/generate-registry-items.ts and the docs via scripts/generate-catalog-pages.ts.
b39c35f to
de33b11
Compare
somanshreddy
left a comment
There was a problem hiding this comment.
First pass at de33b11c. This is a comment, not an approval, and it has no blockers. Two independent passes went into it, mine and Codex's, and I checked every point below at this head. I built the CLI from this head and mounted each item in a scratch project at its install target.
What holds up
- Lint and check.
hyperframes lint: 0 errors on all four items. ai-answer-rank has 2 structure warnings (file size, nested section).hyperframes check: passes for cinemagraph, ai-answer-rank and caret-swap. ai-answer-rank has the 3 contrast warnings the description mentions, on rows that are fading out.
- Tests and checker.
registryBlocks,registryComponents,validationandvariableDefaults: 21 passed.- The whole
src/registry/directory: 248 passed, 1 skipped. scripts/catalog/plusgenerate-catalog-payloads.test.ts: 88 passed.check-catalog-source-pr.mjspasses againstorigin/main.
- The pendulum-swing contrast failure is a false positive, as the description says. The check reports
fg rgb(250,250,250)onbg rgb(247,247,248)at 0.2 s and 1.0 s, while the sign is rotated. That "background" is the demo page, not the sign's#18181bfill. At 4.5 s, at rest, the same text passes. - The rename changes nothing for existing items.
buildsFromSnippetis the only consumer, andascii-render-passandstar-rating-fillare still in the set. The only behaviour change is thatcaret-swapnow previews from its demo. - The variable declarations match.
- Each item's manifest
variablesis identical to its HTMLdata-composition-variables: 10, 7 and 4 entries. So is pendulum-swing's inlined copy indemo.html. - ai-answer-rank's
TEMPLATE.mdlists all 10 ids. - Removing
TEMPLATE.mdfrom the manifest, or deleting the file, failsregistryBlocks.test.ts.
- Each item's manifest
- caret-swap's colour variables work. It reads them as
var(--caret_color), while the shared slug helper would write--caret-color. I rendered the demo withdata-variable-valuesset to a green caret and blue text, and both applied. The runtime writes the raw--${id}on each composition root. - Provenance holds.
- All four author commits keep their original author, email and date. GitHub shows them verified, with Miguel as committer.
- The item sources match the source PRs' heads apart from the fix commits described.
- The woff2 is Geist 1.800 with a variable weight axis from 100 to 900, so it covers 400–700.
Geist-OFL.txtis the complete OFL 1.1.
- No injection paths. Free text reaches the DOM only through
textContent. Enums go through allowlists. ai-answer-rank's colours go throughCSS.supports. - Render determinism looks fine. There's no
Math.random, wall clock orrequestAnimationFrame. The fonts are either bundled (Geist) or Inter, which the compiler pins.- cinemagraph's loop seam is clean. The frames at 0 s and 9.999 s differ by at most 2/255, against 41/255 at 5 s, and only inside the steam window.
- ai-answer-rank's worst case still fits in 9 s. With a 90-character prompt and a 48-character lead of 24 one-letter words, the last tween ends at 8.96 s.
Worth fixing
-
caret-swap doesn't cap
to_text(caret-swap.html, thephrasesandprefixesloops). Each grapheme adds a prefix, a forcedgetBoundingClientRect()and three timelinesets, so the cost grows faster than the text.- Measured snapshot times: 4 s for the default, 5 s at 2,000 characters, 72 s at 20,000.
- Text that long is shrunk to fit 90% of the width, so it's unreadable well before it gets slow.
- ai-answer-rank caps its strings (90/48/32), and the same here (say about 80 graphemes for both phrases) would close this. (Codex found this; I measured it.)
-
ai-answer-rank's editing contract doesn't protect the accent (
TEMPLATE.md, Protected section). The brand monogram (.aar-mono) and the check stroke are drawn ingroundon top ofaccent. The contract only requiresinkto stay legible onground. So a pale brand accent such as yellow#fde047on the default#fcfcfbground follows the contract and still blanks out the "YB" tile and the check. One sentence would fix it: keepaccentdistinguishable fromground. (Codex found this; I confirmed the CSS.) -
Nothing tests the
PREFER_AUTHORED_DEMOset. I removed"caret-swap"from it, and all 21 registry tests and all 88 catalog-script tests still pass. The set now carries a policy rather than two measured exceptions, so a small test asserting that these three keepdemo.htmlwould stop it changing silently. Codex flagged this too.
Lower priority
- cinemagraph doesn't repaint during motion blur. It paints its canvas only from
tl.eventCallback("onUpdate", …), and the motion-blur sampler seeks withsuppressEvents: true(frameCapture.tscaptureAccumulatedFrame). So with blur on, every sub-frame sample shows the same steam. 43 registry files use this sameonUpdatepattern, and soft steam barely shows blur anyway, so this isn't a regression for this PR. Painting from a setter onst.twould fix it if blur matters here. (Codex found this; I confirmed the sampler.) - The four source PRs are still open. None of #4785, #4528, #3898 or #3764 is closed by this PR, because it has no
Closeslines. Without them, those PRs stay open after this merges and could still be merged on their own. hyperframes checkexits 1 on pendulum-swing's shipped demo because of the contrast false positive above. It doesn't block CI today. But anyone runningcheckon the installed component hits it. A checker issue for rotated text would help, or a note in the component.
Nits
- The pendulum-swing caption shrank. Moving it out of the 1.4×
.demo-frametakes it from an effective 15.4 px to 11 px on a 1920-wide frame, which is barely legible in the preview. - The "AA contrast on any frame" claim doesn't hold for
accent. pendulum-swing'stonescomment makes that claim, butaccentpairs a fixed#0b0b0cwithvar(--brand), which fails on a dark brand colour. - Two manifests have no
author. ai-answer-rank and caret-swap credit theirs, but cinemagraph and pendulum-swing don't, even though the description credits all four. - The font's source isn't recorded.
Geist-OFL.txtnames the upstream repo but not the release or fileGeist-Latin.woff2was cut from (sha25619f9c925…). The subset has 225 code points, so non-Latinfrom_text/to_textfalls back tosystem-ui. (Codex raised the provenance half.)
Where I disagreed with Codex: it voted request changes. I rated the motion-blur item lower, because the pattern is shared across the catalog and isn't new here. The other three are fixes for a follow-up commit, not blockers.
CI: green at this head (46 passed, 16 skipped).
— Somu
jrusso1020
left a comment
There was a problem hiding this comment.
Approving at de33b11c.
What I checked
- Catalog scripts:
SNIPPET_PREVIEW_RENDERS_STILLbecomesPREFER_AUTHORED_DEMO, keeps both existing members and addscaret-swap. Nothing still refers to the old name, andbuildsFromSnippetkeeps the same logic. - Untrusted variables reach the DOM through
textContentonly. I found noinnerHTMLorinsertAdjacentHTML, noevaland nofetchin any of the four items. ai-answer-rank caps every string, checks colours withCSS.supports("color", …)beforesetProperty, and falls back to slot 0 on a badbrandRank. caret-swap clampsfont_sizeto 36–160 and checksfont_weightagainst an allowlist. - Determinism: each item registers a paused timeline. cinemagraph paints from
onUpdatewith a seeded PRNG. The only network loads are the pinned GSAP 3.14.2 scripts (plus CustomEase in caret-swap). - Licensing: caret-swap keeps Remocn's MIT notice and the source commit link.
Geist-Latin.woff2(29.4 KB, a real WOFF2) ships with the Geist OFL 1.1 text, and both are listed in the item'sfiles. - Authorship: the four feature commits keep their authors' names and emails, and the fixes on top are separate commits.
- CI: 46 pass, 0 fail.
Nits, non-blocking
- caret-swap's
to_text/from_texthave no length cap. ai-answer-rank'stext(value, fallback, max)pattern would work there. monogram()takesname[0], so a brand starting with an emoji or another astral character becomes half a surrogate pair.Array.from(name)[0]fixes it.
I didn't render the items or run hyperframes check myself. For those I'm relying on the description and CI.
— Rames
What
Four community registry items in one PR. Each author's work lands as their own signed commit (author name, email and date kept), with fix commits on top.
cinemagraphai-answer-rankcaret-swappendulum-swingChanges on top of the authors' work
registry/registry.jsonentries and docs catalog pages are left out (cinemagraph via a fix commit; pendulum-swing's docs page,docs.json,catalog-index.jsonandregistry.jsonhunks were dropped while replaying its commit onto current main). The catalog publish workflow generates those after merge.SNIPPET_PREVIEW_RENDERS_STILLbecomesPREFER_AUTHORED_DEMO, andcaret-swapis added to the set so its preview uses the demo's light canvas.ad-template, andregistryBlocks.test.tsrequires every ad-template to ship aTEMPLATE.mdediting contract. Added one, modelled onai-chat-revealand built from the item's declared variables, and listed it in the manifest.hyperframes checkreportedcontent_overlap).Verification
hyperframes lintandhyperframes check(CLI built from current main) on each item, mounted in a scratch project. All four have 0 lint errors.checkpasses for cinemagraph, ai-answer-rank and caret-swap. ai-answer-rank has 3 contrast warnings, all on rows that are fading out during the re-rank.checkstill reports contrast at 1.03:1 while the sign is rotated. This is a false positive: the contrast pass takes the median pixel inside the element's axis-aligned bounding box, which for a rotated sign is mostly page background. The same text passes at rest.onUpdate. The only network asset is the standard GSAP CDN script.bunx oxfmt --checkis clean on every item directory, andscripts/check-catalog-source-pr.mjspasses.