Skip to content

Commit 590c192

Browse files
feat(catalog): add 3D objects, cursors, snow, starfield and paper transitions (#4349)
* feat(catalog): shelve 3D objects and cursors in their own catalog sections Carries the generator grouping rules from #4310 and #4308. * feat(registry): add a starfield ambient overlay From #4313. * feat(registry): add a falling snow ambient overlay From #4331. * feat(registry): add a torn-paper-rip transition From #4321. * feat(registry): add a paper-collage-reveal transition From #4322. * feat(registry): add a curtain-reveal transition From #4323. * feat(registry): add 3D objects: product turntable, glass hero, exploded stack, extruded logo From #4310. * feat(registry): add eight cursor animations and the dart cursor From #4308. * fix(catalog): find items by everyday editor words and accept a bare search word From #4311. * chore(registry): remove the simulated-cursor component The Cursors section's new pointer animations replace it (from #4308). * fix(registry): take cursor-zoom-follow's screenshot from runtime variables only The declared default is empty, so page markup never becomes an image URL. Clears the code-scanning alert raised on #4308. * docs(cli): show a catalog search example that finds items "smoke" matches nothing in the catalog; "crossfade" finds fade-through. * chore(ci): allow the simulated-cursor removal in the deletion guard * fix(ci): skip tracked files missing from disk in the player CDN pin check Catalog regeneration removes a deleted item's pages before the publish PR untracks them, so the check crashed on every catalog deletion PR. * chore(cli): drop comments that narrate catalog search history * fix(registry): drag-drop keeps the family arrow and shows the drop slot only while hovering * fix(registry): agent cursor labels its steps in an accent tag, no glow or sparkles, in 4.8 s * fix(registry): annotate cursor draws a tapered marker stroke and clears the circled value * fix(registry): show real file thumbnails and end the context menu demo sooner * fix(registry): give marquee select real photos, a Finder-blue marquee and a tighter loop * fix(registry): centre the text-select toolbar on the selection and tighten its timing * fix(registry): selection cursors default to the macOS system blue * style(registry): format the agent and annotate cursor sources * fix(registry): dart-cursor stops covering the choice it makes and shows the export finishing * fix(registry): frame the product turntable fully and light it with two studio softboxes * fix(registry): touch-indicator taps like a real phone and the post it taps gets liked * fix(registry): press-ripple confirms with a check and small click rings at the cursor * fix(registry): exploded stack separates at once and marks each layer in blue as it is labelled * fix(registry): extruded logo settles facing the camera, set in Geist Bold with a neutral rim * fix(registry): magnetic cursor docks its toolbar on the selection and ends after the press * style(registry): format the exploded stack source * fix(registry): glyph trail becomes a tutorial cursor path with numbered steps on a settings screen * fix(registry): make glass-hero a clear lens that shows the headline through it * fix(registry): snow reads as real snowfall with bokeh flakes over a winter title card * fix(registry): oversized cursor is a 3.5x arrow that clicks a real editor toggle on * fix(registry): starfield reads as a drifting night sky over a real title card * style(registry): format the glass hero source * fix(registry): make the paper tear show a white fibrous edge and lift the torn sheet away * fix(registry): curtain reveal draws velvet folds that gather onto a title card * fix(registry): make every zoom-follow click change the screen and read at zoom * fix(registry): paper collage pieces stay opaque, tear with deckled grain and lift away on an arc * refactor(registry): drop dead code and correct stale comments in reworked items * fix(registry): agent cursor scrubs cleanly, docs match press-ripple, fictional demo names * docs(registry): catalog notes say oversized-cursor exits and how it differs from press-ripple * docs(registry): plain lowercase comments in oversized-cursor and touch-indicator * docs(registry): oversized-cursor names CLICK_AT as the click cue
1 parent f720724 commit 590c192

85 files changed

Lines changed: 13432 additions & 1394 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎docs/catalog-gallery.css‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,14 @@
5252

5353
#navigation-items li[data-group-tag] { --catalog-desc:""; }
5454
#navigation-items li[data-group-tag]::after { content:var(--catalog-desc); display:block; padding:0 12px 8px 40px; font-size:11px; line-height:1.5; color:var(--hf-text-secondary); }
55-
#navigation-items li[data-title="3D motion"][data-group-tag] { --catalog-desc:"Three.js scenes: orbiting cards, particle fields, and depth-lit product shots."; }
55+
#navigation-items li[data-title="3D"][data-group-tag] { --catalog-desc:"Three.js scenes and objects: camera moves, product turntables, glass, exploded layers."; }
5656
#navigation-items li[data-title="Carousels"][data-group-tag] { --catalog-desc:"Image cards that circle, orbit, or sweep a path across the frame."; }
5757
#navigation-items li[data-title="Text & captions"][data-group-tag] { --catalog-desc:"Word-by-word caption reveals, highlights, and kinetic type."; }
5858
#navigation-items li[data-title="Code"][data-group-tag] { --catalog-desc:"Code snippets that type, diff, highlight, and morph on screen."; }
5959
#navigation-items li[data-title="Transitions"][data-group-tag] { --catalog-desc:"Cuts between shots: zooms, warps, glitches, light leaks."; }
6060
#navigation-items li[data-title="Data & charts"][data-group-tag] { --catalog-desc:"Bar, line, and progress charts that animate their own data in."; }
6161
#navigation-items li[data-title="Scenes & demos"][data-group-tag] { --catalog-desc:"Full scenes: app showcases, chat exchanges, product demos."; }
62+
#navigation-items li[data-title="Cursors"][data-group-tag] { --catalog-desc:"Pointers that glide, click, drag, select, and steer the eye across a UI."; }
6263
#navigation-items li[data-title="Motion & effects"][data-group-tag] { --catalog-desc:"General-purpose motion: hovers, pops, blurs, grids, paths."; }
6364
#navigation-items li[data-title="Surfaces"][data-group-tag] { --catalog-desc:"Background textures and screen treatments: grain, halftone, glass."; }
6465
#navigation-items li[data-title="Blocks"][data-group-tag] { --catalog-desc:"Flowcharts, sketched frames, speech bubbles, and outro cards."; }

‎packages/cli/src/commands/catalog.test.ts‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,28 @@ describe("catalog --json meaning search", () => {
376376
expect(envelope.shown).toBe(1);
377377
});
378378

379+
it("treats a stray positional the same as --query, rather than dropping it", async () => {
380+
state.modelStatus = "declined";
381+
state.ranking = null;
382+
state.registry = [block("fade-through", ["transition"]), block("count-up", ["number"])];
383+
384+
const envelope = await runEnvelope({ words: "transition" });
385+
386+
expect(envelope.tier).toBe("words");
387+
expect(envelope.shown).toBe(1);
388+
});
389+
390+
it("prefers an explicit --query over a positional", async () => {
391+
state.modelStatus = "declined";
392+
state.ranking = null;
393+
state.registry = [block("fade-through", ["transition"]), block("count-up", ["number"])];
394+
395+
const envelope = await runEnvelope({ query: "number", words: "transition" });
396+
397+
expect(envelope.shown).toBe(1);
398+
expect(envelope.report_gap).toContain("number");
399+
});
400+
379401
it("carries an on-device runtime failure into the JSON envelope", async () => {
380402
state.rankingError = new Error("model could not load");
381403

‎packages/cli/src/commands/catalog.ts‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const examples: Example[] = [
77
["Filter by tag", "hyperframes catalog --type block --tag social"],
88
["Machine-readable JSON", "hyperframes catalog --json"],
99
["Interactive picker (install on select)", "hyperframes catalog --human-friendly"],
10+
["Search (positional, same as --query)", 'hyperframes catalog "crossfade"'],
1011
];
1112

1213
import * as clack from "@clack/prompts";
@@ -162,6 +163,11 @@ export default defineCommand({
162163
description: "Browse and install blocks and components from the registry",
163164
},
164165
args: {
166+
words: {
167+
type: "positional",
168+
description: "Search words, same as --query (e.g. `catalog crossfade`)",
169+
required: false,
170+
},
165171
type: {
166172
type: "string",
167173
description: 'Filter by type: "block" or "component"',
@@ -181,7 +187,8 @@ export default defineCommand({
181187
query: {
182188
type: "string",
183189
description:
184-
"Search by meaning when the on-device model is on, otherwise by name, title, description and tags",
190+
"Search by meaning when the on-device model is on, otherwise by name, title, description and tags. " +
191+
"A bare positional word works the same way (e.g. `catalog crossfade`).",
185192
},
186193
yes: {
187194
type: "boolean",
@@ -235,7 +242,8 @@ export default defineCommand({
235242
? items.filter((item) => item.tags?.some((t) => t.toLowerCase() === tagFilter))
236243
: items;
237244

238-
const query = typeof args.query === "string" ? args.query.trim() : "";
245+
const query =
246+
(typeof args.query === "string" ? args.query.trim() : "") || args.words?.trim() || "";
239247
// Collected rather than only printed, so --json can carry the same reasons
240248
// the terminal shows. A machine that asked for a tier deserves to be told
241249
// it did not run.

‎packages/cli/src/registry/localSearch.test.ts‎

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import { readFileSync, readdirSync } from "node:fs";
2+
import { dirname, join, resolve } from "node:path";
3+
import { fileURLToPath } from "node:url";
14
import { describe, expect, it } from "vitest";
25

36
import { hasNoSearchableTokens, rankByWords, searchByWords, tokenize } from "./localSearch.js";
@@ -233,3 +236,55 @@ describe("the two spellings of a compound word find the same items", () => {
233236
expect(searchByWords("typewriter", typing, fieldsOf)[0]?.name).toBe("typewriter");
234237
});
235238
});
239+
240+
// ── Catalog vocabulary regression, against the real registry ────────────────
241+
// A gap here is a tag gap, not a ranker gap: fix it in a registry-item.json.
242+
243+
describe("editor vocabulary finds the real catalog items that already do it", () => {
244+
const registryDir = resolve(dirname(fileURLToPath(import.meta.url)), "../../../../registry");
245+
246+
interface RealItem {
247+
name: string;
248+
title: string;
249+
description: string;
250+
tags: string[];
251+
}
252+
253+
function loadRealCatalog(): RealItem[] {
254+
const items: RealItem[] = [];
255+
for (const type of ["blocks", "components"]) {
256+
const typeDir = join(registryDir, type);
257+
for (const entry of readdirSync(typeDir, { withFileTypes: true })) {
258+
if (!entry.isDirectory()) continue;
259+
const name = entry.name;
260+
const manifestPath = join(typeDir, name, "registry-item.json");
261+
const manifest = JSON.parse(readFileSync(manifestPath, "utf8")) as Partial<RealItem>;
262+
items.push({
263+
name: manifest.name ?? name,
264+
title: manifest.title ?? "",
265+
description: manifest.description ?? "",
266+
tags: manifest.tags ?? [],
267+
});
268+
}
269+
}
270+
return items;
271+
}
272+
273+
const realItems = loadRealCatalog();
274+
// Mirrors how catalog.ts:609-612 splits an item's text for the word tier.
275+
const realFieldsOf = (item: RealItem) => ({
276+
strong: `${item.name} ${item.title}`,
277+
weak: `${item.description} ${item.tags.join(" ")}`,
278+
});
279+
280+
it.each([
281+
["crossfade", "fade-through"],
282+
["crossfade", "transitions-dissolve"],
283+
["cross dissolve", "transitions-dissolve"],
284+
["countdown timer", "count-up"],
285+
["split screen comparison", "comparison-split"],
286+
])("ranks %s -> %s in the top 3", (query, expectedName) => {
287+
const ranked = searchByWords(query, realItems, realFieldsOf).slice(0, 3);
288+
expect(ranked.map((item) => item.name)).toContain(expectedName);
289+
});
290+
});

0 commit comments

Comments
 (0)