Skip to content

feat(www): boilerplate code on model cards and modal#722

Open
MaanavD wants to merge 4 commits into
mainfrom
models-boilerplate-code
Open

feat(www): boilerplate code on model cards and modal#722
MaanavD wants to merge 4 commits into
mainfrom
models-boilerplate-code

Conversation

@MaanavD
Copy link
Copy Markdown
Collaborator

@MaanavD MaanavD commented May 21, 2026

Summary

Adds language-specific starter code (Python, JavaScript, C#, Rust) to model cards and the detail modal, replacing the cluttered variant grid and gradient callouts with a clean, focused layout.

Changes

New files

  • \model-boilerplate.ts\ — generates starter code for chat, audio, and embedding model types across 4 languages; includes run command helpers
  • \ModelStarterCode.svelte\ — dual-mode component: compact strip for cards (Py/JS/C#/Rs pills + Copy), full panel for modals (language tabs, scrollable code, install command header)

Model cards (\ModelCard.svelte)

  • Replaced: animated gradient buttons, violet SDK-only callout, variant button grid
  • Added: single \ oundry model run {alias}\ row with copy/run action + compact code strip
  • Audio/ASR models: \SDK only · Not available via CLI\ badge + code strip

Detail modal (\ModelDetailsModal.svelte)

  • Added \Get started\ code panel near the top (after stats)
  • Simplified \Available Variants\ to a clean flat list with Copy ID buttons
  • Removed: per-variant run command blocks, violet gradient SDK callout, \onCopyCommand\ prop

SDK-only models

Both card and modal surfaces show an \SDK only\ note — starter code still works via the Python/JS/C#/Rust SDKs.

…modal

- Add model-boilerplate.ts: generates language-specific starter code
  (Python/JS/C#/Rust) for chat, audio, and embedding model types
- Add ModelStarterCode.svelte: compact card strip (Py/JS/C#/Rs pills +
  Copy) and full modal panel (tabs + scrollable code block + Copy code)
- ModelCard: replace cluttered variant grid with single run command row
  + compact starter code strip; audio models show SDK-only badge
- ModelDetailsModal: add Get started panel near top; simplify Available
  Variants to a clean list with Copy ID buttons; remove per-variant
  run command blocks and violet gradient SDK callout
- Audio models show 'SDK only — not available via foundry model run'
  in both card and modal surfaces

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 21, 2026 19:44
@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

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

Project Deployment Actions Updated (UTC)
foundry-local Ready Ready Preview, Comment May 22, 2026 12:51am

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the models UI to present language-specific starter code (Python/JS/C#/Rust) on model cards and within the model details modal, replacing the previous variant-grid and callout-heavy layout with a more focused “Get started” experience.

Changes:

  • Added a shared model-boilerplate.ts utility to generate starter snippets (chat / audio transcription / embeddings) across 4 languages.
  • Introduced a new ModelStarterCode.svelte component that renders a compact “language pills + copy” strip on cards and a full tabbed panel in the modal.
  • Simplified the model details “Available Variants” section into a flat list with Copy ID actions and removed per-variant run command blocks.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
www/src/routes/models/model-boilerplate.ts Adds snippet generation utilities and language metadata for starter code.
www/src/routes/models/components/ModelStarterCode.svelte New UI component rendering starter code in compact (card) and full (modal) modes.
www/src/routes/models/components/ModelDetailsModal.svelte Adds “Get started” panel; simplifies variants UI; removes run-command copy flow.
www/src/routes/models/components/ModelCard.svelte Replaces variant grid/callouts with a single run row + compact starter code strip.
www/src/routes/models/+page.svelte Removes the now-unused onCopyCommand prop wiring for the modal.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

e.stopPropagation();
activeLanguage = lang.id;
}}
aria-label="Select {lang.label}"
Comment on lines +109 to +113
<div
class="border-border -mx-1 flex gap-0.5 border-b px-1"
role="tablist"
aria-label="Starter code language"
>
Comment on lines +115 to +118
<button
type="button"
role="tab"
aria-selected={activeLanguage === lang.id}
Add 'foundry model run {alias}' row above the SDK boilerplate panel in
ModelDetailsModal for non-audio models, matching what the model card
already shows. Audio/STT models continue to show SDK-only note only.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- CLI install panel detects current OS via userAgent and shows only the
  matching install button (Windows or macOS) by default, with a small
  'All platforms' toggle to reveal the other. Unknown OS still sees all.
- Single-OS layout uses a 2-column grid (install | run) instead of 3,
  giving the run command more breathing room.
- Model card bottom now uses small uppercase section labels ('Run with
  CLI' and 'Starter code') with extra spacing between them so the two
  actions read as distinct rows — like the old variant-button card had.
- Removed redundant 'Code:' inline label from compact ModelStarterCode
  since the section now has its own heading.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Avoids the toggle overlapping the Run command box when the panel
expands. The link now sits naturally beside the helper copy.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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