mirror of
https://github.com/vercel/workflow.git
synced 2026-09-14 19:59:43 +08:00
3c7875ad73
* chore: upgrade @vercel/geistdocs to 1.17.1
Picks up the new footer (Footer no longer takes a config prop), the
heading font-weight change to 450, and the tightened navbar OSS-menu
marks. Also switches the site's own navbar logo from the vendored
geistcn LogoWorkflow fallback to the package's LogoWorkflowSdk, using
its new tuned default height instead of a hardcoded 15.
Fixes a resulting regression: navbarOssProducts entries lacked an `id`,
so resolveOssProducts' `product.id !== activeProduct` filter evaluated
to `undefined !== undefined` (false) for every entry and emptied the
OSS flyout. Added stable `id`/`label` values to each entry.
* refactor: use default navbarOssProducts list instead of a custom override
The manual navbarOssProducts array (with local logo imports/heights) is
no longer needed now that the package's DEFAULT_OSS_PRODUCTS list
already includes all these SDKs with proper id/label/section values.
navbarActiveProduct: 'workflow-sdk' now handles self-exclusion instead.
* fix: use bg-background-200 for docs surfaces to match the template
The docs, cookbook, and v5 route layouts plus the shared DocsLayout
container hardcoded bg-background-100 (pure white), so /docs/* pages
rendered on a lighter surface than the rest of the site. Switch them to
bg-background-200, matching the geistdocs template's page background.
* style: adopt package text-heading-* utilities for homepage headings
The marketing homepage headings hardcoded font-semibold (weight 600)
plus manual responsive sizes/tracking, so they rendered heavier than
the docs headings that now use Geist's 450 heading weight. Swap each
display heading to the package's text-heading-* utilities, which bundle
the 450 weight, line-height, and tracking, mapped across breakpoints to
the nearest design-system size. Inline label/emphasis spans keep their
own weight.
* style: adopt package text-heading-* utilities for worlds headings
Extends the homepage heading change to the /worlds section: the world
listing, detail, compare, and building-a-world pages plus their
components hardcoded font-semibold display headings. Swap each to the
package's text-heading-* utilities (450 weight + line-height +
tracking), mapped across breakpoints to the nearest design-system size.
Mono stat numbers, per-benchmark item labels, and the dialog title keep
their own weight.
* style: remove the bordered grid framing from the homepage
The homepage sections were wrapped in a grid divide-y border-y sm:border-x
container, drawing side borders and divider lines between every section.
Drop that framing so the sections flow with whitespace separation.
* style: remove vertical column dividers from homepage sections
Drop the divide-x column dividers still drawn inside the use-cases
(3-col), feature-grid (2-col), and templates sections, so no vertical
lines remain after the section-grid removal. Section padding keeps the
columns visually separated.
* style: make the homepage "Get started" CTA button rounded-full
* style: use text-heading-* for the feature-grid paragraph text
The two 2-col feature blurbs ("Deep integration with AI SDK.",
"Durable agents by default.") hardcoded their size/leading/tracking
plus font-medium/font-semibold weights. Those manual sizes already
equal text-heading-20/24, so swap to text-heading-20 lg:text-heading-24
— same sizes, but the Geist 450 heading weight (lead drops 600 -> 500
via the utility's [&>strong] rule). The lead stays gray-1000 for
emphasis; body stays gray-900.
* style: fade out the run-anywhere provider logos at the left/right edges
Add linear-gradient masks to the flanking cloud-provider logo groups in
the "Run anywhere, no lock-in" viz so they fade to transparent toward
the outer edges, leaving the centered code block untouched.
* style: widen the right-edge fade on the Vercel dashboard viz
The "Workflow SDK on Vercel" dashboard is offset off the right edge, so
the existing to_left black_10% mask fell off-screen and the visible
right edge hard-clipped. Widen it to black_40% so the dashboard fades
out gradually at the visible right edge.
* style: add spacing between the Vercel, use-cases, and templates sections
Wrap the UseCases and Templates sections with a top margin so there's
clear separation between "Workflow SDK on Vercel", "Build anything with
AI Agents", and "Get started" now that the section dividers are gone.
* style: widen the homepage layout from 1080px to 1200px
* style: align use-cases code block and templates cards with the Vercel section
Switch the "Build anything with" and "Get started" sections from
grid-cols-3 / [1fr_2fr] to [1fr_1.5fr], matching the "Workflow SDK on
Vercel" section above so their code block and cards share the same
right-hand column. The wider text column also lets "Build anything with"
sit on one line. Normalize both to outer padding + column gap so the
code block and cards line up exactly.
* style: extend use-cases/templates content to the right layout edge
Drop the right padding at md+ (md:pr-0) so the code block and template
cards reach the same right edge as the "Workflow SDK on Vercel"
dashboard above, which bleeds to the container edge. Mobile keeps its
padding.
* style: remove the divider between the two feature cards
Drop divide-y/lg:divide-y-0 from the feature grid so no border shows
between "Deep integration with AI SDK" and "Durable agents by default".
* refactor: position homepage sections on a shared 12-col grid
Replace the ad-hoc [1fr_1.5fr] + md:pr-0 + lg:pl-* positioning on the
Vercel, use-cases, and templates sections with a shared grid-cols-12
layout (text col-span-5, visual col-span-7), matching the vercel.com
marketing grid convention. The Vercel dashboard becomes a proper grid
cell instead of an absolutely-offset right-bleed, so all three
sections' visuals align by the grid columns with no magic values.
* style: align homepage width with the navbar content
Widen the homepage container from max-w-[1200px] to the site's
max-w-[1448px] (matching the navbar/footer) and reduce the section
gutters from sm:px-12 to sm:px-6, so section content lines up with the
navbar's content edges (right edge flush at the same column as the
navbar and footer). Also convert the "Reliability-as-code" section to
the shared grid-cols-12 layout (col-span-5 text / col-span-7 code
example), replacing its lg:grid-cols-[330px_1fr] magic values.
* refactor: handle homepage horizontal padding at the root container
Move the mobile/desktop gutter (px-4 sm:px-6) onto the homepage root
container and remove the horizontal padding from every section
component. Section content still aligns with the navbar/footer content
edges, but the gutter is now defined once instead of repeated per
section. Inner-element padding (tab buttons, visual internals) is
unchanged.
* style: left-align content sections on mobile + fix run-anywhere/o11y viz
- Left-align the centered content sections on mobile only (FeatureCardWide,
TweetWall heading, Frameworks, Run-anywhere heading/buttons), restoring
their centered layout at sm and up.
- Make the "Inspect every run" timeline span edge-to-edge by shifting its
gantt from a 14-col grid (content in cols 2-13) to a flush 12-col grid.
- Constrain the run-anywhere viz cluster to the code block width so the
provider cards (AWS/Docker/etc.) overlap behind the code block again.
* style: anchor run-anywhere provider cards to overlap the code block
Position the flanking provider-card groups relative to the centered
code block (right/left calc(50%+140px)) instead of the section edges,
so the cards sit behind and overlap the code block regardless of the
section width.
* style: make the reliability-as-code example fill its column to the right edge
Drop max-w-3xl mx-auto from the workflow/non-workflow code examples so
they fill the col-span-7 cell, aligning the code block's right edge with
the layout's right content edge (matching the tabs and other sections).
* style: split feature-card copy into a title + description
Break the AI SDK / durable-agents feature blurbs into a heading and a
separate muted description with a gap (matching the other sections)
instead of one inline paragraph, and drop the trailing periods from the
feature titles so they read as headings.
* update
* update
* style: give the tweet cards a bg-background-100 surface
* fix(swc-playground): pin monaco-editor to 0.55.1
The lockfile refresh resolved the unpinned `monaco-editor: "latest"` from
0.55.1 to 0.56.0, breaking the workflow-swc-playground Turbopack build.
0.56.0 rewrote its exports map to reroot subpaths under `esm/vs/`
("./*": "./esm/vs/*.js"). monaco-vim@0.4.4 deep-imports
`monaco-editor/esm/vs/editor/editor.api` and
`.../common/commands/shiftCommand`, which now map to
`esm/vs/esm/vs/...` — a path that does not exist. Under 0.55.1
("./*": "./*") both specifiers resolve to real files.
monaco-vim 0.4.4 is the latest published release, so pinning
monaco-editor is the only available fix.
* update
---------
Signed-off-by: christopherkindl <53372002+christopherkindl@users.noreply.github.com>
237 lines
7.1 KiB
TypeScript
237 lines
7.1 KiB
TypeScript
'use client';
|
|
|
|
import { Button } from '@vercel/geistdocs/components/button';
|
|
import {
|
|
Tooltip,
|
|
TooltipContent,
|
|
TooltipTrigger,
|
|
} from '@vercel/geistdocs/components/tooltip';
|
|
import {
|
|
BadgeCheck,
|
|
CheckIcon,
|
|
ChevronRight,
|
|
Code,
|
|
CopyIcon,
|
|
ExternalLink,
|
|
Github,
|
|
HeartHandshake,
|
|
Package,
|
|
ShieldCheck,
|
|
} from 'lucide-react';
|
|
import Link from 'next/link';
|
|
import type { ReactNode } from 'react';
|
|
import { useState } from 'react';
|
|
import { toast } from 'sonner';
|
|
import {
|
|
Breadcrumb,
|
|
BreadcrumbItem,
|
|
BreadcrumbLink,
|
|
BreadcrumbList,
|
|
BreadcrumbPage,
|
|
BreadcrumbSeparator,
|
|
} from '@/components/ui/breadcrumb';
|
|
|
|
import type { World } from './types';
|
|
|
|
interface WorldDetailHeroProps {
|
|
id: string;
|
|
world: World;
|
|
/** Docs version switcher slot, rendered above the quick links. */
|
|
versionSelect?: ReactNode;
|
|
}
|
|
|
|
export function WorldDetailHero({
|
|
id,
|
|
world,
|
|
versionSelect,
|
|
}: WorldDetailHeroProps) {
|
|
const [copied, setCopied] = useState(false);
|
|
|
|
const installCommand = `npm i ${world.package}`;
|
|
|
|
const handleCopy = () => {
|
|
try {
|
|
navigator.clipboard.writeText(installCommand);
|
|
setCopied(true);
|
|
setTimeout(() => {
|
|
setCopied(false);
|
|
}, 2000);
|
|
} catch (error) {
|
|
const message =
|
|
error instanceof Error
|
|
? error.message
|
|
: 'Failed to copy text to clipboard';
|
|
toast.error(message);
|
|
}
|
|
};
|
|
|
|
const CopyButtonIcon = copied ? CheckIcon : CopyIcon;
|
|
|
|
// GitHub source URL for official worlds
|
|
const githubUrl =
|
|
world.repository ||
|
|
(world.type === 'official'
|
|
? `https://github.com/vercel/workflow/tree/main/packages/world-${id}`
|
|
: null);
|
|
|
|
return (
|
|
<section className="space-y-6 pt-8 sm:pt-12 pb-12 border-b">
|
|
{/* Breadcrumbs */}
|
|
<Breadcrumb>
|
|
<BreadcrumbList>
|
|
<BreadcrumbItem>
|
|
<BreadcrumbLink asChild>
|
|
<Link href="/worlds">Worlds</Link>
|
|
</BreadcrumbLink>
|
|
</BreadcrumbItem>
|
|
<BreadcrumbSeparator>
|
|
<ChevronRight className="h-4 w-4" />
|
|
</BreadcrumbSeparator>
|
|
<BreadcrumbItem>
|
|
<BreadcrumbPage>{world.name}</BreadcrumbPage>
|
|
</BreadcrumbItem>
|
|
</BreadcrumbList>
|
|
</Breadcrumb>
|
|
|
|
{/* Main content grid */}
|
|
<div className="grid grid-cols-1 lg:grid-cols-[1fr_200px] gap-8 lg:gap-12">
|
|
{/* Left side - Title and description */}
|
|
<div className="space-y-4 min-w-0">
|
|
<h1 className="text-heading-40 sm:text-heading-48 flex items-center gap-4">
|
|
{world.name}
|
|
{world.type === 'official' ? (
|
|
<Tooltip>
|
|
<TooltipTrigger asChild>
|
|
<BadgeCheck className="h-8 w-8 text-blue-900" />
|
|
</TooltipTrigger>
|
|
<TooltipContent side="top">
|
|
<p className="text-xs">Maintained by Vercel</p>
|
|
</TooltipContent>
|
|
</Tooltip>
|
|
) : (
|
|
<Tooltip>
|
|
<TooltipTrigger asChild>
|
|
<HeartHandshake className="h-8 w-8 text-pink-900" />
|
|
</TooltipTrigger>
|
|
<TooltipContent side="top">
|
|
<p className="text-xs">Maintained by the community</p>
|
|
</TooltipContent>
|
|
</Tooltip>
|
|
)}
|
|
</h1>
|
|
<p className="font-mono text-sm text-muted-foreground">
|
|
{world.package}
|
|
</p>
|
|
<p className="text-lg text-muted-foreground max-w-2xl">
|
|
{world.description}
|
|
</p>
|
|
|
|
{/* Actions - Community worlds only */}
|
|
{world.type === 'community' && (
|
|
<div className="flex items-center gap-3 flex-wrap pt-2">
|
|
<div className="relative bg-background border rounded-md overflow-hidden py-3 pl-4 pr-12 inline-flex">
|
|
<pre className="text-sm">
|
|
<code>{installCommand}</code>
|
|
</pre>
|
|
<Button
|
|
onClick={handleCopy}
|
|
size="icon"
|
|
variant="ghost"
|
|
className="absolute right-1 top-1/2 -translate-y-1/2"
|
|
>
|
|
<CopyButtonIcon className="size-4 text-muted-foreground" />
|
|
</Button>
|
|
</div>
|
|
{world.repository && (
|
|
<Button
|
|
asChild
|
|
variant="outline"
|
|
size="lg"
|
|
className="h-[44px] text-base"
|
|
>
|
|
<a
|
|
href={world.repository}
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
className="inline-flex items-center gap-2"
|
|
>
|
|
GitHub
|
|
<ExternalLink className="h-4 w-4" />
|
|
</a>
|
|
</Button>
|
|
)}
|
|
</div>
|
|
)}
|
|
</div>
|
|
|
|
{/* Right side - Quick links */}
|
|
<div className="space-y-2 text-sm">
|
|
{/* Docs version switcher */}
|
|
{versionSelect ? <div className="mb-4">{versionSelect}</div> : null}
|
|
|
|
{/* NPM Package */}
|
|
<a
|
|
href={`https://www.npmjs.com/package/${world.package}`}
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
className="flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors"
|
|
>
|
|
<Package className="h-4 w-4 shrink-0" />
|
|
<span>npm</span>
|
|
</a>
|
|
|
|
{/* GitHub */}
|
|
{githubUrl && (
|
|
<a
|
|
href={githubUrl}
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
className="flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors"
|
|
>
|
|
<Github className="h-4 w-4 shrink-0" />
|
|
<span>Source</span>
|
|
</a>
|
|
)}
|
|
|
|
{/* Example */}
|
|
{world.example && (
|
|
<a
|
|
href={world.example}
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
className="flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors"
|
|
>
|
|
<Code className="h-4 w-4 shrink-0" />
|
|
<span>Example</span>
|
|
</a>
|
|
)}
|
|
|
|
{/* Encryption */}
|
|
{world.features.includes('encryption') && (
|
|
<Tooltip>
|
|
<TooltipTrigger asChild>
|
|
<Link
|
|
href="/docs/how-it-works/encryption"
|
|
className="flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors"
|
|
>
|
|
<ShieldCheck className="h-4 w-4 shrink-0 text-blue-900" />
|
|
<span>E2E Encrypted</span>
|
|
</Link>
|
|
</TooltipTrigger>
|
|
<TooltipContent
|
|
side="top"
|
|
align="start"
|
|
className="max-w-[200px]"
|
|
>
|
|
<p className="text-xs">
|
|
User data is encrypted end-to-end in the event log
|
|
</p>
|
|
</TooltipContent>
|
|
</Tooltip>
|
|
)}
|
|
</div>
|
|
</div>
|
|
</section>
|
|
);
|
|
}
|