mirror of
https://github.com/vercel/workflow.git
synced 2026-09-14 19:59:43 +08:00
8a146a5bb1
* docs: revamp World documentation pages with new structure and design
- Add dedicated world detail pages at /worlds/[id] with MDX-driven content
- Create WorldDetailHero, WorldDetailToc, WorldTestingPerformance components
- Add benchmark history charts and test summary links
- Rewrite local-world, postgres-world, and vercel-world MDX with cleaner structure
- Use h3 headings for configuration options instead of tables/accordions
- Add WorldDataProvider context for passing world data to MDX components
- Add example field to worlds-manifest for linking to example repos
- Update worlds index page design
* fix: update worlds page meta title and description
* feat(docs): improve globe backdrop responsiveness and positioning
- Globe now scales with container width up to 1200px max
- Increased opacity from 20% to 30% for better visibility
- Positioned globe 30% down to show north pole behind header
- Globe component now auto-sizes based on container width
* fix(docs): add light mode support for globe backdrop
* feat: improve world page metadata and add dynamic OG images
- Update title format to '{Name} World | Workflow DevKit'
- Update worlds index page title to 'Worlds | Workflow DevKit'
- Improve world descriptions in worlds-manifest.json for better SEO
- Add dynamic OG image generation at /worlds/[id]/og
- Add openGraph and twitter metadata to world detail pages
* fix: use opengraph-image.tsx file convention for dynamic OG images
- Replace route-based og/route.tsx with opengraph-image.tsx file convention
- Remove runtime = 'edge' to allow generateStaticParams for static generation
- Simplify page.tsx metadata (Next.js auto-detects opengraph-image.tsx)
* docs: improve worlds page UI and restructure deploying section
- Fix globe visibility in light/dark mode
- Fix tooltip positioning on mobile breakpoints
- Remove redundant Documentation button for community worlds
- Add missing pages to Foundations index (streaming, serialization, idempotency)
- Restructure deploying section with new index and building-a-world guide
- Restore original MDX content for official worlds (local, vercel, postgres)
- Auto-expand sidebar folders when child page is active
* docs: simplify worlds page footer sections
* docs: move last updated section under worlds grid
* fix(docs): fix broken links and skip typecheck for interface definitions
- Fix /docs/deploying/world link to /docs/deploying/building-a-world
- Fix /docs/deploying#what-are-worlds invalid anchor to /docs/deploying
- Add @skip-typecheck markers to interface definition code blocks
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(docs): address PR review feedback
- benchmark-history/route.ts: Add error handling for JSON parsing,
distinguish 404s from actual errors
- Globe.tsx: Fix hydration mismatch by deferring theme-dependent
rendering until component is mounted
- sidebar.tsx: Improve path check robustness for active child detection
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
49 lines
993 B
TypeScript
49 lines
993 B
TypeScript
'use client';
|
|
|
|
import { createContext, useContext, type ReactNode } from 'react';
|
|
import type { World } from './types';
|
|
|
|
interface WorldDataContextValue {
|
|
worldId: string;
|
|
world: World;
|
|
meta: {
|
|
lastUpdated: string;
|
|
commit: string | null;
|
|
branch: string | null;
|
|
};
|
|
}
|
|
|
|
const WorldDataContext = createContext<WorldDataContextValue | null>(null);
|
|
|
|
interface WorldDataProviderProps {
|
|
worldId: string;
|
|
world: World;
|
|
meta: {
|
|
lastUpdated: string;
|
|
commit: string | null;
|
|
branch: string | null;
|
|
};
|
|
children: ReactNode;
|
|
}
|
|
|
|
export function WorldDataProvider({
|
|
worldId,
|
|
world,
|
|
meta,
|
|
children,
|
|
}: WorldDataProviderProps) {
|
|
return (
|
|
<WorldDataContext.Provider value={{ worldId, world, meta }}>
|
|
{children}
|
|
</WorldDataContext.Provider>
|
|
);
|
|
}
|
|
|
|
export function useWorldData() {
|
|
const context = useContext(WorldDataContext);
|
|
if (!context) {
|
|
throw new Error('useWorldData must be used within a WorldDataProvider');
|
|
}
|
|
return context;
|
|
}
|