Skip to content

feat(hero): try-it block with the walletless pull command - #248

Open
alpergundogdu wants to merge 2 commits into
mainfrom
feat/try-it-out
Open

alpergundogdu wants to merge 2 commits into
mainfrom
feat/try-it-out

Conversation

@alpergundogdu

Copy link
Copy Markdown
Contributor

Summary

A "try it: pull a real model." block at the foot of the hero, on the same paper background, below the illustrative terminal (which stays). It turns the seeded catalogue in public/models.json into one copy-paste command per model.

  • Model dropdown with size, license, and a Hugging Face source link.
  • Command panel: a real terminal panel, not aria-hidden, with the install-and-pull line by BLAKE3 hash:
    • macOS/Linux: curl -fsSL https://up.decdn.org/decdn.sh | sh -s -- pull b3:<hash>
    • Windows (x64/ARM64): irm https://up.decdn.org/decdn.ps1 | iex; decdn-sponsored pull b3:<hash>
  • OS switch that defaults to the visitor's OS. It uses useSyncExternalStore, so the static HTML always renders the POSIX line and there's no hydration mismatch.
  • Copy button that falls back to selecting the command when the clipboard API is blocked.
  • #try anchor for launch posts and the homepage banner to link to.
  • The text lives in lib/copy.ts, the command builder in lib/models.ts (with tests), and llms-full.txt mirrors the block with every model's command.

The installers are served by sponsord: decdn/sponsord#6 (the decdn-sponsored CLI and decdn.sh), plus the Windows decdn.ps1 in a follow-up. The /dl/ binary hosting behind them isn't live yet, so the commands work end to end once it is.

Test plan

  • pnpm format:check, pnpm lint, pnpm typecheck
  • pnpm test: 484 passed, including lib/models.test.ts (catalogue hashes, both commands, OS detection)
  • pnpm build, including check:out and check:og-image
  • Reviewed locally at mobile and desktop widths: the dropdown swaps hash/size/license (checked SDXL against models.json), the OS switch swaps the command and prompt, and copy falls back to selecting the command

🤖 Generated with Claude Code

Add a block at the foot of the hero that turns the seeded catalogue
(public/models.json) into one copy-paste command per model:

- a model dropdown with size, license and source;
- the install-and-pull line by BLAKE3 hash, with a macOS/Linux |
  Windows switch that defaults to the visitor's OS (curl | sh, or
  irm | iex in PowerShell);
- a copy button that falls back to selecting the command when the
  clipboard is blocked;
- an #try anchor for launch copy to link to.

Copy lives in lib/copy.ts and the command in lib/models.ts, and
llms-full.txt mirrors the block with every model's command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 24, 2026 15:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The llms-full.txt Windows example command currently omits the required b3: prefix, making the mirrored copy-paste instruction incorrect.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds a new “Try it: pull a real model” block at the bottom of the homepage hero, backed by a seeded model catalogue and shared command-building helpers, and mirrors the content into the llms-full.txt static export.

Changes:

  • Introduces lib/models.ts (catalogue + OS detection + command builder + size formatting) with vitest coverage.
  • Adds a new client component TryIt rendered from Hero, including model selection, OS toggle, and copy-to-clipboard fallback behavior.
  • Extends llms-full.txt generation to include the try-it copy and per-model commands, and adds installer URLs to lib/links.ts.
File Description
lib/​models.ts Adds model catalogue types/data export, platform detection, command builder, and size formatting.
lib/​models.test.ts Adds tests validating catalogue invariants and command/platform helpers.
lib/​links.ts Adds installer URLs used by the generated pull commands.
lib/​copy.ts Adds try-it headline/lead/notes copy for homepage + llms mirroring.
components/​site/​TryIt.tsx Implements the hero “try it” UI (model dropdown, OS switch, copy behavior).
components/​site/​Hero.tsx Renders the new TryIt block under the existing hero terminal.
app/​llms-full.txt/​route.ts Mirrors the try-it block content and model commands into llms-full.txt.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread app/llms-full.txt/route.ts Outdated
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Deploying website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 25f765a
Status: ✅  Deploy successful!
Preview URL: https://979fde8b.website-70y.pages.dev
Branch Preview URL: https://feat-try-it-out.website-70y.pages.dev

View logs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants