Skip to content

feat(web): show install command on component detail pages - #5

Merged
codewizdave merged 2 commits into
mainfrom
feat/install-command-on-detail
Jul 29, 2026
Merged

feat(web): show install command on component detail pages#5
codewizdave merged 2 commits into
mainfrom
feat/install-command-on-detail

Conversation

@martyy-code

@martyy-code martyy-code commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

A visitor on /components// now sees an Install section between the title/description and the Preview | Code tabs. One command visible (GitHub-registry mode), URL mode + namespace mode nested in a

Details block.

What's in this PR

  • New component apps/web/components/install-command/{index,install-command}.tsx — renders the install commands, reuses the existing CodeBlock so syntax highlighting matches the rest of the UI.

  • Detail page edit — import + render between the title section and Tabs:

    <InstallCommand itemId={component.id} />
  • CodeBlock edit — added "bash" to the SupportedLang union. Shiki supports bash natively; only the TS surface needed widening.

What's not in this PR

  • A working copy button. The existing CodeBlock doesn't have one, and neither does the existing Preview | Code tabs' Copy button (it exists visually but has no onClick — pre-existing bug noted earlier in the project). Adding a client-side copy click handler here would be a one-component fix but expands scope.
  • Homepage install section. Per the AskUserQuestion, the install belongs at the moment of decision, which is the detail page. The homepage stays focused on browsing.
  • Third install mode (MCP, etc.). The 3 modes currently in the README are mirrored; new modes will be added when Phase 6 of the plan lands.

Visual shape

A heading "Install", a one-line caption, the GitHub-mode command in a code block (syntax-highlighted via Shiki thanks to the new "bash" lang support), and a collapsible

with the URL-mode and namespace-mode commands.

CI expectations

This PR touches showcase-only source code (apps/web/). No impact on:

  • registry.json, registry/base-nova/** — drift job unchanged
  • The build pipeline — emitted JSONs are unaffected
  • @workspace/registry build — detail page doesn't directly import from it

The 6 CI jobs (lint, typecheck, contract, drift, registry-validate, build-showcase) should all stay green.

🤖 Generated with Claude Code

A visitor landing on a component detail page now sees an
Install section right after the description, before the
Preview/Code tabs. Single command visible (GitHub registry
mode), with URL mode and namespace mode nested in a
<details> block.

Components added:
- apps/web/components/install-command/{index,install-command}.tsx
  - Renders the GitHub-mode command by default
  - <details> with the URL-mode and namespace-mode commands
  - Reuses CodeBlock (already supports copy-button via Shiki
    wrapping via the existing pattern in the detail page)

Detail-page edit:
- apps/web/app/components/[category_id]/[component_id]/page.tsx
  - Imports + renders <InstallCommand itemId={component.id} />
    between the title/description section and the <Tabs>

CodeBlock edit:
- apps/web/components/code-block.tsx
  - Added "bash" to SupportedLang union so shell commands render
    with syntax highlighting through Shiki (which already
    supports bash; only the TS surface needed widening)

Choice rationale (single-cmd + details, detail page only):
the homepage is the browse surface; the install belongs at
the moment of decision, which is the detail page. A single
visible command stays scannable; the <details> contains the
alt modes for users who need them.

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

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ui-web Ready Ready Preview, Comment Jul 29, 2026 11:52am

@codewizdave
codewizdave merged commit 863a411 into main Jul 29, 2026
8 checks passed
martyy-code added a commit that referenced this pull request Jul 29, 2026
Follow-up to PR #5 (install-command on detail pages).

PR #5 added "bash" to the SupportedLang type in CodeBlock
but did not preload the bash grammar in apps/web/lib/shiki.ts.
At runtime, Shiki tried to highlight bash and threw
"ShikiError: Language \ not found, you may need to load it first"
on every render of a component detail page.

One-line fix: add "bash" to the langs array passed to
createHighlighter. Shiki lazy-loads grammars; this loads only
when getHighlighter() is first called, so there's no runtime
overhead beyond the one-time fetch.

Co-Authored-By: Claude <noreply@anthropic.com>
martyy-code added a commit that referenced this pull request Jul 29, 2026
Follow-up to PR #5 (install-command on detail pages).

PR #5 added "bash" to the SupportedLang type in CodeBlock but did
not preload the bash grammar in apps/web/lib/shiki.ts. At runtime
Shiki threw:

    ShikiError: Language "bash" not found, you may need to load it first

on every render of a component detail page.

One-line fix: add "bash" to the langs array passed to
createHighlighter. Shiki lazy-loads grammars; this loads only when
getHighlighter() is first called, so there's no runtime overhead
beyond the one-time fetch.

Co-Authored-By: Claude <noreply@anthropic.com>
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